Ver Fonte

模拟调试修改

zuypeng há 1 ano atrás
pai
commit
e6c66950ac

+ 12 - 6
src/pages-order/detail/index.vue

@@ -156,9 +156,9 @@ onHide(() => {
 
 
 const handleCopy = () => {
-  if (!state.detail.orderNo) return;
+  if (!state.detail.orderId) return;
   uni.setClipboardData({
-    data: state.detail.orderNo,
+    data: state.detail.orderId,
     success: function () {
       uni.showToast({
         title: '复制成功',
@@ -318,12 +318,12 @@ page {
   .cell-tit {
     flex: 1;
     font-size: 26rpx;
-    color: #909399;
+    //color: #909399;
     margin-right: 10rpx;
   }
 
   .cell-tip {
-    font-size: 26rpx;
+    font-size: 28rpx;
     color: #303133;
 
     &.disabled {
@@ -384,14 +384,18 @@ page {
       padding:5px;
       width: 100%;
       background-color: #eeefff;
-      color: #2c405a;
-      font-size: 16px;
+      font-size: 24rpx;
+      //color: #909399;
+      //color: #2c405a;
+      //font-size: 16px;
       display: inline-flex;
       justify-content: space-around;
 
       &_title,&_price,&_total,&_num{
         width: 25%;
         text-align: center;
+        //border: 1px solid #ccc;
+        padding: 5px 0;
       }
     }
   }
@@ -413,6 +417,8 @@ page {
           border: 1px solid #ccc;
           border-right: none;
           border-top: none;
+          font-size: 24rpx;
+          padding: 5px 0;
         }
       }
     }

+ 10 - 4
src/pages-user/feedback/add.vue

@@ -53,8 +53,8 @@
 
       <view class="w100 text-right">
         <!--        <uv-text type="info" @click="close" :customStyle="{'width':'120px','margin-left':'10px'}"> 取 消</uv-text>-->
-        <viewt class="text-right_btn" @click="handleSubmit" v-if="state.mode==='add'" text="提 交">提交
-        </viewt>
+        <view class="text-right_btn" @click="handleSubmit" v-if="state.mode==='add'">提交反馈
+        </view>
       </view>
     </uv-popup>
 
@@ -106,6 +106,7 @@ onHide(() => {
 })
 
 const handleSubmit = () => {
+  console.log("submit")
   feedback_form_ref.value?.validate().then((res: any) => {
     uni.showToast({
       icon: 'success',
@@ -198,8 +199,13 @@ defineExpose({
   text-align: right;
 
   .text-right_btn {
-    margin-right: 10px;
-    color:$uni-color-primary
+    /* margin-right: 10px; */
+    background-color: #19A497;
+    color: white;
+    font-size: 15px;
+    padding: 5px 12px;
+    border-radius: 3px;
+    text-align: center;
   }
 }
 </style>

+ 17 - 4
src/pages-user/feedback/index.vue

@@ -12,6 +12,7 @@
             v-for="(item, index) in state.feedbackList" :key="index">
           <template #footer>
             <uv-tags text="已反馈" plain size="mini" type="warning" v-if="item.replyContent"></uv-tags>
+            <uv-tags text="待反馈" plain size="mini" type="primary" v-else></uv-tags>
           </template>
         </uv-list-item>
       </uv-list>
@@ -22,9 +23,10 @@
         class="flex-center flex-column contact mt-20"
         hover-class="hover-scale"
         @click="call"
-   >
+    >
 
       <image
+          @click="handleCallPhone"
           class="width-96"
           mode="widthFix"
           src="/static/contact-customer.png"/>
@@ -47,6 +49,7 @@ import {reactive, ref} from "vue";
 import {body} from "@/utils/https"
 
 import add from '@/pages-user/feedback/add.vue';
+import {getServicePhone} from "@/utils/common";
 
 const add_ref = ref()
 const detail_ref = ref()
@@ -84,7 +87,7 @@ const toggle = (index: number) => {
   });
 };
 
-onShow((options:any) => {
+onShow((options: any) => {
   let gd = getApp<any>().globalData;
   console.log(gd)
   if (options) {
@@ -93,6 +96,16 @@ onShow((options:any) => {
   loadDataList()
 });
 
+const handleCallPhone = () => {
+  let servicePhone = getServicePhone();
+  uni.makePhoneCall({
+    phoneNumber: servicePhone,
+    fail: (error) => {
+      console.log(error)
+    }
+  });
+}
+
 const loadDataList = () => {
   body(`/feedback/list`).then((res: any) => {
     state.feedbackList = res.list;
@@ -104,11 +117,11 @@ onHide(() => {
 })
 
 const handleClickFaq = (item: any) => {
-  detail_ref.value?.open(item,'detail')
+  detail_ref.value?.open(item, 'detail')
 }
 
 const handleAddFeedback = () => {
-  add_ref.value?.open(null,'add');
+  add_ref.value?.open(null, 'add');
 }
 </script>
 

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

@@ -50,6 +50,7 @@
           </template>
         </uv-list-item>
       </uv-list>
+      <uv-empty mode="order" v-if="!dataList||dataList.length===0" text="暂无数据"></uv-empty>
     </view>
 
     <view class="wallet-bottom">

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

@@ -6,7 +6,7 @@
             class="recharge-item" :class="idx===state.chosenIdx?'active':''">
         <view class="recharge-item_amt">{{ (recharge.rechargeAmount/100).toFixed(2) }}</view>
         <view class="recharge-item_grant" v-if="recharge.grantsAmount>0">
-          <uv-icon name="gift" :color="idx===state.chosenIdx?'#19A497':'#2b2b2b'"></uv-icon>
+          <uv-icon name="gift" :color="idx===state.chosenIdx?'#19A497':'#2b2b2b'" size="14px"></uv-icon>
           {{ (recharge.grantsAmount/100).toFixed(2) }}元
         </view>
       </view>
@@ -78,7 +78,7 @@ const confirm = () => {
         })
         setTimeout(()=>{
           uni.redirectTo({
-            url:'/pages-user/user/index'
+            url:'/pages/user/index'
           })
         },500)
 
@@ -128,7 +128,7 @@ const confirm = () => {
 
     &_grant {
       font-size: 12px;
-      margin-top: 10rpx;
+      margin-top: 4rpx;
       display: inline-flex;
     }
   }

+ 53 - 44
src/pages-wash/device/index.vue

@@ -6,7 +6,7 @@
       </view>
       <view class="device-header_fun">
         <view class="device-header_func-tag" v-for="f in state.device.functionList" :key="f" style="margin-right: 10px;">
-          <uv-tags :text="f"  size="mini"   plain plainFill bgColor="#19A497" color="white"> </uv-tags>
+          <uv-tags :text="f" size="mini" plain plainFill bgColor="#19A497" color="white"></uv-tags>
         </view>
       </view>
       <view class="device-header_fun">
@@ -21,19 +21,19 @@
       </view>
 
       <view class=device-body_guide>
-        <view>●点击上方【启动】按钮启动设备;
+        <view>●点击上方【启动设备】按钮启动设备;
         </view>
         <view>●设备启动后,请在设备功能面板按下功能按键以选择服务项目;
         </view>
-        <view>●洗车过程中再次按下功能按键可以暂停功能,暂停过程中将停止计费,如需恢复请再次按下功能按键;
+        <view>●洗车过程中再次按下功能按键可以暂停功能,暂停过程中将停止计费,如需恢复请再次按下功能按键;
         </view>
-        <view>●洗车结束后,请按下结算按键或小程序【结束】按钮,设备停止运行之后将结束计费;
+        <view>●洗车结束后,请按下结算按键或小程序【停止设备】按钮,设备停止运行之后将结束计费;
         </view>
         <view>●请在洗车完成后尽快将车辆驶离工位以方便后续用户,谢谢配合。
         </view>
 
       </view>
-<!--      <view class="device-body_ops-time">{{ state.time }}</view>-->
+      <!--      <view class="device-body_ops-time">{{ state.time }}</view>-->
     </view>
   </view>
 </template>
@@ -46,9 +46,9 @@ import {get, post} from "@/utils/https";
 
 const initState = () => ({
   device: {
-    functions:[],
-    deviceName:'',
-    state:''
+    functions: [],
+    deviceName: '',
+    state: ''
   },
   time: "00:00:00",
   start: new Date()
@@ -60,17 +60,17 @@ onHide(() => {
   Object.assign(state, initState());
 })
 
-onLoad((options:any) => {
+onLoad((options: any) => {
   console.log("device onLoad>>>>", options)
   let id = options?.shortId;
   if (!id) {
     let query = decodeURIComponent(options.q);
     let scanTime = options.scancode_time;
-    console.log(query,scanTime)
-    if(query){
-      id   = query.split("#")[1]
-    }else{
-    return;
+    console.log(query, scanTime)
+    if (query) {
+      id = query.split("#")[1]
+    } else {
+      return;
     }
   }
   state.device = getApp<any>().globalData.last.device;
@@ -80,18 +80,18 @@ onLoad((options:any) => {
 
 const loadDeviceDetail = (id: number) => {
   get(`/wash-device/queryDevice/${id}`).then((res: any) => {
-    if(res.currentUserId && res.currentUserId!=getApp<any>().globalData.user.id){
+    if (res.currentUserId && res.currentUserId != getApp<any>().globalData.user.id) {
       uni.showToast({
-        title:'设备已被占用',
-        icon:'error'
+        title: '设备已被占用',
+        icon: 'error'
       })
-      setTimeout(()=>{
+      setTimeout(() => {
         uni.redirectTo({
-          url:'/pages/index/index'
+          url: '/pages/index/index'
         })
-      },2000)
+      }, 2000)
     }
-    res.functionList = res.funcs.split("|")||[]
+    res.functionList = res.funcs?.split("|") || []
     state.device = res;
   }).catch(e => {
     console.error(e)
@@ -103,31 +103,40 @@ const handleNavigateBack = () => {
   uni.navigateBack();
 }
 
-const debounceStartStopDevice = debounce(()=>{
+const debounceStartStopDevice = debounce(() => {
   handleClickDevice();
-},600)
+}, 600)
 
 const handleClickDevice = () => {
-    if(state.device?.state==='idle'){
-      uni.showLoading({
-        title: "启动中",
-        mask: true,
-      });
-      post(`/wash-device/startDevice/${state.device.shortId}`).then((res:any)=>{
-        uni.hideLoading();
-        uni.showToast({
-          title:'设备启动成功'
-        })
-      })
-    }else{
-      uni.showLoading({
-        title: "停止中",
-        mask: true,
-      });
-      post(`/wash-device/stopDevice/${state.device.shortId}`).then((res:any)=>{
-        uni.hideLoading()
-      })
+  uni.showModal({
+    title: '提示',
+    content: state.device?.state === 'idle' ? '确定启动设备开始洗车吗?' : '确定停止设备终止本次服务吗?',
+    success: (res) => {
+      if (res.confirm) {
+        if (state.device?.state === 'idle') {
+          uni.showLoading({
+            title: "启动中",
+            mask: true,
+          });
+          post(`/wash-device/startDevice/${state.device.shortId}`).then((res: any) => {
+            uni.hideLoading();
+            uni.showToast({
+              title: '设备启动成功'
+            })
+          })
+        } else {
+          uni.showLoading({
+            title: "停止中",
+            mask: true,
+          });
+          post(`/wash-device/stopDevice/${state.device.shortId}`).then((res: any) => {
+            uni.hideLoading()
+          })
+        }
+      }
     }
+  });
+
 }
 
 const countTime = () => {
@@ -173,7 +182,7 @@ const countTime = () => {
     margin: 10rpx 0;
     display: inline-flex;
 
-    &-tag{
+    &-tag {
       margin-right: 10px;
     }
   }
@@ -203,7 +212,7 @@ const countTime = () => {
     font-weight: 500;
   }
 
-  &_guide{
+  &_guide {
     width: 80%;
     margin-top: 40px;
     font-size: 14px;

+ 4 - 2
src/pages/user/index.vue

@@ -74,6 +74,7 @@ import TabBar from "@/components/tab-bar/index.vue";
 import LoginBar from "@/components/login-bar/index.vue";
 import {checkLogin, clearToken} from "@/utils/auth"
 import {get} from "@/utils/https";
+import {getServicePhone} from "@/utils/common";
 
 const containerStyle = ref({});
 const user = ref<any>({
@@ -129,9 +130,10 @@ const menu = ref([
 const toPage = (item: any) => {
   checkLogin().then(() => {
     let {title, path} = item;
+    let servicePhone = getServicePhone();
     if (path.includes('contact')) {
       uni.makePhoneCall({
-        phoneNumber: service.value,
+        phoneNumber: servicePhone,
         fail: (error) => {
           console.log(error)
         }
@@ -364,7 +366,7 @@ page{
 
   &-wrap{
     height: 80rpx;
-    font-size: 24rpx;
+    font-size: 28rpx;
     margin: 20px auto;
     width: 540rpx;
     text-align: center;

+ 14 - 0
src/utils/common.ts

@@ -80,6 +80,20 @@ export function fmtDictName(code: string, value: string) {
     }
     return value;
 }
+export function getServicePhone() {
+    let dictStorage: any = uni.getStorageSync('dict');
+
+    if (!dictStorage) {
+        return "";
+    }
+
+    let elements = dictStorage["Service.phone"];
+    if (elements) {
+        return elements[0].value;
+    }
+    return "";
+}
+
 
 
 export function fmtDateTime(date: any) {