details.vue 6.0 KB

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