123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- <template>
- <!-- <text>车辆详情</text> -->
- <view class="user-detail">
- <view class="user-detail-message">
- <view class=""><text>车辆编号:{{detail.bike_no}}</text></view>
- <view class=""><text>地址:{{detail.area_name}}</text></view>
- <view class=""><text>电量:{{detail.battery_power}}%</text></view>
- <view class=""><text>状态:</text><text class="bike-zk">{{detail.tab_name}}</text></view>
- </view>
- <view class="user-account" v-for="(item,index) in carList" :key='index' @click="skip(index)">
- <image class="icon" :src="item.img_url" mode=""></image>
- <text class="account-left">{{item.text}}</text>
- <view class="account-right">
- <image src="../../static/img/right-arrow.png" mode=""></image>
- </view>
- </view>
- <view class="user-account">
- <text class="account-left">备注:</text>
- <input type="text" value="" class="user-detai-beizhu" :value="detail.remark" @input="getText" />
- <view class="user-detail-bt" @click="operate">
- 完成
- </view>
- </view>
- </view>
- </template>
- <script>
- var app = getApp()
- export default {
- data() {
- return {
- carList: [
- //详情列表
- {
- id: 1,
- img_url: "http://resource.weilaibike.com/bike_yunwei/position.png",
- text: "车辆位置"
- },
- {
- id: 2,
- img_url: "http://resource.weilaibike.com/bike_yunwei/scan.png",
- text: "扫码位置"
- },
- {
- id: 3,
- img_url: "http://resource.weilaibike.com/bike_yunwei/order.png",
- text: "最近订单"
- },
- {
- id: 4,
- img_url: "http://resource.weilaibike.com/bike_yunwei/lock.png",
- text: "开关锁记录"
- },
- {
- id: 4,
- img_url: "http://resource.weilaibike.com/bike_yunwei/line.png",
- text: "上下线记录"
- }
- ],
- id: '',
- bike_no: '',
- detail: [],
- isDisabled: false, //备注是否修改
- textVal: '', //输入框内容
- }
- },
- onLoad(options) {
- uni.showLoading({
- title: '加载中...',
- })
- this.bike_no = options.bike_no,
- this.id = options.id
- app.request('bike/getBikeInfo?bike_no=' + options.bike_no, '', 'GET').then(res => {
- uni.hideLoading();
- this.detail = res.data.bike_info
- })
- },
- methods: {
- //页面跳转
- skip: function(e) {
- console.log(e, '这是页面跳转')
- let idx = parseInt(e);
- let url = ''
- switch (idx) {
- case 0:
- url = '/pages/index/car_position';
- break;
- case 1:
- url = '/pages/manage/scanRecord';
- break;
- case 2:
- url = '/pages/manage/recentOrder';
- break;
- case 3:
- url = '/pages/manage/lockRecord';
- break;
- case 4:
- url = '/pages/manage/lineRecord';
- break;
- default:
- ;
- }
- uni.navigateTo({
- url: url + '?bike_no=' + this.bike_no + '&&id=' + this.id,
- })
- },
- getText: function(e) {
- this.textVal = e.detail.value
- },
- operate: function() {
- let data = {
- remark: this.textVal
- }
- if (this.textVal == '') {
- uni.showToast({
- title: '请填写备注~',
- icon: 'none'
- })
- } else {
- uni.showLoading({
- title: '加载中...',
- })
- app.request('bike/updateRemark/' + this.id, data, 'PUT').then(res => {
- uni.hideLoading();
- console.log(res);
- if (res.statusCode == 200) {
- uni.showToast({
- title: '提交成功~',
- icon: 'none'
- })
- }
- })
- }
- },
- }
- }
- </script>
- <style>
- page {
- background-color: #f1f1f1;
- }
- .user-detail {
- padding: 20rpx 30rpx;
- }
- .user-detail-message {
- font-size: 24rpx;
- line-height: 50rpx;
- background-color: #FFFFFF;
- border-radius: 15rpx;
- padding: 20rpx;
- color: #FFFFFF;
- background-image: url('http://resource.weilaibike.com/bike_yunwei/detailBg.png');
- background-size: 100%;
- }
- .user-account {
- margin-top: 20rpx;
- padding: 0 20rpx;
- height: 88rpx;
- font-size: 28rpx;
- line-height: 88rpx;
- background-color: #FFFFFF;
- border-radius: 15rpx;
- }
- .account-right {
- float: right;
- }
- .user-detai-beizhu {
- display: inline-block;
- /* width: 100%; */
- vertical-align: middle;
- border-radius: 30rpx;
- border: solid 1px #d1d1d1;
- }
- .user-detail-bt {
- display: inline-block;
- margin-top: 30rpx;
- float: right;
- height: 38rpx;
- line-height: 38rpx;
- width: 80rpx;
- text-align: center;
- font-size: 22rpx;
- border-radius: 30rpx;
- background-color: #18D5B9;
- color: #FFFFFF;
- }
- .account-right image {
- margin-top: 30rpx;
- height: 30rpx;
- width: 40rpx;
- }
- .bike-zk {
- display: inline-block;
- vertical-align: middle;
- height: 26rpx;
- line-height: 26rpx;
- padding: 5rpx 30rpx;
- border-radius: 21rpx;
- text-align: center;
- margin-left: 20rpx;
- font-size: 22rpx;
- background: linear-gradient(163deg, rgba(255, 139, 102, 1) 0%, rgba(254, 87, 34, 1) 100%);
- box-shadow: 0 0 6rpx 0 rgba(254, 94, 44, 1);
- }
- .icon {
- display: inline-block;
- vertical-align: middle;
- height: 40rpx;
- width: 40rpx;
- margin-right: 22rpx;
- border-radius: 10rpx;
- background-color: #18D5B9;
- }
- </style>
|