addcompanytwo.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <template>
  2. <view>
  3. <u-navbar leftText="返回" title="企业认证" :safeAreaInsetTop="false">
  4. <view class="u-nav-slot" slot="left">
  5. <u-icon @click='navback' name="arrow-left" size="19"></u-icon>
  6. </view>
  7. <view class="u-nav-slot" slot="right">
  8. <view @click="goDetailPage('/pages/mine/company/addcompanythree')" class='next'>下一步</view>
  9. </view>
  10. </u-navbar>
  11. <view class='content1'>
  12. <view class="title">上传房产证或租赁合同</view>
  13. <view style='position:relative;'>
  14. <view v-if='!dataDetails.propertyAddressUrl' @click="uploadImg(1)" class="picture">
  15. <image class="xj-image" src="@/static/mine/company/tianjiazhaopian@3x.png"></image>
  16. </view>
  17. <view v-if='dataDetails.propertyAddressUrl' @click.stop="uploadImg(1)"
  18. class="preview-card-img picture">
  19. <view @click.stop="delCard(1)">
  20. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  21. </image>
  22. </view>
  23. <image class="uploadimage" :src="dataDetails.propertyAddressUrl" mode="aspectFit"></image>
  24. </view>
  25. </view>
  26. </view>
  27. <view class='content'>
  28. <view class="flex row">
  29. <view class="left-text">场地租赁截止日期</view>
  30. <view style='font-size:16px;width:50%;' class='flex flex-space-between' @click="selectValidityPeriod">
  31. <view :style="{'color':dataDetails.siteLeaseDate ? '#000':'#C6CBD5'}">{{dataDetails.siteLeaseDate?dataDetails.siteLeaseDate:'选择日期'}}</view>
  32. <view><u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon></view>
  33. </view>
  34. </view>
  35. <view class="flex row noborder">
  36. <view style='width:285px;' class="left-text">申请开通平台垫付运费业务</view>
  37. <view>
  38. <u-switch @change="change" v-model="value" inactiveColor='#ABB0BB' size="20" ></u-switch>
  39. </view>
  40. </view>
  41. <u-picker :show="isShowcardValidity" ref="uPicker" :columns="validityPeriod"
  42. @confirm="confirmValidityPeriod" @change="changeHandler" @cancel="isShowcardValidity=false" >
  43. </u-picker>
  44. </view>
  45. <view class='footer'>
  46. <view @click="goDetailPage('/pages/mine/company/addcompanythree')" class='newlyIncreased'>下一步</view>
  47. </view>
  48. <u-action-sheet :actions="$helper.imgTypeList" :title="$helper.imgType" :show="isShowimgType"
  49. @select="imgTypeSelect" :closeOnClickOverlay="true" :closeOnClickAction="true" @close="isShowimgType=false">
  50. </u-action-sheet>
  51. </view>
  52. </template>
  53. <script>
  54. import upload from '@/components/upload.vue';
  55. import uploadImage from '@/components/ossutil/uploadFile.js';
  56. export default {
  57. data() {
  58. return {
  59. dataDetails:{},
  60. value:false,
  61. isShowcardValidity:false,
  62. uploadType:'',
  63. index:'',
  64. isShowimgType:false,
  65. validityPeriod:[]
  66. }
  67. },
  68. onLoad(){
  69. var _this=this
  70. this.validityPeriod = this.$helper.makeValidityPeriod(0,100)
  71. uni.getStorage({
  72. key: 'companydata',
  73. success: function (res) {
  74. console.log(res.data);
  75. _this.dataDetails = JSON.parse(res.data)
  76. if(_this.dataDetails.advanceFreightService){
  77. _this.value=true
  78. }
  79. }
  80. });
  81. },
  82. methods: {
  83. navBack() {
  84. uni.navigateBack();
  85. },
  86. change(e){
  87. if(this.value){
  88. _this.$set(_this.dataDetails,'advanceFreightService',1)
  89. }else{
  90. _this.$set(_this.dataDetails,'advanceFreightService',0)
  91. }
  92. },
  93. imgTypeSelect(val) {
  94. var _this=this
  95. if (val.name == '相册') {
  96. uni.chooseImage({
  97. count: 1,
  98. sourceType: this.$helper.chooseImage.sourceType,
  99. success: function(res) {
  100. console.log(JSON.stringify(res.tempFilePaths));
  101. uploadImage(res.tempFilePaths[0], 'appData/',
  102. result => {
  103. // 上传成功回调函数
  104. console.log('图片地址', result)
  105. _this.$set(_this.dataDetails,'propertyAddressUrl',result)
  106. console.log(_this.dataDetails)
  107. }
  108. )
  109. }
  110. });
  111. } else {
  112. uni.chooseImage({
  113. count: 1,
  114. sourceType: ['camera'],
  115. success: function(res) {
  116. console.log(JSON.stringify(res.tempFilePaths));
  117. uploadImage(res.tempFilePaths[0], 'appData/',
  118. result => {
  119. // 上传成功回调函数
  120. console.log('图片地址', result)
  121. _this.dataDetails.propertyAddressUrl=result
  122. }
  123. )
  124. }
  125. });
  126. }
  127. },
  128. uploadImg(type, index) {
  129. this.uploadType = type
  130. this.isShowimgType = true
  131. this.index = index
  132. },
  133. goDetailPage(src) {
  134. uni.setStorage({key: 'companydata',data: JSON.stringify(this.dataDetails)});
  135. uni.$u.route(src);
  136. },
  137. selectValidityPeriod() {
  138. this.isShowcardValidity = true
  139. },
  140. confirmValidityPeriod(e) {
  141. console.log('confirm', e)
  142. if (e.value[0] == '长期') {
  143. this.dataDetails.siteLeaseDate = e.value[0]
  144. } else {
  145. this.dataDetails.siteLeaseDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  146. }
  147. this.isShowcardValidity = false
  148. },
  149. changeHandler(e) {
  150. const {
  151. columnIndex,
  152. value,
  153. values,
  154. index,
  155. picker = this.$refs.uPicker
  156. } = e
  157. // if (columnIndex === 0) {
  158. //
  159. // if (e.index != 0) {
  160. // picker.setColumnValues(1, this.validityPeriod[1].shift())
  161. // }
  162. // } else if (columnIndex === 1) {
  163. // if (e.index != 0) {
  164. // picker.setColumnValues(2, this.validityPeriod[2].shift())
  165. // }
  166. // }
  167. },
  168. }
  169. }
  170. </script>
  171. <style lang="scss" scoped>
  172. page{
  173. background:#F5F6FA;
  174. }
  175. .preview-card-img {
  176. /deep/uni-image.uploadimage {
  177. width:212rpx;
  178. height:212rpx;
  179. }
  180. }
  181. .next{
  182. color:#2772FB;
  183. font-size:13px;
  184. }
  185. .content1,.content {
  186. background:#fff;
  187. padding:40rpx 20rpx 40rpx;
  188. margin:110rpx 20rpx 20rpx;
  189. border-radius: 10rpx;
  190. .row {
  191. border-bottom: 1px solid #EEEEEE;
  192. padding-bottom: 28rpx;
  193. margin-top: 26rpx;
  194. }
  195. .left-text {
  196. // background: red;
  197. width: 320rpx;
  198. color: #333333;
  199. display: flex;
  200. align-items: center;
  201. }
  202. .picture {
  203. position: relative;
  204. width: 212rpx;
  205. height: 212rpx;
  206. display: flex;
  207. justify-content: center;
  208. flex-direction: column;
  209. align-items: center;
  210. background:#F5F6FA;
  211. .text {
  212. margin-top: 20rpx;
  213. }
  214. }
  215. .xj-image {
  216. width: 46rpx;
  217. height: 46rpx;
  218. }
  219. .title {
  220. color: #999999;
  221. margin: 20rpx 0;
  222. }
  223. }
  224. .content{
  225. padding:20rpx 20rpx 20rpx;
  226. margin:20rpx 20rpx 20rpx;
  227. background:#fff;
  228. border-radius: 10rpx;
  229. }
  230. .service {
  231. font-size: 24rpx;
  232. margin: 20rpx;
  233. justify-content: center;
  234. /deep/.u-image {
  235. margin: 0 20rpx;
  236. }
  237. }
  238. .del-card {
  239. position: absolute;
  240. top: -10rpx;
  241. right: -6rpx;
  242. width: 80rpx;
  243. height: 80rpx;
  244. z-index: 9;
  245. }
  246. .footer{
  247. position:fixed;
  248. background:#fff;
  249. width:100%;
  250. bottom:0;
  251. left:0;
  252. padding:15px 15px 30px;
  253. box-sizing: border-box;
  254. }
  255. .newlyIncreased{
  256. width:100%;
  257. margin:0 auto;
  258. text-align:center;
  259. height:46px;
  260. line-height: 46px;
  261. color:#fff;
  262. background:url(../../../static/mine/huozhurenzheng/Mask@3x.png) no-repeat;
  263. background-size:100%;
  264. }
  265. </style>