1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <template>
- <view class="container-view">
- <view class="return-info flex-row flex-between">
- <view class="return-top">
- <view>车牌:{{plate_number}}</view>
- </view>
- <view><img :src="model_image" /></view>
- </view>
- <view class="pictures-info">
- <view>车辆照片</view>
- <!-- <view>这里是关于激活车辆照片的文案描述,这里是关于激活车辆照片的文案描述</view> -->
- <uploader :car_info="car_imgs" @update-car-images="handleCarImagesUpdate"></uploader>
- <view @tap="submitEnabled" class="pictures-btn">激活车辆</view>
- </view>
- </view>
- </template>
- <script>
- import uploader from '@/component/uploader/uploader';
- const http = require('@/common/http.js');
- const config = require('@/common/config.js');
- const common = require('@/common/common.js');
- export default {
- components: {
- uploader
- },
- data() {
- return {
- carInfo: {},
- plate_number: '013657142736',
- sub_sn: '',
- model_image: '3',
- car_model: '',
- return_imgs: [],
- car_imgs: [],
- model_image_list: ''
- };
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function(options) {
- this.sub_sn = options.sub_sn || ''
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function() {
- },
- onUnload: function () {
- },
- methods: {
- handleCarImagesUpdate(updatedImages) {
- // 这里会接收到子组件传来的更新后的图片URL数组
- this.car_imgs = updatedImages
- },
-
- submitEnabled() {
- const me = this
- const _image_list = this.car_imgs.map(item => item.img_url)
- if (_image_list.includes('' || "")) return common.simpleToast('请上传车辆照片')
- const pData = {
- car_sn: this.plate_number,
- sub_sn: this.sub_sn,
- image_list: _image_list.join(', ')
- }
- http.postApi(config.API_FLK_CAR_ASSIGNMENT, pData, (resp) => {
- if (resp.data.code === 200) {
- common.simpleToast('车辆激活成功')
- setTimeout(function() {
- me.isCustomJump = false
- uni.switchTab({
- url: `/pages/index/index?plate_number=${me.plate_number}`,
- success: function(res) {},
- fail: function(res) {},
- complete: function(res) {}
- });
- }, 500)
- } else {
- common.simpleToast(resp.data.msg)
- }
- })
- }
- }
- };
- </script>
- <style>
- @import './activation.css';
- </style>
|