Просмотр исходного кода

场站名称增加品牌名称显示

jiuling 6 дней назад
Родитель
Сommit
41e17f23b7

+ 6 - 2
pages/charginfo/charginfo.js

@@ -10,6 +10,7 @@ Page({
    * 页面的初始数据
    */
   data: {
+    brandName:'',
     name:'',
     address:'', 
     offlineServicecall:'',
@@ -149,9 +150,10 @@ Page({
 
 
 
-    let { name, address, chargprice, serviceprice, chargid } = e;
+    let { name, address, chargprice, serviceprice, chargid,brandName } = e;
 
     name =  name=='null'?null:name;
+    brandName =  brandName=='null'?null:brandName;
     address =  address=='null'?null:address;
     // stationTagList = !stationTagList?null:stationTagList;
     chargprice =  chargprice=='null'?null:chargprice;
@@ -161,6 +163,7 @@ Page({
     let sumprice = (chargprice==null || serviceprice==null)? null:chargprice+serviceprice;
 
     this.setData({
+      brandName,
       name,
       address,
     //   stationTagList,
@@ -632,8 +635,9 @@ Page({
       chargStationName,
       id
     } = idx;
+    let brandName = that.data.brandName
     let userId = userInfo.userId;
-    let url = `/pages/reservation/reservation?chargStationId=` + chargStationId + `&chargPileName=` + chargPileName + `&chargPileId=` + chargPileId + `&chargPileIdId=` + id + "&chargStationName=" + chargStationName + "&userId=" + userId;
+    let url = `/pages/reservation/reservation?chargStationId=` + chargStationId + `&chargPileName=` + chargPileName + `&chargPileId=` + chargPileId + `&chargPileIdId=` + id + "&chargStationName=" + chargStationName + "&userId=" + userId+ "&brandName=" + brandName;
     wx.navigateTo({
       url
     });

+ 1 - 1
pages/charginfo/charginfo.wxml

@@ -6,7 +6,7 @@
     <view class="map_text_info">
       <view class='charging_text_title'>
         <view class='charging_text_title1'>
-          <text class='name'>{{name}}</text>
+          <text class='name'>{{brandName != null ? brandName : ''}}{{name}}</text>
           <text class="tag"  wx:if='{{stationTagList && stationTagList.length > 0}}'>
             <block wx:for="{{stationTagList}}" wx:key="unique" data-index="{{index}}">
                 <text class="tagItem">{{item}}</text> 

+ 3 - 2
pages/index/index.js

@@ -758,6 +758,7 @@ Page({
       address,
       chargprice,
       serviceprice,
+      brandName
     } = textData;
 
     console.log("222222");
@@ -776,8 +777,7 @@ Page({
           data: item
         });
 
-        let url = `/pages/charginfo/charginfo?name=${name}&address=${address}&chargprice=${chargprice}&serviceprice=${serviceprice}&chargid=${markerId}`;
-        //console.log(url);
+        let url = `/pages/charginfo/charginfo?name=${name}&address=${address}&chargprice=${chargprice}&serviceprice=${serviceprice}&chargid=${markerId}&brandName=${brandName}`;
         wx.navigateTo({
           url
         });
@@ -1131,6 +1131,7 @@ Page({
                   }
                   //console.log(Util.distance(that.data.user_lat, that.data.user_lon, item.lat, item.lon));
                   var marker = {
+                    brandName:item.brandName,
                     name: item.chargStationName,
                     address: item.address,
                     width: "46rpx",

+ 1 - 1
pages/index/index.wxml

@@ -40,7 +40,7 @@
     <view class="map_text_info">
       <view class='charging_text_title'>
         <view class='charging_text_title1'>
-          <text class='bold'>{{textData.name}}</text>
+          <text class='bold'>{{textData.brandName != null ? textData.brandName : ''}}{{textData.name}}</text>
           <text class="tag"  wx:if='{{textData && textData.stationTagList && textData.stationTagList.length > 0}}'>
             <block wx:for="{{textData.stationTagList}}" wx:key="unique" data-index="{{index}}">
                 <text class="tagItem">{{item}}</text> 

+ 5 - 1
pages/reservation/reservation.js

@@ -32,6 +32,7 @@ Page({
   },
   goReservation(){
     let {
+      brandName,
       chargStationId,
       chargPileName,
       chargPileId,
@@ -56,7 +57,8 @@ Page({
     "&maxReservTime=" + maxReservTime +
     "&maxEarlyExerciseTime=" + maxEarlyExerciseTime + 
     "&maxReservOvertime=" + maxReservOvertime + 
-    "&userId=" + userId;
+    "&userId=" + userId+ 
+    "&brandName=" + brandName;
     wx.navigateTo({
       url
     });
@@ -84,6 +86,7 @@ Page({
   onLoad(options) {
     let that = this;
     let {
+      brandName,
       chargStationId,
       chargPileName,
       chargPileId,
@@ -93,6 +96,7 @@ Page({
     } = options;
 
     this.setData({
+        brandName,
         chargStationId,
         chargPileName,
         chargPileId,

+ 3 - 0
pages/reservation/reservationEdit.js

@@ -5,6 +5,7 @@ Page({
    * 页面的初始数据
    */
   data: {
+    brandName:'',
     chargStationId:'',
     chargPileName:'加载中',
     chargPileId:'',
@@ -74,6 +75,7 @@ Page({
     this.initCar();
 
       let {
+        brandName,
         chargStationId,
         chargPileName,
         chargPileId,
@@ -100,6 +102,7 @@ Page({
       let curTime4 = new Date(setime);
       let eetime = new Date(curTime4.setMinutes(curTime4.getMinutes() + parseInt(maxReservTime)));
       this.setData({
+          brandName,
           chargStationId,
           chargPileName,
           chargPileId,

+ 2 - 2
pages/reservation/reservationEdit.wxml

@@ -1,7 +1,7 @@
 
   <view class="context">
     <text>场站</text>
-    <view class='input' type='text'>{{chargPileName}}</view>
+    <view class='input' type='text'>{{brandName == null?'':brandName}}{{chargStationName}}</view>
   </view>
   <view class="context">
     <text>桩编号</text>
@@ -9,7 +9,7 @@
   </view>
   <view class="context">
     <text>桩名称</text>
-    <view class='input' type='text'>{{chargStationName}}</view>
+    <view class='input' type='text'>{{chargPileName}}</view>
   </view>
 
   <view class="context">

+ 2 - 0
pages/search_result/search_result.js

@@ -149,6 +149,7 @@ Page({
               data.forEach((item, index) => {
           
                 var marker = {
+                  brandName:item.brandName,
                   name: item.chargStationName,
                   address: item.address,
                   width: "46rpx",
@@ -215,6 +216,7 @@ Page({
           let markers = [];
           data.forEach((item, index) => {
             var marker = {
+              brandName:item.brandName,
               name: item.chargStationName,
               address: item.address,
               width: "46rpx",

+ 1 - 1
pages/search_result/search_result.wxml

@@ -31,7 +31,7 @@
         <image src='/images/charging1.png'></image>
       </view>
       <view class='charging_text_title1'>
-        <text class='bold'>{{item.name}}</text>
+        <text class='bold'>{{item.brandName != null ? item.brandName : ''}}{{item.name}}</text>
         <text class="h1">{{item.address}}</text>
       </view>
       <text class="h1 right">{{item.distance}}km</text>

+ 1 - 1
pages/ucenter/charginglog/charginglog.wxml

@@ -12,7 +12,7 @@
         <image src='/images/charging2_1.png'></image>
       </view>
       <view class='charging_text_title1'>
-        <text class='bold'>{{charginglog.chargStation.chargStationName}}</text>
+        <text class='bold'>{{charginglog.chargStation.brandName != '' ? charginglog.chargStation.brandName : '' }}{{charginglog.chargStation.chargStationName}}</text>
         <text class="h1">{{charginglog.chargStation.address}}</text>
       </view>
     </view>

+ 3 - 0
pages/ucenter/chargpilemonitor/chargpilemonitor.js

@@ -50,6 +50,7 @@ Page({
             var show_chargpiles = [];
             chargpiles.forEach((item, index) => {
               show_chargpiles.push({
+                brandName:item.brandName,
                 chargStationId: item.chargStationId,
                 chargPileName: item.chargPileName,
                 chargPileId: item.chargPileId,
@@ -188,6 +189,7 @@ Page({
               var show_chargpiles = [];
               chargpiles.forEach((item, index) => {
                 show_chargpiles.push({
+                  brandName:item.brandName,
                   chargStationId: item.chargStationId,
                   chargPileName: item.chargPileName,
                   chargPileId: item.chargPileId,
@@ -261,6 +263,7 @@ Page({
             var show_chargpiles = that.data.chargpiles;
             chargpiles.forEach((item, index) => {
               show_chargpiles.push({
+                brandName:item.brandName,
                 chargStationId: item.chargStationId,
                 chargPileName: item.chargPileName,
                 chargPileId: item.chargPileId,

+ 1 - 1
pages/ucenter/chargpilemonitor/chargpilemonitor.wxml

@@ -19,7 +19,7 @@
       </view>
     </view>
     <view style='line-height:0;'>
-      <text >所属充电站:{{item.chargStationName}}</text>
+      <text >所属充电站:{{item.brandName != null ? item.brandName : ''}}{{item.chargStationName}}</text>
       <text class='inline' wx:if='{{item.chargmode==1}}'>充电模式:自动</text>
       <text class='inline' wx:if='{{item.chargmode==2}}'>充电模式:手动</text>
       <text decode='true' class='inline' wx:if='{{item.chargway==1}}'>&emsp;&emsp;&emsp;&emsp;&emsp;充电方式:直流</text>

+ 1 - 0
pages/ucenter/mychargestation/mychargestation.js

@@ -73,6 +73,7 @@ Page({
                 // };
                 //console.log(Util.distance(latitude, longitude, item.lat, item.lon));
                 var marker = {
+                  brandName:item.brandName,
                   name: item.chargStationName,
                   address: item.address,
                   width: "46rpx",

+ 1 - 1
pages/ucenter/mychargestation/mychargestation.wxml

@@ -20,7 +20,7 @@
         <image src='/images/charging1.png'></image>
       </view>
       <view class='charging_text_title1'>
-        <text class='bold'>{{item.name}}</text>
+        <text class='bold'>{{item.brandName != null ? item.brandName : ''}}{{item.name}}</text>
         <text class="h1">{{item.address}}</text>
       </view>
       <text class="h1 right">{{item.distance}}km</text>

+ 0 - 1
pages/ucenter/myworksheet/myworksheet.js

@@ -15,7 +15,6 @@ Page({
     } = e.currentTarget.dataset;
     //console.log(keywords);
     let worksheet = JSON.stringify(keywords);
-    //console.log(worksheet);
     let url = '/pages/worksheetinfo/worksheetinfo?worksheet=' + worksheet;
     wx.navigateTo({
       url

+ 1 - 1
pages/ucenter/myworksheet/myworksheet.wxml

@@ -8,7 +8,7 @@
           <image src='/images/myworksheet.png'></image>
         </view>
         <view class='worksheet_text_title1'>
-          <view class='bold inline'>{{item.chargStationName==null?'无关联场站':item.chargStationName}}</view>
+          <view class='bold inline'>{{item.brandName == null?'':item.brandName }}{{item.chargStationName==null?'无关联场站':item.chargStationName}}</view>
           <view class="h1 inline">{{item.mainLocation==null?'':item.mainLocation}}</view>
         </view>
       </view>

+ 1 - 1
pages/ucenter/yuyt/yuyt.wxml

@@ -24,7 +24,7 @@
           <image src='/images/charging2_1.png'></image>
         </view>
         <view class='charging_text_title1'>
-          <text class='bold'>{{item.reservStation.chargStationName}}</text>
+          <text class='bold'>{{item.reservStation.brandName != '' ? item.reservStation.brandName : '' }}{{item.reservStation.chargStationName}}</text>
           <text class="h1">{{item.reservPile.chargPileId}}</text>
         </view>
       </view>

+ 4 - 2
pages/worksheetinfo/addworksheetinfo.js

@@ -110,7 +110,8 @@ Page({
     accendantids: [],
     userNames:[],
     chargStationName:'',
-    chargStationNameClearFlag: true
+    chargStationNameClearFlag: true,
+    brandName:''
 
   },
   bindChargstationsChange: function(e) {
@@ -675,7 +676,8 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function() {
-
+// 页面显示时获取的数据
+console.log('PageA shown with data:', this.data);
   },
 
   /**

+ 1 - 1
pages/worksheetinfo/addworksheetinfo.wxml

@@ -8,7 +8,7 @@
     <text>场站</text>
     <view class='input' type='text'>
     <!-- 有清除按钮 -->
-    <view class="span_withclear" bindtap='chargStationNameSelect' wx:if="{{!chargStationNameClearFlag}}">{{chargStationName}}</view>
+    <view class="span_withclear" bindtap='chargStationNameSelect' wx:if="{{!chargStationNameClearFlag}}">{{brandName == null?'':brandName}}{{chargStationName}}</view>
     <image class='img_clear' bindtap='clear_chargStationName' src="/images/clear.png"  wx:if="{{!chargStationNameClearFlag}}"></image>
     <!-- 木有清除按钮 -->
     <view class="span_withoutclear" bindtap='chargStationNameSelect' wx:if="{{chargStationNameClearFlag}}">请选择</view>

+ 2 - 0
pages/worksheetinfo/findstation.js

@@ -76,6 +76,7 @@ Page({
         let pages = getCurrentPages();
         let prevPage = pages[pages.length - 2]; //上一个页面
         let worksheetinfo = prevPage.data.worksheetinfo;
+        let brandName = keywords.brandName;
         let chargStationName = keywords.chargStationName
         worksheetinfo.chargStationId =  keywords.id;
         worksheetinfo.mainLocation =  keywords.address;
@@ -92,6 +93,7 @@ Page({
               });
               worksheetinfo.pams =  [];
               prevPage.setData({
+                brandName,
                 chargStationName,
                 chargStationNameClearFlag:false,
                 worksheetinfo,

+ 1 - 1
pages/worksheetinfo/findstation.wxml

@@ -9,7 +9,7 @@
 <scroll-view class='context' scroll-y='true' wx:if="{{chargList.length!=0}}" bindscrolltolower="bindScrollTolowerEvent">
   <view bindtap="bindSearch2" data-keywords="{{item}}" class="text_box" hover-class='active' wx:for="{{chargList}}" wx:key="key" >
     <view class='text_context'>
-      <text class='bold'>{{item.chargStationName}}</text>
+      <text class='bold'>{{item.brandName == null?'':item.brandName}}{{item.chargStationName}}</text>
       <!-- <text class="h1">{{item.district}}{{item.address}}</text> -->
     </view>
     <!-- <text class="right">所有站场</text> -->

+ 6 - 2
pages/worksheetinfo/worksheetinfo.js

@@ -564,7 +564,8 @@ Page({
     
     //worksheetinfo.breakdownType = 2;
     this.setData({
-      worksheetinfo
+      worksheetinfo,
+      brandName:worksheetinfo.brandName
     });
     this.data.workstatus.forEach((item, index) => {
       if (item.value == worksheetinfo.workStatus) {
@@ -721,7 +722,10 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function() {
-
+    // console.log("data",this.data);
+    this.setData({
+      brandName: this.data.brandName
+    })
   },
 
   /**

+ 1 - 1
pages/worksheetinfo/worksheetinfo.wxml

@@ -4,7 +4,7 @@
     <text>场站</text>
     <view class='input' type='text'>
     <!-- 有清除按钮 -->
-    <view disabled="{{workstatusFinished}}" class="span_withclear" bindtap='{{workstatusFinished?"":"chargStationNameSelect"}}' wx:if="{{!chargStationNameClearFlag}}">{{chargStationName}}</view>
+    <view disabled="{{workstatusFinished}}" class="span_withclear" bindtap='{{workstatusFinished?"":"chargStationNameSelect"}}' wx:if="{{!chargStationNameClearFlag}}">{{brandName == null? '' :brandName }}{{chargStationName}}</view>
     <image class='img_clear'  bindtap='{{workstatusFinished?"":"clear_chargStationName"}}' src="/images/clear.png"  wx:if="{{!chargStationNameClearFlag}}"></image>
     <!-- 木有清除按钮 -->
     <view class="span_withoutclear" bindtap='{{workstatusFinished?"":"chargStationNameSelect"}}' wx:if="{{chargStationNameClearFlag}}">请选择</view>