Explorar el Código

订单号复制

zuy hace 2 años
padre
commit
06ec883cd5

+ 23 - 1
src/components/shadow-card/shadow-card.vue

@@ -14,7 +14,7 @@
         :style="{
         :style="{
           color: item.color ? item.color : '#000',
           color: item.color ? item.color : '#000',
         }"
         }"
-        >{{ item.value }}</view
+        >{{ item.value }} <text class="copy-btn" v-if="item.copy" @click="copyText(item.value)">复制</text></view
       >
       >
     </view>
     </view>
   </view>
   </view>
@@ -28,6 +28,19 @@ export default {
       defalut: [],
       defalut: [],
     },
     },
   },
   },
+  methods: {
+    copyText(text:string) {
+      if(!text) return;
+      uni.setClipboardData({
+        data: text,
+        success: function () {
+          uni.showToast({
+            title: '复制成功',
+            icon: 'success',})
+        }
+      })
+    }
+  }
 };
 };
 </script>
 </script>
 
 
@@ -52,7 +65,16 @@ export default {
     .value {
     .value {
       flex-grow: 1;
       flex-grow: 1;
       font-size: 26rpx;
       font-size: 26rpx;
+      overflow-wrap: anywhere;
     }
     }
   }
   }
 }
 }
+
+.copy-btn{
+  margin-left: 10rpx;
+  color: #1aa4f2;
+/*  padding: 6rpx;
+  background: #1aa4f2;*/
+  font-size: 20rpx;
+}
 </style>
 </style>

+ 5 - 0
src/pages-charge/order/order.vue

@@ -27,6 +27,7 @@ onLoad((options: any) => {
       const totalMoney = (res.totalMoney / 100).toFixed(2);
       const totalMoney = (res.totalMoney / 100).toFixed(2);
       const discountAmount = (res.discountAmount / 100).toFixed(2);
       const discountAmount = (res.discountAmount / 100).toFixed(2);
       const discountAmountText = res.rightsDesc;
       const discountAmountText = res.rightsDesc;
+      const startChargeSeq = res.startChargeSeq;
       const reg = new RegExp("\B(?=(\d{3})+(?!\d))", "g");
       const reg = new RegExp("\B(?=(\d{3})+(?!\d))", "g");
       const start = new Date(res.startTime.replace(/-/g, "/"));
       const start = new Date(res.startTime.replace(/-/g, "/"));
       const end = res.endTime
       const end = res.endTime
@@ -64,6 +65,10 @@ onLoad((options: any) => {
         {
         {
           label: "充电用时",
           label: "充电用时",
           value: time,
           value: time,
+        },  {
+          label: "订单号",
+          value: startChargeSeq,
+          copy:true
         },
         },
       ];
       ];
       if (Number(discountAmount) > 0) {
       if (Number(discountAmount) > 0) {

+ 6 - 1
src/pages-charge/ordering/ordering.vue

@@ -28,7 +28,7 @@
             </view>
             </view>
             <view class="fs-26">充电启动中</view>
             <view class="fs-26">充电启动中</view>
           </block>
           </block>
-          <block v-else- if="step === 2">
+          <block v-else-if="step === 2">
             <image
             <image
               class="icon"
               class="icon"
               src="/pages-charge/static/charge-ordering-icon.png"
               src="/pages-charge/static/charge-ordering-icon.png"
@@ -247,6 +247,11 @@ const finish = () => {
             label: "累计用时",
             label: "累计用时",
             value: time,
             value: time,
           },
           },
+          {
+            label: "订单号",
+            value: res.startChargeSeq,
+            copy:true
+          }
         ];
         ];
         if (res.soc) {
         if (res.soc) {
           _chargeInfo.unshift({
           _chargeInfo.unshift({

+ 27 - 17
src/pages-charge/orders/orders.vue

@@ -12,13 +12,15 @@
         <view class="mr-28" v-if="isInvoice">
         <view class="mr-28" v-if="isInvoice">
           <style-checkbox :checked="item.checked"></style-checkbox>
           <style-checkbox :checked="item.checked"></style-checkbox>
         </view>
         </view>
-        <view>
-          <view class="flex-align-center">
+
+
+        <view class="flex-column flex-grow">
+          <view class="flex-align-center ">
             <view
             <view
-              class="fs-30 fw-500"
+              class="fs-24 fw-500"
               :style="{ opacity: item.invoiceStatus === 1 ? 0.5 : 1 }"
               :style="{ opacity: item.invoiceStatus === 1 ? 0.5 : 1 }"
-              >充电费用</view
-            >
+              >订单号:{{item.startChargeSeq}}</view>
+
             <view
             <view
               v-if="
               v-if="
                 isInvoice &&
                 isInvoice &&
@@ -31,20 +33,27 @@
               >{{ isInvoiceTitles[item.invoiceStatus] }}</view
               >{{ isInvoiceTitles[item.invoiceStatus] }}</view
             >
             >
           </view>
           </view>
-          <view class="fs-24 mt-10" style="color: rgba(0, 0, 0, 0.4)">{{
-            item.endTime
-          }}</view>
-        </view>
-        <view class="ml-auto" style="text-align: right">
-          <view class="fs-36 fw-500">
-            <text>{{ item.payAmount }}</text>
-            <text class="fs-24 ml-6">元</text>
+
+          <view class="flex-inline">
+            <view class="fs-24 mt-10" style="color: rgba(0, 0, 0, 0.4)">
+              {{item.endTime}}
           </view>
           </view>
+            <view class="ml-auto" style="text-align: right">
+              <view class="fs-36 fw-500 ">
+                <text>{{ item.payAmount }}</text>
+                <text class="fs-24 ml-6">元</text>
+                  <uni-icons  class="ml-20" type="right" size="12" color="rgba(0,0,0,0.4)"></uni-icons>
+              </view>
+            </view>
+
+
+          </view>
+
         </view>
         </view>
-        <view class="ml-20">
-          <uni-icons type="right" size="12" color="rgba(0,0,0,0.4)"></uni-icons>
-        </view>
+
+
       </view>
       </view>
+
     </block>
     </block>
   </view>
   </view>
 
 
@@ -131,6 +140,7 @@ const infiniteScroller = useInfiniteScroll(20, (page) => {
         item.hidden = item.chargeStatus === 4 && !item.endTime;
         item.hidden = item.chargeStatus === 4 && !item.endTime;
       });
       });
     }
     }
+    console.log(res.list)
     return res.list;
     return res.list;
   });
   });
 });
 });
@@ -262,7 +272,7 @@ onReachBottom(() => {
 
 
 <style lang="scss">
 <style lang="scss">
 .item {
 .item {
-  height: 170rpx;
+  height: 150rpx;
   border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
   border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
   &:last-child {
   &:last-child {
     border-bottom: none;
     border-bottom: none;