qualifications-details.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <view class="container qualifications" :style="{ paddingBottom: isIphoneX ? 150 + 68 + 'rpx' : '150rpx' }">
  3. <view class="qualifications-content" v-if="!isEmpty">
  4. <view class="list" v-for="(item, index) in qualificationsList" :key="index">
  5. <view class="list-view-title">商品{{ index + 1 }}</view>
  6. <view class="list-view">
  7. <view class="list-view-label">商品</view> <view class="list-view-text">{{ item.productName }}</view>
  8. </view>
  9. <view class="list-view">
  10. <view class="list-view-label">SN码</view> <view class="list-view-text">{{ item.sn }}</view>
  11. </view>
  12. <view class="list-view" v-for="(file, fileIndex) in item.fileList" :key="fileIndex">
  13. <view class="list-view-label">资质文件</view>
  14. <view class="list-view-text">{{ file.fileName }}</view>
  15. </view>
  16. <view class="list-view-title none">图片</view>
  17. <view class="list-view-upload clearfix">
  18. <view class="photo-item" v-for="(image, imageIndex) in item.imageList" :key="index">
  19. <image
  20. :src="image"
  21. mode="aspectFill"
  22. @click.stop="previewImg(item.imageList, imageIndex)"
  23. ></image>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="qualifications-btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '0' }">
  28. <view class="edit-button" @click="editSubmitFn('edit')">编辑</view>
  29. </view>
  30. </view>
  31. <view v-else class="cart-content empty">
  32. <view class="empty-container">
  33. <image
  34. class="empty-container-image"
  35. src="https://static.caimei365.com/app/img/icon/icon-ques-empty@2x.png"
  36. mode="aspectFit"
  37. ></image>
  38. <text class="error-text">暂无商品资质信息</text>
  39. <view class="login-btn" @click="editSubmitFn('add')">去补充</view>
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. import { mapState, mapMutations } from 'vuex'
  46. import authorize from '@/common/config/authorize.js'
  47. var isPreviewImg
  48. export default {
  49. data() {
  50. return {
  51. logisticsBatchId: 0,
  52. shopOrderId: 0,
  53. isIphoneX: this.$store.state.isIphoneX,
  54. isEmpty: false,
  55. qualificationsList: []
  56. }
  57. },
  58. onLoad(option) {
  59. this.shopOrderId = option.shopOrderId
  60. this.logisticsBatchId = option.logisticsBatchId
  61. console.log('shopOrderId', this.shopOrderId)
  62. this.GetSupplierQualificationData(option.logisticsBatchId)
  63. },
  64. methods: {
  65. ...mapMutations(['login']),
  66. GetSupplierQualificationData(logisticsBatchId) {
  67. this.ShopService.GetSupplierQualificationData({
  68. logisticsBatchId: logisticsBatchId
  69. })
  70. .then(response => {
  71. const data = response.data
  72. if (data && data.length > 0) {
  73. this.qualificationsList = data
  74. this.isEmpty = false
  75. } else {
  76. this.isEmpty = true
  77. }
  78. })
  79. .catch(error => {
  80. this.$util.msg(error.msg, 2000)
  81. })
  82. },
  83. editSubmitFn(type) {
  84. switch (type) {
  85. case 'edit':
  86. this.$api.navigateTo(
  87. `/pages/supplier/deliver/qualifications-add?type=edit&logisticsBatchId=${
  88. this.logisticsBatchId
  89. }&shopOrderId=${this.shopOrderId}`
  90. )
  91. break
  92. case 'add':
  93. this.$api.navigateTo(
  94. `/pages/supplier/deliver/qualifications-add?type=add&logisticsBatchId=${
  95. this.logisticsBatchId
  96. }&shopOrderId=${this.shopOrderId}`
  97. )
  98. break
  99. }
  100. },
  101. previewImg(Array, index) {
  102. //顶部商品图片预览
  103. console.log(Array)
  104. isPreviewImg = true
  105. let previewUrls = Array
  106. uni.previewImage({
  107. current: index, //图片索引
  108. urls: previewUrls, //必须是http图片,本地图片无效
  109. longPressActions: ''
  110. })
  111. }
  112. },
  113. onShow() {}
  114. }
  115. </script>
  116. <style lang="scss">
  117. page {
  118. height: auto;
  119. background: #f7f7f7;
  120. }
  121. .qualifications-content {
  122. width: 100%;
  123. height: auto;
  124. .list {
  125. width: 100%;
  126. height: auto;
  127. background-color: #ffffff;
  128. box-sizing: border-box;
  129. margin-bottom: 20rpx;
  130. padding: 0 24rpx;
  131. .list-view-title {
  132. width: 100%;
  133. height: 92rpx;
  134. border-bottom: 1px solid #e1e1e1;
  135. line-height: 92rpx;
  136. font-size: $font-size-30;
  137. color: #333333;
  138. text-align: left;
  139. &.none {
  140. border-bottom: none;
  141. color: #666666;
  142. }
  143. }
  144. .list-view {
  145. width: 100%;
  146. height: 92rpx;
  147. border-bottom: 1px solid #e1e1e1;
  148. line-height: 92rpx;
  149. font-size: $font-size-30;
  150. .list-view-label {
  151. width: 192rpx;
  152. color: #666666;
  153. float: left;
  154. }
  155. .list-view-text {
  156. width: 510rpx;
  157. color: #333333;
  158. text-overflow: ellipsis;
  159. overflow: hidden;
  160. display: -webkit-box;
  161. -webkit-line-clamp: 1;
  162. line-clamp: 1;
  163. -webkit-box-orient: vertical;
  164. float: right;
  165. }
  166. }
  167. .list-view-upload {
  168. width: 100%;
  169. height: auto;
  170. padding: 10rpx 0;
  171. .photo-item {
  172. display: inline-block;
  173. width: 112rpx;
  174. height: 112rpx;
  175. margin: 10rpx 0;
  176. margin-right: 25rpx;
  177. border-radius: 10rpx;
  178. border: 1px solid #f5f5f5;
  179. position: relative;
  180. float: left;
  181. &.add {
  182. width: 112rpx;
  183. height: 112rpx;
  184. border-color: #ffc684;
  185. text-align: center;
  186. line-height: 112rpx;
  187. margin-right: 0rpx;
  188. .icon-jiahao {
  189. font-size: $font-size-44;
  190. color: #ffc684;
  191. font-weight: bold;
  192. }
  193. }
  194. .icon-iconfontguanbi {
  195. width: 30rpx;
  196. height: 30rpx;
  197. border-radius: 50%;
  198. display: block;
  199. position: absolute;
  200. right: -10rpx;
  201. top: -10rpx;
  202. background: #f94b4b;
  203. text-align: center;
  204. line-height: 30rpx;
  205. color: #ffffff;
  206. font-size: $font-size-22;
  207. }
  208. image {
  209. width: 112rpx;
  210. height: 112rpx;
  211. border-radius: 10rpx;
  212. }
  213. }
  214. .photo-list {
  215. width: 100%;
  216. height: 116rpx;
  217. overflow: hidden;
  218. white-space: nowrap;
  219. display: flex;
  220. align-items: flex-start;
  221. }
  222. .scoll-wrapper {
  223. display: flex;
  224. align-items: flex-start;
  225. }
  226. }
  227. }
  228. .qualifications-btn {
  229. width: 100%;
  230. height: 90rpx;
  231. padding-top: 60rpx;
  232. position: fixed;
  233. bottom: 0;
  234. left: 0;
  235. background-color: #ffffff;
  236. .edit-button {
  237. width: 600rpx;
  238. height: 90rpx;
  239. background: $btn-confirm;
  240. line-height: 90rpx;
  241. text-align: center;
  242. color: #ffffff;
  243. font-size: 30rpx;
  244. margin: 0 auto;
  245. border-radius: 45rpx;
  246. }
  247. }
  248. }
  249. </style>