瀏覽代碼

充值退款修改

zuypeng 1 年之前
父節點
當前提交
a88f7ee64b

+ 1 - 1
src/App.vue

@@ -6,7 +6,7 @@ import {groupByKey} from "@/utils/common";
 export default <any>{
   globalData: {
     token: "",
-    user: {
+    user: {id: "1306350524487958528"
     },
     isLogin: false,
     last:{},

文件差異過大導致無法顯示
+ 0 - 14
src/pages-order/detail/index.vue


+ 359 - 0
src/pages-order/list/index.vue

@@ -0,0 +1,359 @@
+<template>
+  <view class="container">
+    <scroll-view scroll-y="true" class="orders-scroll1" v-for="(item,index) in state.orderList" :key="index">
+      <view class="wrapper">
+        <view class="order-list">
+          <view class="order">
+
+            <view class="header">
+              <view class="flex-fill font-size-medium"></view>
+              <view class="status">
+                <view>
+                  未支付
+                </view>
+
+                <uv-icon name="arrow-right" size="16"></uv-icon>
+              </view>
+            </view>
+            <view class="images">
+              <image src="/static/mock/zhuti.jpg"></image>
+              <view class="good_name">{{ item.name }}</view>
+            </view>
+            <view class="info">
+              <view class="left">
+                <view>订单编号:{{ item.number }}</view>
+                <view>下单时间:{{ item.time }}</view>
+              </view>
+              <view class="right">¥{{ item.money }}</view>
+            </view>
+            <view class="action" style="text-align: right;">
+              <uv-button plain type="primary" size="mini">{{ item.payment }}</uv-button>
+              <view class="ml10">
+                <uv-button type="error" size="mini" class="ml10" style="margin-left: 10px;">{{ item.delete }}</uv-button>
+              </view>
+              <!--              <view class="button button_pay"
+                                  style="width: 36px;text-align:center;font-size: 10px;">{{ item.payment }}
+                            </view>
+                            <view class="button button_del" hover-class="none"
+                                  style="width: 25px;text-align:center;font-size: 10px;">{{ item.delete }}
+                            </view>-->
+            </view>
+          </view>
+        </view>
+      </view>
+    </scroll-view>
+    <!--    <login-bar class="w100 text-center"></login-bar>-->
+    <!--    <tab-bar :index="3"/>-->
+  </view>
+</template>
+
+<script lang="ts" setup>
+import {reactive} from 'vue'
+import {onHide, onShow} from "@dcloudio/uni-app";
+import TabBar from "@/components/tab-bar/index.vue";
+import LoginBar from "@/components/login-bar/index.vue";
+
+const initState = () => ({
+  orderList: [{
+    name: "菌满堂野生菌火锅",
+    number: "DB23473207638761",
+    time: "2021-11-23 14:02:00",
+    money: "239.20",
+    payment: "去支付",
+    delete: "删除"
+  },
+    {
+
+      name: "菌满堂野生菌火锅",
+      number: "DB23473207638761",
+      time: "2021-11-23 14:02:00",
+      money: "239.20",
+      payment: "去支付",
+      delete: "删除"
+    },
+    {
+
+      name: "菌满堂野生菌火锅",
+      number: "DB23473207638761",
+      time: "2021-11-23 14:02:00",
+      money: "239.20",
+      payment: "去支付",
+      delete: "删除"
+    }
+  ]
+})
+
+const state = reactive(initState())
+
+onShow(() => {
+  uni.setNavigationBarTitle({title: '我的订单'})
+  let gd = getApp<any>().globalData;
+  if (!gd.token) {
+    console.error(gd)
+    return;
+  }
+  loadOrderList();
+});
+
+onHide(() => {
+  Object.assign(state, initState());
+})
+
+const loadOrderList = () => {
+  //load order list
+}
+
+</script>
+
+<style lang="scss" scoped>
+.container {
+  background-color: #f6f6f6;
+}
+
+.font-size-lg {
+  border: none;
+  background-color: var(--theme_color);
+}
+
+.navbar {
+  height: calc(44px + var(--status-bar-height));
+  display: flex;
+  background-color: #ffffff;
+}
+
+.talk-btn {
+  height: 32px;
+  margin-left: 10px;
+  margin-top: 26px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  font-size: 16px !important;
+  padding: 0 20rpx;
+  border-radius: 50rem !important;
+
+  image {
+    width: 40rpx;
+    height: 40rpx;
+    margin-right: 10px;
+  }
+}
+
+.tabbar {
+  /* #ifdef MP-WEIXIN */
+  // margin-top: 60px;
+  /* #endif */
+
+  height: 100rpx;
+  background-color: #ffffff;
+  display: flex;
+  align-items: center;
+  justify-content: space-around;
+  // margin-top: 100rpx;
+
+  .item {
+    height: 100%;
+    font-size: 32rpx;
+    color: #999;
+    font-weight: 400 !important;
+    display: flex;
+    align-items: center;
+
+    &.active {
+      color: #343434;
+      border-bottom: 4rpx solid #343434;
+    }
+  }
+}
+
+.swiper {
+  width: 100%;
+  height: calc(100vh - 44px);
+}
+
+
+.history-order {
+  width: 100%;
+  height: 100%;
+  position: relative;
+
+  .menu {
+    padding: 18rpx 30rpx;
+    display: flex;
+    align-items: center;
+    color: #FFFFFF;
+    position: fixed;
+    top: 0;
+    left: 0;
+    right: 0;
+    z-index: 10;
+
+    .item {
+      padding: 14rpx 30rpx;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+
+      image {
+        width: 40rpx;
+        height: 40rpx;
+        margin-right: 10rpx;
+      }
+
+      &.active {
+        color: var(--theme_color);
+        background-color: #ffffff;
+      }
+    }
+  }
+
+  .history-order-swiper {
+    width: 100%;
+    height: 100%;
+  }
+}
+
+.store-order-wrapper {
+  width: 100%;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  color: #999;
+  line-height: 1.3rem !important;
+
+  image {
+    width: 400rpx;
+    height: 333rpx;
+    margin-bottom: 40rpx;
+  }
+}
+
+.orders-scroll {
+  width: 100%;
+  height: 100%;
+  padding-top: 104rpx;
+}
+
+.orders-scroll1 {
+  width: 100%;
+  height: 100%;
+  padding-top: 20rpx;
+}
+
+.good_name {
+  padding-left: 30rpx;
+  padding-top: 15rpx;
+  color: #555;
+  font-weight: 600;
+  font-size: 14px;
+}
+
+.order-list {
+  display: flex;
+  width: 100%;
+  flex-direction: column;
+
+  .order {
+    background-color: #ffffff;
+    padding: 30rpx 40rpx;
+    margin-bottom: 18rpx;
+
+    .header {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+
+      .status {
+        font-size: 14px;
+        color: #595959;
+        display: flex;
+        align-items: center;
+
+        image {
+          width: 30rpx;
+          height: 30rpx;
+          margin-left: 10px;
+        }
+      }
+    }
+
+    .images {
+      display: flex;
+      padding: 30rpx 0;
+
+      image {
+        flex-shrink: 0;
+        width: 150rpx;
+        height: 112.5rpx;
+      }
+    }
+
+    .info {
+      display: flex;
+      align-items: center;
+      margin-bottom: 30rpx;
+
+      .left {
+        flex: 1;
+        display: flex;
+        flex-direction: column;
+        font-size: 12px;
+        color: #7a7a7a;
+
+        // view {
+        // 	margin-bottom: 10rpx;
+        // 	font-size: 12px;
+
+        // 	&:last-child {
+        // 		margin-bottom: 0;
+        // 	}
+        // }
+      }
+
+      .right {
+        font-size: 32rpx;
+        color: #343434;
+      }
+    }
+
+    .action {
+      display: flex;
+      justify-content: flex-end;
+      align-items: center;
+
+
+      button {
+        margin-left: 30rpx;
+        font-size: 16px;
+      }
+    }
+  }
+
+  .button {
+    margin-left: 30rpx;
+    padding: 15rpx 20rpx;
+    font-size: 16px;
+    border-radius: 70rpx;
+    background-color: #eee;
+
+    &_pay {
+      background-color: var(--theme_color);
+      color: white;
+      border: none;
+      border-radius: 70rpx;
+    }
+
+    &_del {
+      color: white;
+      background-color: #F56C6C;
+    }
+
+    &_re {
+      color: white;
+      background-color: #5CB87A;
+    }
+  }
+}
+</style>

+ 5 - 6
src/pages-user/faq/index.vue

@@ -39,12 +39,11 @@
         class="flex-center flex-column contact mt-20"
         hover-class="hover-scale"
         @click="call"
-        v-if="state.questions.length"
-    >
+        v-if="state.questions.length"    >
       <image
           class="width-96"
           mode="widthFix"
-          src="/static/images/contact-customer.png"
+          src="/static/contact-customer.png"
       />
       <view class="mt-16 color-666 fs-28">电话客服</view>
     </view>
@@ -79,11 +78,11 @@ const toggle = (index: number) => {
   });
 };
 
-onShow((options) => {
+onShow((options:any) => {
   if (options) {
-    state.servicerPhone = options.service;
+    state.servicerPhone = options.servicerPhone;
   }
-  body(`faq/list`).then((res: any) => {
+  body(`/faq/list`).then((res: any) => {
     state.questions = res.list;
   })
 });

+ 3 - 3
src/pages-user/feedback/add.vue

@@ -98,7 +98,7 @@ const handleSubmit = () => {
       title: '校验通过'
     })
 
-    body(`feedback/add`, state.ruleForm).then(() => {
+    body(`/feedback/add`, state.ruleForm).then(() => {
       uni.showToast({
         icon: 'success',
         title: '提交成功,感谢您的反馈'
@@ -115,7 +115,7 @@ const handleSubmit = () => {
 
 const handleUpload = (event: any) => {
   let file = event.file;
-  upload(`file/upload`).then((res: any) => {
+  upload(`/file/upload`).then((res: any) => {
     state.ruleForm.attachList.push({
       name: file.name,
       url: formatUrl(res.url)
@@ -129,7 +129,7 @@ const handleDelete = (event: any) => {
 }
 
 const loadDict = () => {
-  body(`dict/list`, {type: 'Feedback.type'}).then((res: any) => {
+  body(`/dict/list`, {type: 'Feedback.type'}).then((res: any) => {
     state.feedbackTypeList = res.list;
   })
 }

+ 9 - 9
src/pages-user/feedback/index.vue

@@ -1,6 +1,6 @@
 <template>
   <view class="page">
-    <view v-if="state.faqList.length <= 0" class="flex-center mt40 animation-loading">
+    <view v-if="state.feedbackList.length <= 0" class="flex-center mt40 animation-loading">
       <uv-icon name="photo"></uv-icon>
     </view>
     <view class="sheet">
@@ -12,7 +12,7 @@
             show-arrow
             @click="handleClickFaq(item)"
             :note="item.createTime"
-            v-for="(item, index) in state.faqList" :key="index">
+            v-for="(item, index) in state.feedbackList" :key="index">
           <template #footer>
             <uv-tags text="已反馈" plain size="mini" type="warning"></uv-tags>
           </template>
@@ -25,7 +25,7 @@
         class="flex-center flex-column contact mt-20"
         hover-class="hover-scale"
         @click="call"
-        v-if="state.faqList.length">
+        v-if="state.feedbackList.length">
 
       <image
           class="width-96"
@@ -55,7 +55,7 @@ const add_ref = ref()
 const detail_ref = ref()
 
 const initState = () => ({
-  faqList: [
+  feedbackList: [
     {
       title: '洗车扣费异常问题',
       status: 1,
@@ -79,7 +79,7 @@ const call = () => {
 };
 
 const toggle = (index: number) => {
-  state.faqList = state.faqList.map((item, i) => {
+  state.feedbackList = state.feedbackList.map((item, i) => {
     return {
       ...item,
       open: item.open ? false : i === index,
@@ -87,14 +87,14 @@ const toggle = (index: number) => {
   });
 };
 
-onShow((options) => {
+onShow((options:any) => {
   let gd = getApp<any>().globalData;
   console.log(gd)
   if (options) {
-    state.servicerPhone = options.service;
+    state.servicerPhone = options.servicePhone;
   }
-  body(`faq/list`).then((res: any) => {
-    // state.faqList = res.list;
+  body(`/feedback/list`).then((res: any) => {
+    state.feedbackList = res.list;
   })
 });
 

+ 1 - 0
src/pages-user/profile/index.vue

@@ -36,6 +36,7 @@ const customStyle = () => {
 const handleChoosePlate = () => {
   uni.chooseLicensePlate({
     success: (res) => {
+      plateNo.value = res.plateNumber;
       save({
         defaultPlateNo: res.plateNumber,
       });

+ 78 - 34
src/pages-user/wallet/index.vue

@@ -10,18 +10,18 @@
       </view>
       <view class="wallet-header_balance">
         <text class="font18 mr10" style="vertical-align: top">¥</text>
-        <text style="font-size: 32px; line-height: 32px;font-weight: 600;">{{ (user?.balance || 0).toFixed(2) }}
+        <text style="font-size: 32px; line-height: 32px;font-weight: 600;">{{ (account.balance || 0).toFixed(2) }}
         </text>
       </view>
       <view class="wallet-header_pounds">
         <view>
           <text>充值余额:</text>
-          <text>112.34</text>
+          <text>{{ account.rechargeBalance.toFixed(2) }}</text>
         </view>
 
         <view>
           <text>赠款余额:</text>
-          <text>20.00</text>
+          <text>{{ account.grantsBalance.toFixed(2) }}</text>
         </view>
       </view>
     </view>
@@ -30,15 +30,23 @@
       <uv-tabs :list="tabs" @click="handleTabClick"></uv-tabs>
       <uv-list>
         <uv-list-item
-                      clickable show-arrow v-for="(item,index) in dataList" :key="index">
+            clickable show-arrow v-for="(item,index) in dataList" :key="index" @click="handleClickDetail(item)">
           <template #default>
-
+            <view class="wallet-item">
+              <view class="wallet-item_header">
+                <view class="flex">
+                  <text class="wallet-item_header-type">{{ fmtDictName('WalletDetail.type', item.type) }}</text>
+                  <text class="wallet-item_header-status">{{ fmtDictName('WalletDetail.status', item.status) }}</text>
+                </view>
+                <text class="wallet-item_header-amt">{{ (item.amount/100).toFixed(2) }}元</text>
+              </view>
+              <view class="wallet-item_body">
+                <text class="wallet-item_body-order">{{ item.orderNo}}</text>
+                <text class="wallet-item_body-time">{{ fmtDateTime(item.transactionTime) }}</text>
+              </view>
+            </view>
           </template>
         </uv-list-item>
-        <uv-list-item title="列表文字" note="列表描述信息"></uv-list-item>
-        <uv-list-item title="列表文字" note="列表描述信息"></uv-list-item>
-        <uv-list-item title="列表文字" note="列表描述信息"></uv-list-item>
-        <uv-list-item title="列表文字" note="列表描述信息"></uv-list-item>
       </uv-list>
     </view>
 
@@ -59,8 +67,10 @@ import {onPullDownRefresh, onReachBottom, onShow} from "@dcloudio/uni-app";
 import {ref} from "vue";
 import {rpxToPx} from "@/utils/device";
 import {body, get} from "@/utils/https";
+import {checkLogin} from "@/utils/auth";
+import {fmtDictName,fmtDateTime} from "@/utils/common";
 
-const user = ref();
+const account = ref();
 
 const dataList = ref([])
 const tab = ref(0);
@@ -102,23 +112,16 @@ const scrollViewHeight = ref(0);
 
 onShow(() => {
   // infiniteScroller.refresh();
-  loadData();
-  if (getApp<any>().globalData.user) {
-    user.value = getApp<any>().globalData.user;
-  }
+  checkLogin().then(() => {
+    loadData();
+  })
 })
 
 onReachBottom(() => {
-  // if(tab.value!==2){
-  //   infiniteScroller.next();
-  // }
   loadData();
 });
 
 onPullDownRefresh(() => {
-  // if(tab.value!==2){
-  //   infiniteScroller.refresh();
-  // }
   loadData();
 });
 
@@ -128,29 +131,26 @@ const to = (url: string) => {
   })
 }
 
-const handleTabClick = (e:any) => {
-  let {name,value,index} = e
+const handleTabClick = (e: any) => {
+  let {name, value, index} = e
   tab.value = index;
   console.log(index)
   loadData();
 }
 
 const loadData = () => {
-  if (!user) return;
-  get(`/account/walletDetail`, {type: tab.value}).then((list: any) => {
+  get(`/account/balance`).then(res => {
+    account.value = res;
+  })
+  get(`/account/walletDetailList`, {type: tab.value}).then((list: any) => {
     dataList.value = list;
   })
 }
 
-const detail = (index: number) => {
-  if (!dataList.value) {
-    return;
-  }
-/*  if (dataList.value[index].type === 3) {
-    uni.navigateTo({
-      url: `/pages-order/detail/index?id=${dataList.value[index]?.orderNo}`,
-    });
-  }*/
+const handleClickDetail = (walletDetail: any) => {
+  uni.navigateTo({
+    url: `/pages-order/detail/index?id=${walletDetail.id}&type=${walletDetail.type}&orderNo=${walletDetail.orderNo}`,
+  });
 };
 </script>
 
@@ -213,8 +213,50 @@ const detail = (index: number) => {
   }
 
   .wallet-body {
+    margin: 20rpx 20rpx 60rpx 20rpx;
+
+
+    .wallet-item{
+      display: flex;
+      flex-direction: column;
+      padding: 14rpx;
+      border-radius: 8rpx;
+      margin: 10rpx 16prx 10rpx 10rpx;
+
+
+      &_header{
+        display: inline-flex;
+        flex-wrap: nowrap;
+        justify-content: space-between;
+
+        &-type{
+          font-weight: 500;
+          font-size: 14px;
+        }
+
+
+        &-status{
+          font-size: 13px;
+          margin-left: 6px;
+        }
+
+        &-amt{
+          font-weight: 500;
+          font-size: 17px;
+        }
+      }
 
-    margin-bottom: 60rpx;
+      &_body{
+        padding: 10rpx 0;
+        display: inline-flex;
+        justify-content: space-between;
+
+        &-order,&-time{
+          font-size:12px ;
+          color:$uni-color-subtitle
+        }
+      }
+    }
   }
 
   .wallet-bottom {
@@ -225,6 +267,8 @@ const detail = (index: number) => {
   }
 
 
+
+
 }
 
 </style>

+ 1 - 1
src/pages-user/wallet/recharge.vue

@@ -62,7 +62,7 @@ const confirm = () => {
   });
 
   let recharge = state.configList[state.chosenIdx]
-  body("/payment/wxPay", {amount: parseInt(`${1 * 100}`)}).then((res: any) => {
+  get("/payment/wxPay", {rechargeConfigId:recharge.id}).then((res: any) => {
     // #ifdef MP-WEIXIN
     wx.requestPayment({
       timeStamp: `${res.timeStamp}`,

+ 33 - 32
src/pages-user/wallet/refund.vue

@@ -5,16 +5,11 @@
       <view
           class="pt-24 pb-24 box-content flex-inline"
           style="border-bottom: 1rpx solid rgba(0, 0, 0, 0.1)">
-        <text style="font-size: 32px; line-height: 32px">¥</text>
-        <input
-            style="height: 46px; font-size: 46px; line-height: 46px"
-            class="fw-600 color-000 ml-18"
-            :value="value"
-            :disabled="true"/>
+        <text style="font-size: 32px; line-height: 32px">¥{{ (account.balance || 0).toFixed(2) }}</text>
       </view>
       <view class="height-94 flex-align-center">
-        <view class="fs-28 color-999">可退金额 {{ user ? user.refundableAmount : 0 }} 元,优惠金额
-          {{ user ? user.discountAmount : 0 }} 元
+        <view class="fs-28 color-999">可退金额 {{ (account.balance || 0).toFixed(2) }} 元,优惠金额
+          {{ (account.grantsBalance || 0).toFixed(2) }} 元
         </view>
         <!-- <view class="fs-28 color-primary" @click="allRefund">全部提现</view> -->
       </view>
@@ -40,41 +35,42 @@
     <view class="block mt-16 relative">
       <view class="fs-28 color-000 fw-500 pb-16">退款说明</view>
       <view class="pb-40 reason-text">
-        <textarea
+        <uv-textarea
             class="fs-28"
             style="height: 100%"
+            count
             placeholder="请您详细填写申请说明"
             maxlength="200"
-            @input="inputReasonText"></textarea>
+            @input="inputReasonText"></uv-textarea>
       </view>
-      <view class="reason-text-length lh-28 fs-28 color-999">{{ reasonText.length }}/200</view>
     </view>
     <view>
       <view class="pl-40 pr-40 pb-30 pt-30" style="background-color: #fff">
-        <uv-button type="primary" @click="submit">提交申请</uv-button>
+        <uv-button type="primary" @click="submit" :disabled="account.balance<=0">提交申请</uv-button>
       </view>
     </view>
 
-    <uv-gap height="80" bgColor="#bbb"></uv-gap>
 
-    <uv-alert
-        v-if="success"
-        type="success"
-        :show-icon="true"
-        description="提交成功,预计需要5个工作日内审核完成请及时查收">
-      <view class="pt-64" style="width: 280rpx">
-        <uv-button height="80" type="primary" @click="close">完成</uv-button>
+    <uv-popup
+        closeable
+        @change="popClose"
+        ref="popup_ref"
+        mode="bottom"
+        custom-style="height: 200rpx;">
+      <view class="pt-64" style="width: 100%;">
+        <uv-alert :show-icon="true" type="success" description="提交成功,预计需要5个工作日内审核完成请及时查收"></uv-alert>
       </view>
-    </uv-alert>
+    </uv-popup>
   </view>
 </template>
 
 <script setup lang="ts">
 import {onLoad, onShow} from "@dcloudio/uni-app";
 import {ref} from "vue";
-import {body} from "@/utils/https";
+import {post, get} from "@/utils/https";
 
-const user = ref();
+const popup_ref = ref();
+const account = ref();
 const value = ref(0);
 const reasonText = ref("");
 const reason = ref(-1);
@@ -86,20 +82,17 @@ const reasons = ref([
   "很难充上电",
   "其他原因",
 ]);
-const success = ref(false);
+const success = ref(true);
 
 
 onShow(() => {
-  if (getApp<any>().globalData.user) {
-    user.value = getApp<any>().globalData.user;
-    allRefund();
-  }
+  allRefund();
 });
 
 const allRefund = () => {
-  if (user.value) {
-    value.value = Number(user.value.balance);
-  }
+  get(`/account/balance`).then(res => {
+    account.value = res;
+  })
 };
 
 const changeReason = (i: number) => {
@@ -110,6 +103,13 @@ const inputReasonText = (e: any) => {
   reasonText.value = e.detail.value;
 };
 
+const popClose = (e:any) => {
+  if (!e.show) {
+    uni.redirectTo({
+      url: '/pages/user/index'
+    })
+  }
+}
 
 const submit = () => {
   uni.showLoading({
@@ -125,9 +125,10 @@ const submit = () => {
   if (reasonText.value) {
     r += reasonText.value;
   }
-  body(`refund/apply`, r).then((res: any) => {
+  post(`/payment/wxApplyRefund`, r).then((res: any) => {
     uni.hideLoading();
     success.value = true;
+    popup_ref.value?.open();
   }).catch((err) => {
     console.log(err);
     uni.hideLoading();

+ 7 - 1
src/pages-wash/device/index.vue

@@ -40,11 +40,17 @@ onHide(() => {
   Object.assign(state, initState());
 })
 
-onLoad((options) => {
+onLoad((options:any) => {
   console.log("device onLoad>>>>", options)
   let id = options?.shortId;
   if (!id) {
+    let query = decodeURIComponent(options);
+    let scanTime = options.scancode_time;
+    if(query){
+      id   = query?.shortId||query?.id||query
+    }else{
     return;
+    }
   }
   state.device = getApp<any>().globalData.last.device;
   console.log(state.device)

+ 2 - 2
src/pages-wash/station/index.vue

@@ -12,7 +12,7 @@
       <view class="device-item" v-for="device in state.deviceList" :key="device.id" @click="handleClickDevice(device)">
         <view class="device-item_header">
           <text>{{ device.deviceName }}</text>
-          <text class="device-item_header-status">{{ getDictName('WashDevice.state', device.state) }}</text>
+          <text class="device-item_header-status">{{ fmtDictName('WashDevice.state', device.state) }}</text>
         </view>
         <view class="device-item_func">
           <text class="device-item_func-label">{{ device.functions }}</text>
@@ -31,7 +31,7 @@
 import {onHide, onLoad, onShow} from "@dcloudio/uni-app";
 import {reactive, ref} from "vue";
 import {get} from "@/utils/https";
-import {getDictName} from "@/utils/common";
+import {fmtDictName} from "@/utils/common";
 import WashStation from "@/components/station/index.vue"
 
 const initState = () => ({

+ 39 - 1
src/pages.json

@@ -87,7 +87,8 @@
           "style": {
             "navigationStyle": "default",
             "navigationBarTitleText": "我的钱包",
-            "navigationBarBackgroundColor": "#ffffff"
+            "navigationBarBackgroundColor": "#ffffff",
+            "enablePullDownRefresh": true
           }
         },
         {
@@ -136,6 +137,43 @@
           }
         }
       ]
+    },
+    {
+      "root": "pages-order",
+      "pages": [
+        {
+          "path": "list/index",
+          "style": {
+            "navigationStyle": "default",
+            "navigationBarTitleText": "订单列表",
+            "navigationBarBackgroundColor": "#ffffff"
+          }
+        },
+        {
+          "path": "detail/index",
+          "style": {
+            "navigationStyle": "default",
+            "navigationBarTitleText": "订单详情",
+            "navigationBarBackgroundColor": "#ffffff"
+          }
+        },
+        {
+          "path": "pay/index",
+          "style": {
+            "navigationStyle": "default",
+            "navigationBarTitleText": "支付详情",
+            "navigationBarBackgroundColor": "#ffffff"
+          }
+        },
+        {
+          "path": "process/index",
+          "style": {
+            "navigationStyle": "default",
+            "navigationBarTitleText": "进度",
+            "navigationBarBackgroundColor": "#ffffff"
+          }
+        }
+      ]
     }
   ],
   "tabBar": {

+ 2 - 0
src/pages/index/index.vue

@@ -17,9 +17,11 @@
           bgColor="#ffffff">
       </uv-swiper>
     </view>
+<!--
     <view class="w100">
       <uv-notice-bar mode="closable" speed="50" url="/pages/coupon/index" :text="state.notice"></uv-notice-bar>
     </view>
+-->
 
     <view class="w100 gap"></view>
 

二進制
src/static/contact-customer.png


+ 31 - 6
src/utils/common.ts

@@ -64,19 +64,44 @@ export function groupByKey(elements: Array<any>, key: string) {
     }, {});
 }
 
-export function getDictName(code:string, value: string) {
-    let dictStorage:any = uni.getStorageSync('dict');
+export function fmtDictName(code: string, value: string) {
+    let dictStorage: any = uni.getStorageSync('dict');
     console.log(dictStorage)
-    if(!dictStorage){
+    if (!dictStorage) {
         return value;
     }
 
     let elements = dictStorage[code];
-    if(elements){
-        let ele = elements.find((k: any)=>k.value===value);
-        if(ele){
+    if (elements) {
+        let ele = elements.find((k: any) => k.value === value);
+        if (ele) {
             return ele.name;
         }
     }
     return value;
 }
+
+
+export function fmtDateTime(date: any) {
+    if (!date) {
+        return "";
+    }
+    if (!date instanceof Number && !date instanceof Date) {
+        return date;
+    }
+    date = new Date(date);
+    const year = date.getFullYear();
+    const month = date.getMonth() + 1;
+    const day = date.getDate();
+    const hour = date.getHours();
+    const minute = date.getMinutes();
+    const second = date.getSeconds();
+
+    return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
+};
+
+
+const formatNumber = n => {
+    n = n.toString();
+    return n[1] ? n : '0' + n
+}

部分文件因文件數量過多而無法顯示