瀏覽代碼

一键成片优化1

Figo 1 月之前
父節點
當前提交
04e13f2ca8
共有 14 個文件被更改,包括 1739 次插入1257 次删除
  1. 6 0
      apis/index.js
  2. 49 0
      apis/order.js
  3. 4 0
      main.js
  4. 1 1
      pages.json
  5. 89 96
      pages/index/index.vue
  6. 447 213
      pages/order/index.vue
  7. 107 128
      pages/order/order_confirm.vue
  8. 231 181
      pages/order/success.vue
  9. 59 62
      pages/user/index.vue
  10. 140 120
      request/index.js
  11. 307 225
      uni.scss
  12. 45 0
      utils/filter.js
  13. 18 1
      utils/preCheck.js
  14. 236 230
      utils/utils.js

+ 6 - 0
apis/index.js

@@ -13,6 +13,12 @@ export const getWxBuyConfig = (data) => {
         data: data,
     })
 }
+export const submitOrder = (data) => {
+    return request.post({
+        url: '/api/order/save',
+        data: data,
+    })
+}
 
 // 根据ID获取套餐数据
 export const getPackageById = (data) => {

+ 49 - 0
apis/order.js

@@ -6,4 +6,53 @@ export const orderApi = (data) => {
 		url: '/api/order/page',
 		data: data,
 	})
+}
+// 取消订单
+export const cancelOrder = (data) => {
+	return request.post({
+		url: '/api/order/cancelOrder',
+		data: data,
+	})
+}
+// 取消申请售后
+export const cancelAftermarketOrder = (data) => {
+	return request.post({
+		url: '/api/order/cancelAftermarket',
+		data: data,
+	})
+}
+// 申请售后
+export const aftermarketOrder = (data) => {
+	return request.post({
+		url: '/api/order/aftermarket',
+		data: data,
+	})
+}
+// 修改订单
+export const updateOrder = (data) => {
+	return request.post({
+		url: '/api/order/updateOrder',
+		data: data,
+	})
+}
+// 确认验收
+export const checkOrder = (data) => {
+	return request.post({
+		url: '/api/order/checkOrder',
+		data: data,
+	})
+}
+// 订单分页
+export const getOrderListPage = (data) => {
+	return request.get({
+		url: '/api/order/page',
+		data: data,
+	})
+}
+// 订单详情
+export const getOrderDetail = (data) => {
+	return request.get({
+		url: '/api/order/getById',
+		data: data,
+	})
 }

+ 4 - 0
main.js

@@ -4,12 +4,16 @@ import App from './App'
 import Vue from 'vue'
 import uView from '@/plugins/uview-ui'
 import '@/utils/preCheck.js'
+import filters from '@/utils/filter.js'
 import '@/utils/prototype.js'
 import platform from "@/utils/platform" // 平台判断方法
 import getEnv from "@/utils/env" // 获取环境变量
 
 import './uni.promisify.adaptor'
 
+for (let key in filters){
+  Vue.filter(key,filters[key])
+}
 Vue.use(uView)
 
 Vue.config.productionTip = false

+ 1 - 1
pages.json

@@ -62,7 +62,7 @@
 				{
 					"path": "success",
 					"style": {
-						"navigationBarTitleText": "购买成功",
+						"navigationBarTitleText": "支付成功",
 						"navigationStyle": "custom"
 					}
 				}

+ 89 - 96
pages/index/index.vue

@@ -138,7 +138,7 @@
 
 <script>
 import {home} from '@/apis/index'
-import {getWxUserInfo} from "../../utils/wxAuth";
+
 
 export default {
   data() {
@@ -164,15 +164,12 @@ export default {
     }
   },
   onLoad() {
-    this.changeTabbar()
-    if (!uni.getStorageSync('token')) {
-      this.getUserInfo()
-    }
+
     this.getData()
 
   },
   onShow() {
-
+    this.changeTabbar()
   },
   methods: {
     // 跳转到购买详情页
@@ -181,14 +178,6 @@ export default {
         url: '/pages/order/order_confirm?id=' + this.setData.packageId + '&strip=' + this.setData.count + '&type=' + this.tabStatus
       })
     },
-    async getUserInfo() {
-      try {
-        await getWxUserInfo();
-      } catch (error) {
-        console.error('获取用户信息失败', error);
-      }
-    },
-
 
     // 成片/素材
     tabStatusChange(num) {
@@ -225,6 +214,10 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+.title {
+  font-weight: 600 !important;
+}
+
 .content {
   width: 100%;
   // min-height: 100vh;
@@ -238,18 +231,18 @@ export default {
   .all {
     flex: 1;
     overflow: auto;
-    padding: 0 24 rpx 24 rpx;
+    padding: 0 24rpx 24rpx;
 
   }
 
   .title {
-    padding: 16 rpx 8 rpx;
+    padding: 16rpx 8rpx;
     font-weight: normal;
-    font-size: 32 rpx;
+    font-size: 32rpx;
     color: #FFFFFF;
 
     .logo {
-      height: 56 rpx;
+      height: 56rpx;
     }
   }
 
@@ -258,7 +251,7 @@ export default {
     flex-direction: column;
     justify-content: center;
     align-items: center;
-    margin-top: 96 rpx;
+    margin-top: 96rpx;
 
     .tips-title {
       display: flex;
@@ -267,30 +260,30 @@ export default {
 
       .title-text {
         font-weight: bold;
-        font-size: 40 rpx;
+        font-size: 40rpx;
         color: transparent;
         background: linear-gradient(54.35820730218651deg, #00C1FF 0%, #2FFFFC 100%);
         -webkit-background-clip: text;
       }
 
       .line {
-        width: 112 rpx;
+        width: 112rpx;
       }
     }
 
     .tips-content {
-      font-size: 32 rpx;
+      font-size: 32rpx;
       color: #F8FAFF;
-      margin-top: 28 rpx;
+      margin-top: 28rpx;
 
       .cantant {
         font-weight: 400;
-        font-size: 32 rpx;
+        font-size: 32rpx;
         color: #00ECFF;
         background: linear-gradient(54.35820730218651deg, #00C1FF 0%, #2FFFFC 100%);
         -webkit-background-clip: text;
         text-decoration: underline;
-        margin-left: 8 rpx;
+        margin-left: 8rpx;
       }
     }
   }
@@ -299,50 +292,50 @@ export default {
     display: flex;
     flex-direction: column;
     align-items: center;
-    margin-top: 52 rpx;
+    margin-top: 52rpx;
 
     .tabs {
       display: flex;
       justify-content: center;
-      width: 368 rpx;
-      height: 72 rpx;
+      width: 368rpx;
+      height: 72rpx;
       background: rgba($color: #FFF, $alpha: 0.1);
-      border-radius: 36 rpx;
+      border-radius: 36rpx;
 
       .tab-item {
         display: flex;
         justify-content: center;
         align-items: center;
-        font-size: 28 rpx;
+        font-size: 28rpx;
         width: 50%;
-        height: 64 rpx;
+        height: 64rpx;
         color: #F6F8FF;
       }
     }
 
     .select {
       background: linear-gradient(144deg, #00C1FF 0%, #2FFFFC 100%);
-      border-radius: 32 rpx;
+      border-radius: 32rpx;
       color: #0D121A !important;
     }
 
     .tab_menus {
-      padding: 64 rpx 40 rpx 56 rpx;
+      padding: 64rpx 40rpx 56rpx;
       width: 100%;
 
       .tab-menu-item {
         color: #9EA3B1;
-        font-size: 28 rpx;
+        font-size: 28rpx;
 
         .now_menu {
-          font-size: 36 rpx;
+          font-size: 36rpx;
           color: #F8FAFF !important;
-          margin-right: 10 rpx;
+          margin-right: 10rpx;
         }
 
         image {
-          width: 36 rpx;
-          height: 36 rpx;
+          width: 36rpx;
+          height: 36rpx;
         }
       }
 
@@ -351,13 +344,13 @@ export default {
 
     .menu_con {
       width: 100%;
-      border-radius: 24 rpx;
-      border: 2 rpx solid rgba(255, 255, 255, 0.12);
-      margin: 0 24 rpx;
-      padding: 56 rpx 32 rpx 48 rpx;
+      border-radius: 24rpx;
+      border: 2rpx solid rgba(255, 255, 255, 0.12);
+      margin: 0 24rpx;
+      padding: 56rpx 32rpx 48rpx;
 
       .cons {
-        padding: 0 16 rpx;
+        padding: 0 16rpx;
       }
 
       .menu_title {
@@ -366,105 +359,105 @@ export default {
         align-items: center;
 
         .metit {
-          font-size: 44 rpx;
+          font-size: 44px;
           color: #F8FAFF;
         }
 
         .exmple {
-          width: 156 rpx;
-          height: 64 rpx;
+          width: 156rpx;
+          height: 64rpx;
           background: #0D121A;
-          border-radius: 12 rpx;
+          border-radius: 12rpx;
           display: flex;
           align-items: center;
           justify-content: center;
-          font-size: 28 rpx;
+          font-size: 28rpx;
           color: #FFFFFF;
 
           .play {
-            width: 32 rpx;
-            height: 32 rpx;
-            margin-right: 12 rpx;
+            width: 32rpx;
+            height: 32rpx;
+            margin-right: 12rpx;
           }
         }
       }
 
       .amounts {
-        margin-top: 72 rpx;
+        margin-top: 72rpx;
 
         .now {
           .money {
-            font-size: 32 rpx;
+            font-size: 32rpx;
             color: #FFFFFF;
 
             .dw {
-              line-height: 40 rpx;
+              line-height: 40rpx;
             }
 
             .num {
-              font-size: 72 rpx;
-              line-height: 56 rpx;
+              font-size: 72rpx;
+              line-height: 56rpx;
             }
 
             .unit {
-              margin-left: 24 rpx;
+              margin-left: 24rpx;
             }
           }
 
           .limit {
-            margin-left: 24 rpx;
-            width: 72 rpx;
-            height: 40 rpx;
+            margin-left: 24px;
+            width: 72rpx;
+            height: 40rpx;
             background: linear-gradient(144deg, #00C1FF 0%, #2FFFFC 100%);
-            border-radius: 8 rpx;
+            border-radius: 8rpx;
             font-weight: 500;
-            font-size: 24 rpx;
+            font-size: 24rpx;
             color: #0D121A;
             text-align: center;
-            line-height: 40 rpx;
+            line-height: 40rpx;
           }
         }
 
         .past {
           color: #BCC0C5;
-          margin-top: 34 rpx;
+          margin-top: 34rpx;
 
           .past_text {
-            margin-right: 8 rpx;
+            margin-right: 8rpx;
           }
         }
       }
 
       .choose {
-        margin-top: 64 rpx;
+        margin-top: 64rpx;
 
         .choose_item-box {
-          margin-top: 16 rpx;
+          margin-top: 16rpx;
 
           image {
-            width: 48 rpx;
-            height: 48 rpx;
-            margin-right: 24 rpx;
+            width: 48rpx;
+            height: 48rpx;
+            margin-right: 24rpx;
           }
 
           text {
             color: #F8FAFF;
-            font-size: 28 rpx;
+            font-size: 28rpx;
           }
         }
 
         .choose_item-more {
           text {
-            font-size: 28 rpx;
+            font-size: 28rpx;
             background: linear-gradient(54.35820730218651deg, #00C1FF 0%, #2FFFFC 100%);
             color: transparent;
             -webkit-background-clip: text;
           }
 
           image {
-            width: 32 rpx;
-            height: 32 rpx;
-            margin-left: 12 rpx;
+            width: 32rpx;
+            height: 32rpx;
+            margin-left: 12rpx;
           }
         }
 
@@ -479,21 +472,21 @@ export default {
 
       .menu_table {
         background: linear-gradient(180deg, rgba(9, 155, 255, 0.12) 0%, rgba(66, 121, 192, 0.08) 100%);
-        border-radius: 24 rpx;
-        border: 2 rpx solid #003849;
-        margin-top: 48 rpx;
+        border-radius: 24rpx;
+        border: 2rpx solid #003849;
+        margin-top: 48px;
 
         .table-prop {
-          padding: 36 rpx 40 rpx;
+          padding: 36rpx 40rpx;
           color: #F8FAFF;
-          font-size: 24 rpx;
-          border-bottom: #1D3A4A 2 rpx solid;
+          font-size: 24rpx;
+          border-bottom: #1D3A4A 2rpx solid;
         }
 
         .table-item {
-          padding: 40 rpx;
-          font-size: 24 rpx;
-          border-bottom: #1D3A4A 2 rpx solid;
+          padding: 40rpx;
+          font-size: 24rpx;
+          border-bottom: #1D3A4A 2rpx solid;
 
           .table-title {
             .ttitle {
@@ -510,19 +503,19 @@ export default {
               }
 
               image {
-                width: 32 rpx;
-                height: 32 rpx;
-                margin-left: 8 rpx;
+                width: 32rpx;
+                height: 32rpx;
+                margin-left: 8rpx;
               }
             }
           }
 
           .table-content {
-            margin-top: 40 rpx;
+            margin-top: 40rpx;
             color: #FFFFFF;
 
             .row {
-              margin-top: 40 rpx;
+              margin-top: 40rpx;
               width: 100%;
 
               .row_name {
@@ -532,7 +525,7 @@ export default {
                 flex-direction: column;
 
                 text:nth-child(2) {
-                  font-size: 20 rpx;
+                  font-size: 20rpx;
                   text-align: center;
                 }
               }
@@ -545,8 +538,8 @@ export default {
               }
 
               .row_empty {
-                width: 32 rpx;
-                height: 32 rpx;
+                width: 32rpx;
+                height: 32rpx;
               }
             }
 
@@ -577,16 +570,16 @@ export default {
 
   .btom {
     flex-shrink: 1;
-    padding: 24 rpx 32 rpx;
+    padding: 24rpx 32rpx;
 
     .btn {
       background-size: 100% 100% !important;
       width: 100%;
-      height: 84 rpx;
+      height: 84rpx;
       text-align: center;
-      line-height: 84 rpx;
+      line-height: 84rpx;
       font-weight: bold;
-      font-size: 32 rpx;
+      font-size: 32rpx;
       color: #0D121A;
     }
   }

+ 447 - 213
pages/order/index.vue

@@ -1,8 +1,8 @@
 <!-- 我的订单 -->
 <template>
-    <view class="order">
-        <view class="tabs">
-            <u-tabs :list="tabLists" lineWidth="40" lineHeight="8" :lineColor="`url(${lineBg}) 100% 100%`" :activeStyle="{
+  <view class="order">
+    <view class="tabs">
+      <u-tabs :list="tabLists" lineWidth="40" lineHeight="8" :lineColor="`url(${lineBg}) 100% 100%`" :activeStyle="{
                 color: '#0D121A',
                 fontSize: '32rpx',
                 fontWeight: 'bold',
@@ -12,242 +12,476 @@
                 fontSize: '28rpx',
                 transform: 'scale(1)'
             }" itemStyle="padding-left: 18px; padding-right: 18px; height: 56px;" @click="tabsChange">
-            </u-tabs>
-        </view>
-        <view class="content">
-            <mescroll-body height="100%" class="custom-height" ref="mescrollRef" @init="mescrollInit" @down="downCallback"
-                :up="upOption" @up="upCallback">
-                <view class="order-list" v-if="arrList && arrList.length">
-                    <view class="tab-content" v-for="(item, index) in arrList" :key="index">
-                        <view class="order-top flex jcsb aic">
-                            <text class="name">{{ item.name }}</text>
-                            <text class="status">{{ item.statusName }}</text>
-                        </view>
-                        <view class="order-middle flex jcsb aifs">
-                            <view class="order-middle-left">
-                                <view>拍摄场景:6个</view>
-                                <view>交付周期:20天</view>
-                            </view>
-                            <view class="order-middle-right flex aic">
-                                <text class="right-label fs24">应付款</text>
-                                <text class="right-money fs28"><text class="fs24">¥</text>2500</text>
-                            </view>
-                        </view>
-                        <view class="order-bottom flex jcsb aic">
-                            <view class="order-bottom-left flex aic">
-                                <image :src="timeImg" class="time-img"></image>
-                                <text class="time fw400"><text class="fw500">{{ item.time }}</text>后自动取消</text>
-                            </view>
-                            <view class="order-bottom-right flex aic">
-                                <view class="btn btn1 p2">取消</view>
-                                <view class="btn btn2 p1">支付</view>
-                                <!-- <view class="btn3">寄样</view> -->
-                            </view>
-                        </view>
-                    </view>
+      </u-tabs>
+    </view>
+    <view class="content">
+      <mescroll-body height="100%" class="custom-height" ref="mescrollRef" @init="mescrollInit" @down="downCallback"
+                     :up="upOption" @up="upCallback">
+        <view class="order-list" v-if="arrList && arrList.length">
+          <view class="tab-content" v-for="(item, index) in arrList" :key="index">
+            <view class="order-top flex-start">
+              <text class="name">{{ item.packageName }}({{ item.quantity }})</text>
+              <text v-if="item.paymentStatus==='CANCELLED'" class="status cancel">{{
+                  item.paymentStatus | orderStatus
+                }}
+              </text>
+              <text v-else-if="item.paymentStatus==='REFUNDED'" class="status cancel">
+                {{ item.paymentStatus | orderStatus }}
+              </text>
+              <text v-else class="status color">{{ item.paymentStatus | orderStatus }}</text>
+            </view>
+            <view class="order-middle flex-between-no-center">
+              <view class="order-middle-left">
+                <view class="fs28 mt-4 fw400" v-for="(content, contentIndex) in item.packageContents"
+                      :key="contentIndex">{{ content }}
+                </view>
+              </view>
+              <view class="order-middle-right flex-start" v-if="item.paymentStatus==='WAIT_PAYMENT'">
+                <view class="right-label fs24">应付款</view>
+                <view class="fs28 fw ml-6"> ¥{{ item.totalAmount }}</view>
+              </view>
+              <view class="order-middle-right" v-if="item.paymentStatus==='SHOOTING'">
+                <view class="progress-bar">
+                  <view class="progress" :style="{ width: (item.completedQuantity/item.quantity)*100+ '%' }">{{item.completedQuantity/item.quantity*100}}%</view>
+                </view>
+<!--                <view class="progress-container">{{item.completedQuantity}}/{{item.quantity}}</view>-->
+              </view>
+              <view class="order-middle-right cancel flex-start" v-if="item.paymentStatus==='REFUNDED'">
+                <view class="right-label fs24 ">已退款</view>
+                <view class="fs28 fw ml-6"> ¥{{ item.totalAmount }}</view>
+              </view>
+            </view>
+            <view v-if="item.paymentStatus==='WAIT_PAYMENT'" class="order-bottom flex-between">
+              <view class="order-bottom-left">
+              </view>
+              <view class="order-bottom-right flex">
+                <view class="btn btn1 p2" @click="cancelOrder(item.orderId)">取消</view>
+                <view class="btn btn2 p1" @click="submitOrder(item)">支付</view>
+                <!-- <view class="btn3">寄样</view> -->
+              </view>
+            </view>
+            <view v-else class="order-bottom flex-between">
+              <view class="flex-start">
+                <view class="fs24">实付款</view>
+                <view class="fs28 fw ml-6"> ¥{{ item.totalAmount }}</view>
+              </view>
+              <view class="order-bottom-right flex">
+                <view class="btn btn1 p2" v-if="item.paymentStatus==='WAIT_PAYMENT'" @click="cancelOrder(item.orderId)">
+                  取消
+                </view>
+                <view class="btn btn1 p2" v-if="item.paymentStatus==='WAIT_SEND'" @click="cancelOrder(item.orderId)">
+                  取消
+                </view>
+                <view class="btn btn1 p2" v-if="item.paymentStatus==='WAIT_ORDER'" @click="cancelOrder(item.orderId)">
+                  取消
+                </view>
+                <view v-if="item.paymentStatus==='WAIT_SEND'" class="btn btn1 p2 ml-6">寄样</view>
+                <view class="btn btn1 p2" v-if="item.paymentStatus==='SHOOTING'" @click="cancelOrder(item.orderId)">申请售后
+                </view>
+                <view class="btn btn1 p2" v-if="item.paymentStatus==='DELIVERED'"
+                      @click="aftermarketOrder(item.orderId)">申请售后
+                </view>
+                <view class="btn btn1 p2" v-if="item.paymentStatus==='WAIT_CHECK'"
+                      @click="aftermarketOrder(item.orderId)">申请售后
                 </view>
-                <no-data :statusType="2" tipsText="暂无记录" v-if="!isInit && !arrList.length"></no-data>
-            </mescroll-body>
+                <view class="btn btn1 p2" v-if="item.paymentStatus==='AFTER_SALE'"
+                      @click="cancelAftermarketOrder(item.orderId)">撤回申请
+                </view>
+                <view class="btn btn1 p2 ml-6" v-if="item.paymentStatus==='WAIT_CHECK'"
+                      @click="checkOrder(item.orderId)">确认验收
+                </view>
+              </view>
+            </view>
+          </view>
         </view>
-
+        <no-data :statusType="2" tipsText="暂无记录" v-if="!isInit && !arrList.length"></no-data>
+      </mescroll-body>
     </view>
+
+  </view>
 </template>
 
 <script>
 import MescrollMixin from "@/plugins/mescroll/components/mescroll-uni/mescroll-mixins.js";
 import MescrollBody from '@/plugins/mescroll/components/mescroll-uni/mescroll-uni.vue';
-import { orderApi } from '@/apis/order.js';
+import {
+  aftermarketOrder,
+  cancelAftermarketOrder,
+  checkOrder,
+  cancelOrder,
+  getOrderListPage,
+  updateOrder
+} from "../../apis/order";
+import {submitOrder} from "../../apis";
+
 export default {
-    mixins: [MescrollMixin],
-    components: {
-        MescrollBody
-    },
-    data() {
-        return {
-            page: 1,
-            limit: 10,
-            lineBg: 'https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/ic_line.png',
-            timeImg: 'https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/ic_time.png',
-            arrList: [
-                {
-                    status: 1,
-                    name: 'A类套餐(50条视频)',
-                    orderNo: '20200709123456789',
-                    time: '34:56',
-                    price: '100.00',
-                    status: 1,
-                    statusName: '待付款',
-                    statusColor: '#FF5E00',
-                    statusIcon: 'https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/ic_daifukuan%403x.png'
-
-                }
-            ],
-            isInit: false,
-            paymentStatus: 1,
-            tabLists: [
-                {
-                    name: '全部',
-                    value: 0
-                },{
-                    name: '待付款',
-                    value: 1
-                },{
-                    name: '拍摄中',
-                    value: 2
-                }, {
-                    name: '已完成',
-                    value: 3
-                }
-            ]
-        };
+  mixins: [MescrollMixin],
+  components: {
+    MescrollBody
+  },
+  data() {
+    return {
+
+      page: 1,
+      limit: 10,
+      lineBg: 'https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/ic_line.png',
+      timeImg: 'https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/ic_time.png',
+      arrList: [],
+      isInit: false,
+      paymentStatus: 'WAIT_PAYMENT',
+      tabLists: [{name: '待付款', value: 'WAIT_PAYMENT'},
+        {name: '待接单', value: 'WAIT_ORDER'},
+        {name: '待寄样', value: 'WAIT_SEND'},
+        {name: '拍摄中', value: 'SHOOTING'},
+        {name: '待验收', value: 'WAIT_CHECK'},
+        {name: '已交付', value: 'DELIVERED'},
+        {name: '售后中', value: 'AFTER_SALE'},
+        {name: '已取消', value: 'CANCELLED'},
+        {name: '已退款', value: 'REFUNDED'}]
+
+    };
+  },
+  computed: {},
+  watch: {},
+  onLoad() {
+    this.getOrderListPage()
+  },
+  filters: {
+    orderStatus(value) {
+      const orderStatusList =
+          [{name: '待付款', value: 'WAIT_PAYMENT'},
+            {name: '待接单', value: 'WAIT_ORDER'},
+            {name: '待寄样', value: 'WAIT_SEND'},
+            {name: '拍摄中', value: 'SHOOTING'},
+            {name: '待验收', value: 'WAIT_CHECK'},
+            {name: '已交付', value: 'DELIVERED'},
+            {name: '售后中', value: 'AFTER_SALE'},
+            {name: '已取消', value: 'CANCELLED'},
+            {name: '已退款', value: 'REFUNDED'}
+          ]
+
+      const orderItem = orderStatusList.find(item => item.value === value)
+      return orderItem ? orderItem.name : ''
+    }
+  },
+  methods: {
+    submitOrder(params) {
+      submitOrder({
+        ...params
+      }).then((res) => {
+        // 检查是否在微信浏览器中
+        if (typeof WeixinJSBridge === 'undefined') {
+          if (document.addEventListener) {
+            document.addEventListener('WeixinJSBridgeReady', () => {
+              this.invokePayment(res);
+            }, false);
+          } else if (document.attachEvent) {
+            document.attachEvent('WeixinJSBridgeReady', () => {
+              this.invokePayment(res);
+            });
+            document.attachEvent('onWeixinJSBridgeReady', () => {
+              this.invokePayment(res);
+            });
+          }
+        } else {
+          this.invokePayment(res);
+        }
+      })
     },
-    computed: {},
-    watch: {},
-    methods: {
-        tabsChange(item){
-            console.log(item,'item');
-        },
-        getList() {
-            let params = {
-                paymentStatus:this.paymentStatus,
-                page: 1,
-                limit: 10,
+    invokePayment(rePayInfo) {
+      WeixinJSBridge.invoke(
+          'getBrandWCPayRequest',
+          {
+            appId: rePayInfo.appid,
+            timeStamp: rePayInfo.timeStamp,
+            nonceStr: rePayInfo.nonceStr,
+            package: rePayInfo.packages,
+            signType: rePayInfo.signType,
+            paySign: rePayInfo.sign
+          },
+          (res) => {
+            if (res.err_msg === 'get_brand_wcpay_request:ok') {
+              uni.navigateTo({
+                url: '/pages/order/success?orderId=' + rePayInfo.orderId
+              })
+            } else if (res.err_msg === 'get_brand_wcpay_request:cancel') {
+              uni.showToast({
+                title: '用户取消了支付'
+              })
+            } else {
+              console.error('支付失败', res.err_msg);
+              // 处理支付失败的逻辑
             }
-            orderApi(params).then(res => {
-                console.log(res);
+          }
+      );
+    },
+    tabsChange(item) {
+      this.paymentStatus = item.value
+      this.page = 1
+      setTimeout(() => {
+        this.getOrderListPage()
+      }, 200)
+    },
+    getOrderListPage() {
+      getOrderListPage({
+        paymentStatus: this.paymentStatus,
+        page: 1,
+        limit: 10,
+      }).then(res => {
+        this.arrList = res.list
+      })
+    },
+    cancelOrder(orderId) {
+      const that = this
+      uni.showModal({
+        title: '提示',
+        content: '你确定要取消订单吗?',
+        success: function (res) {
+          if (res.confirm) {
+            cancelOrder({
+              orderId: Number(orderId)
+            }).then(() => {
+              that.arrList.splice(that.arrList.findIndex(item => item.orderId === orderId), 1)
+            })
+          } else if (res.cancel) {
+            console.log('用户点击取消');
+          }
+        }
+      });
+
+    },
+    updateOrder(orderId) {
+      const that = this
+      uni.showModal({
+        title: '提示',
+        content: '你确定要取消订单吗?',
+        success: function (res) {
+          if (res.confirm) {
+            updateOrder({
+              orderId: Number(orderId),
+            }).then(() => {
+              that.arrList.splice(that.arrList.findIndex(item => item.orderId === orderId), 1)
             })
+          } else if (res.cancel) {
+            console.log('用户点击取消');
+          }
         }
+      });
     },
-    created() {
+    checkOrder(orderId) {
+      const that = this
+      uni.showModal({
+        title: '提示',
+        content: '你确定要验收该订单吗?',
+        success: function (res) {
+          if (res.confirm) {
+            checkOrder({
+              orderId: Number(orderId),
+            }).then(() => {
+              that.arrList.splice(that.arrList.findIndex(item => item.orderId === orderId), 1)
+            })
+          } else if (res.cancel) {
+            console.log('用户点击取消');
+          }
+        }
+      });
+    },
+    aftermarketOrder(orderId) {
+      const that = this
+      uni.showModal({
+        title: '提示',
+        content: '你确定要申请售后吗?',
+        success: function (res) {
+          if (res.confirm) {
+            aftermarketOrder({
+              orderId: Number(orderId)
+            }).then(() => {
+              that.arrList.splice(that.arrList.findIndex(item => item.orderId === orderId), 1)
+            })
+          } else if (res.cancel) {
+            console.log('用户点击取消');
+          }
+        }
+      });
 
     },
-    mounted() {
+    cancelAftermarketOrder(orderId) {
+      const that = this
+      uni.showModal({
+        title: '提示',
+        content: '你确定要撤销售后吗?',
+        success: function (res) {
+          if (res.confirm) {
+            cancelAftermarketOrder({
+              orderId: Number(orderId)
+            }).then(() => {
+              that.arrList.splice(that.arrList.findIndex(item => item.orderId === orderId), 1)
+            })
+          } else if (res.cancel) {
+            console.log('用户点击取消');
+          }
+        }
+      });
 
     },
+  },
+  created() {
+
+  },
+
 }
 </script>
 <style lang='scss' scoped>
 .order {
-    height: 100vh;
-    background-color: #EDEFF5;
-    display: flex;
-    flex-direction: column;
-
-    .tabs {
-        background-color: #FFF;
-        padding: 0 28rpx 12rpx;
-    }
+  height: 100vh;
+  background-color: #EDEFF5;
+  display: flex;
+  flex-direction: column;
 
-    .content{
-        flex: 1;
-        overflow: hidden;
-    }
-    .order-list {
-        padding: 24rpx;
-
-        .tab-content {
-            padding: 40rpx 36rpx;
-            width: 100%;
-            // height: 296rpx;
-            background: #FFFFFF;
-            border-radius: 24rpx;
-
-            .order-top {
-                display: flex;
-                justify-content: space-between;
-                align-items: center;
-
-                .name {
-                    font-weight: bold;
-                    font-size: 32rpx;
-                    color: #0D121A;
-                }
-
-                .status {
-                    font-size: 28rpx;
-                    color: #FF7441;
-                }
-
-                .status2 {
-                    font-size: 28rpx;
-                    color: #0D121A;
-                }
-
-                .status3 {
-                    font-size: 28rpx;
-                    color: #9EA3B1;
-                }
-            }
+  .tabs {
+    background-color: #FFF;
+    padding: 0 28rpx 12rpx;
+  }
 
-            .order-middle {
-                margin-top: 32rpx;
-                color: #0D121A;
-
-                .order-middle-left {
-                    font-weight: 400;
-                    font-size: 28rpx;
-                    color: #9EA3B1;
-                }
-
-                .order-middle-right {
-                    .right-label {
-                        font-weight: 400;
-                        margin-right: 8rpx;
-                    }
-
-                    .right-money {
-                        font-weight: 500;
-                    }
-                }
-            }
+  .content {
+    flex: 1;
+    overflow: hidden;
+  }
 
-            .order-bottom {
-                margin-top: 16rpx;
-
-                .order-bottom-left {
-                    .time-img {
-                        margin-right: 8rpx;
-                        width: 48rpx;
-                        height: 48rpx;
-                    }
-
-                    .time {
-                        color: #FF7441;
-                        font-size: 24rpx;
-                    }
-                }
-
-                .order-bottom-right {
-                    .p1 {
-                        padding: 18rpx 44rpx;
-                    }
-
-                    .p2 {
-                        padding: 16rpx 42rpx;
-                    }
-
-                    .btn {
-                        font-weight: 500;
-                        font-size: 28rpx;
-                        display: flex;
-                        justify-content: center;
-                        align-items: center;
-                        border-radius: 36rpx;
-                    }
-
-                    .btn1 {
-                        color: #0D121A;
-                        border: 3rpx solid #E2E4EB;
-                    }
-
-                    .btn2 {
-                        margin-left: 16rpx;
-                        background: #FF7441;
-                        color: #FFF;
-                    }
-                }
-            }
+  .order-list {
+    padding: 24rpx;
+
+
+    .tab-content {
+      padding: 40rpx 36rpx;
+      width: 100%;
+      // height: 296rpx;
+      background: #FFFFFF;
+      border-radius: 24rpx;
+      margin-bottom: 18rpx;
+
+      .order-top {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+
+        .name {
+          font-weight: bold;
+          font-size: 32rpx;
+          color: #0D121A;
+        }
+
+        .status {
+          font-size: 28rpx;
+          color: #FF7441;
+        }
+
+        .status2 {
+          font-size: 28rpx;
+          color: #0D121A;
+        }
+
+        .status3 {
+          font-size: 28rpx;
+          color: #9EA3B1;
+        }
+      }
+
+      .order-middle {
+        margin-top: 32rpx;
+        color: #0D121A;
+
+        .order-middle-left {
+          font-weight: 400;
+          font-size: 28rpx;
+          color: #9EA3B1;
         }
+
+        .order-middle-right {
+        }
+      }
+
+      .order-bottom {
+        margin-top: 16rpx;
+
+        .order-bottom-left {
+          .time-img {
+            margin-right: 8rpx;
+            width: 48rpx;
+            height: 48rpx;
+          }
+
+          .time {
+            color: #FF7441;
+            font-size: 24rpx;
+          }
+        }
+
+        .order-bottom-right {
+          .p1 {
+            padding: 18rpx 44rpx;
+          }
+
+          .p2 {
+            padding: 16rpx 42rpx;
+          }
+
+          .btn {
+            font-weight: 500;
+            font-size: 28rpx;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            border-radius: 36rpx;
+          }
+
+          .btn1 {
+            color: #0D121A;
+            border: 3rpx solid #E2E4EB;
+          }
+
+          .btn2 {
+            margin-left: 16rpx;
+            background: #FF7441;
+            color: #FFF;
+          }
+        }
+      }
     }
+  }
+}
+
+.progress-bar {
+  width: 260rpx;
+  background-color: #e0e0e0;
+  border-radius: 9999px;
+  overflow: hidden;
+}
+
+.progress {
+  height: 30rpx;
+  background-color: #FF7441;
+  width: 0%;
+  text-align: center;
+  line-height: 30rrpx;
+  color: white;
+  font-size: 20rpx;
+  border-radius: 9999px;
+  transition: width 0.5s ease;
+}
+.progress-container {
+  width: 40rpx; /* 可按需调整宽度 */
+  height: 20rpx; /* 可按需调整高度 */
+  background-color: #f26522; /* 橙色,类似图中颜色,可按需调整 */
+  border-radius: 20px; /* 圆角,让边角变圆润 */
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  font-size: 20rpx; /* 文字大小,可按需调整 */
+  color: white; /* 文字颜色 */
+  font-weight: bold; /* 文字加粗 */
+}
+.cancel {
+  color: #9EA3B1 !important;
 }
 </style>

+ 107 - 128
pages/order/order_confirm.vue

@@ -154,7 +154,7 @@ import {getPackageById, getConfigById, upload, save} from '@/apis/index';
 import {baseUrl} from "@/config"
 import {numMulti} from '@/utils/calculate'
 import wx from 'jweixin-module';
-import {getWxBuyConfig} from "../../apis";
+import {getWxBuyConfig, submitOrder} from "../../apis";
 
 export default {
   components: {},
@@ -203,7 +203,6 @@ export default {
     this.getPackage()
   },
   methods: {
-
     toDetail() {
       uni.navigateTo({
         url: '/pages/index/detail?type=' + this.type
@@ -355,25 +354,7 @@ export default {
 
     // 校验选择内容
     checkContents() {
-      // for (const item of this.orderContents){
-      //     if (item.scenes.length === 0) {
-      //         uni.showToast({
-      //             title: '请选择' + item.name,
-      //             icon: 'none',
-      //         });
-      //         return false
-      //     }
-      // }
-      // // this.orderContents.map(item => {
-      // //     if (item.scenes.length === 0) {
-      // //         uni.showToast({
-      // //             title: '请选择' + item.name,
-      // //             icon: 'none',
-      // //         });
-      // //         return false
-      // //     }
-      // // })
-      // return true
+
       for (const item of this.orderContents) {
         if (!item.scenes || item.scenes.length === 0) {
           uni.showToast({
@@ -399,45 +380,27 @@ export default {
       return true; // 校验成功
 
     },
-    submitOrder() {
-      getWxBuyConfig({}).then((res) => {
-        // 检查是否在微信浏览器中
-        if (typeof WeixinJSBridge === 'undefined') {
-          if (document.addEventListener) {
-            document.addEventListener('WeixinJSBridgeReady', () => {
-              this.invokePayment(res);
-            }, false);
-          } else if (document.attachEvent) {
-            document.attachEvent('WeixinJSBridgeReady', () => {
-              this.invokePayment(res);
-            });
-            document.attachEvent('onWeixinJSBridgeReady', () => {
-              this.invokePayment(res);
-            });
-          }
-        } else {
-          this.invokePayment(res);
-        }
-      })
-    },
-    invokePayment(res) {
+
+    invokePayment(rePayInfo) {
       WeixinJSBridge.invoke(
           'getBrandWCPayRequest',
           {
-            appId: res.appid,
-            timeStamp: res.timeStamp,
-            nonceStr: res.nonceStr,
-            package: res.packages,
-            signType: res.signType,
-            paySign: res.sign
+            appId: rePayInfo.appid,
+            timeStamp: rePayInfo.timeStamp,
+            nonceStr: rePayInfo.nonceStr,
+            package: rePayInfo.packages,
+            signType: rePayInfo.signType,
+            paySign: rePayInfo.sign
           },
           (res) => {
             if (res.err_msg === 'get_brand_wcpay_request:ok') {
-              console.log('支付成功');
-              // 处理支付成功的逻辑,例如跳转到订单完成页面
+              uni.navigateTo({
+                url: '/pages/order/success?orderId=' + rePayInfo.orderId
+              })
             } else if (res.err_msg === 'get_brand_wcpay_request:cancel') {
-              console.log('用户取消支付');
-              // 处理用户取消支付的逻辑
+              uni.showToast({
+                title:'用户取消了支付'
+              })
             } else {
               console.error('支付失败', res.err_msg);
               // 处理支付失败的逻辑
@@ -447,19 +410,16 @@ export default {
     },
 
     // 提交订单
-    submitOrder2() {
-
-      return
+    submitOrder() {
 
       if (!this.checkContents()) {
         return; // 如果校验失败,停止提交
       }
-      // this.checkForm()
       if (!this.checkForm()) {
         return; // 如果校验失败,停止提交
       }
       let params = {
-        packageId: this.packageId,
+        packageId: Number(this.packageId),
         quantity: this.strip,
         unitPrice: this.setData.currentPrice,
         totalAmount: this.numMultiR,
@@ -468,10 +428,29 @@ export default {
         caseFileUrls: this.fileList1.map(item => {
           return item.url
         }),
-        orderContents: JSON.stringify(this.orderContents),
+        orderContents: this.orderContents,
       }
-      save(params).then(res => {
-        console.log(res, 'res');
+
+      submitOrder({
+        ...params
+      }).then((res) => {
+        // 检查是否在微信浏览器中
+        if (typeof WeixinJSBridge === 'undefined') {
+          if (document.addEventListener) {
+            document.addEventListener('WeixinJSBridgeReady', () => {
+              this.invokePayment(res);
+            }, false);
+          } else if (document.attachEvent) {
+            document.attachEvent('WeixinJSBridgeReady', () => {
+              this.invokePayment(res);
+            });
+            document.attachEvent('onWeixinJSBridgeReady', () => {
+              this.invokePayment(res);
+            });
+          }
+        } else {
+          this.invokePayment(res);
+        }
       })
     }
 
@@ -503,51 +482,51 @@ uni-toast {
   background-position: top;
 
   .all {
-    padding: 0 24 rpx;
+    padding: 0 24rpx;
     flex: 1;
     overflow: auto;
 
     .title {
       font-weight: 500;
-      font-size: 36 rpx;
+      font-size: 36rpx;
       color: #0D121A;
-      margin: 48 rpx 0 40 rpx;
+      margin: 48rpx 0 40rpx;
       text-align: center;
     }
 
     .menu {
       width: 100%;
       background: linear-gradient(180deg, #E4F8FF 0%, #FFFFFF 100%);
-      border-radius: 24 rpx;
-      border: 2 rpx solid #FFFFFF;
-      padding: 64 rpx 48 rpx;
+      border-radius: 24rpx;
+      border: 2rpx solid #FFFFFF;
+      padding: 64rpx 48rpx;
 
       .amounts {
         .now {
-          font-size: 32 rpx;
+          font-size: 32rpx;
           color: #0D121A;
 
           .dw {
-            line-height: 40 rpx;
+            line-height: 40rpx;
           }
 
           .limit {
-            margin-left: 24 rpx;
-            width: 72 rpx;
-            height: 40 rpx;
+            margin-left: 24rpx;
+            width: 72rpx;
+            height: 40rpx;
             background: linear-gradient(144deg, #00C1FF 0%, #2FFFFC 100%);
-            border-radius: 8 rpx;
+            border-radius: 8rpx;
             font-weight: 500;
-            font-size: 24 rpx;
+            font-size: 24rpx;
             color: #0D121A;
             text-align: center;
-            line-height: 40 rpx;
+            line-height: 40rpx;
           }
         }
 
         .num {
-          font-size: 72 rpx;
-          line-height: 56 rpx;
+          font-size: 72rpx;
+          line-height: 56rpx;
           font-weight: bold;
         }
 
@@ -557,42 +536,42 @@ uni-toast {
 
         .past {
           color: #0D121A;
-          margin-top: 34 rpx;
+          margin-top: 34rpx;
 
           .past_text {
-            margin-right: 8 rpx;
+            margin-right: 8rpx;
           }
         }
       }
 
       .choose {
-        margin-top: 64 rpx;
+        margin-top: 64rpx;
 
         .choose_item-box {
-          margin-top: 16 rpx;
+          margin-top: 16rpx;
 
           image {
-            width: 48 rpx;
-            height: 48 rpx;
-            margin-right: 24 rpx;
+            width: 48rpx;
+            height: 48rpx;
+            margin-right: 24rpx;
           }
 
           text {
             color: #0D121A;
-            font-size: 28 rpx;
+            font-size: 28rpx;
           }
         }
 
         .choose_item-more {
           text {
-            font-size: 28 rpx;
+            font-size: 28rpx;
             color: #0D121A;
           }
 
           image {
-            width: 32 rpx;
-            height: 32 rpx;
-            margin-left: 12 rpx;
+            width: 32rpx;
+            height: 32rpx;
+            margin-left: 12rpx;
           }
         }
 
@@ -605,23 +584,23 @@ uni-toast {
     .choosion {
       .name {
         font-weight: 400;
-        font-size: 28 rpx;
+        font-size: 28rpx;
         color: #9EA3B1;
-        margin: 32 rpx 0 20 rpx 32 rpx;
+        margin: 32rpx 0 20rpx 32rpx;
       }
 
       .content {
         background-color: #FFFFFF;
-        border-radius: 24 rpx;
+        border-radius: 24rpx;
 
         .content_item {
-          padding: 36 rpx 32 rpx;
+          padding: 36rpx 32rpx;
 
           .item_updata {
-            width: 168 rpx;
-            height: 168 rpx;
+            width: 168rpx;
+            height: 168rpx;
             background: #F4F5F9;
-            border-radius: 16 rpx;
+            border-radius: 16rpx;
             display: flex;
             flex-direction: column;
             align-items: center;
@@ -629,52 +608,52 @@ uni-toast {
             // margin-left: 48rpx;
 
             image {
-              width: 56 rpx;
-              height: 56 rpx;
+              width: 56rpx;
+              height: 56rpx;
             }
 
             text {
               color: #9EA3B1;
               font-weight: 400;
-              font-size: 24 rpx;
+              font-size: 24rpx;
             }
           }
 
           .item_label {
             font-weight: 500;
-            font-size: 28 rpx;
+            font-size: 28rpx;
             color: #0D121A;
-            min-width: 150 rpx;
+            min-width: 150rpx;
             white-space: nowrap;
           }
 
           .item_num {
-            font-size: 28 rpx;
-            margin-left: 48 rpx;
+            font-size: 28rpx;
+            margin-left: 48rpx;
 
           }
 
           .item_text {
-            font-size: 28 rpx;
+            font-size: 28rpx;
             color: #9EA3B1;
-            margin-left: 48 rpx;
+            margin-left: 48rpx;
           }
 
           .item_name {
-            font-size: 28 rpx;
+            font-size: 28rpx;
             color: #0D121A;
-            margin-left: 16 rpx;
+            margin-left: 16rpx;
           }
 
           .more_img {
-            width: 32 rpx;
-            height: 32 rpx;
+            width: 32rpx;
+            height: 32rpx;
             flex-shrink: 0;
           }
 
           .icon_img {
-            width: 48 rpx;
-            height: 48 rpx;
+            width: 48rpx;
+            height: 48rpx;
           }
 
           input {
@@ -691,9 +670,9 @@ uni-toast {
       display: flex;
       justify-content: center;
       align-items: center;
-      font-size: 24 rpx;
+      font-size: 24rpx;
       color: #9EA3B1;
-      padding: 48 rpx 0 32 rpx;
+      padding: 48rpx 0 32rpx;
 
       .agree_text {
         color: #0D121A;
@@ -707,33 +686,33 @@ uni-toast {
     display: flex;
     justify-content: space-between;
     align-items: center;
-    padding: 16 rpx 24 rpx;
+    padding: 16rpx 24rpx;
     padding-bottom: calc(16rpx + constant(safe-area-inset-bottom)) !important;
     padding-bottom: calc(16rpx + env(safe-area-inset-bottom)) !important;
 
     .sum {
       font-weight: 400;
-      font-size: 30 rpx;
+      font-size: 30rpx;
       color: #0D121A;
 
       .money {
-        font-size: 56 rpx;
+        font-size: 56rpx;
         color: #0D121A;
       }
 
       .unit {
-        font-size: 40 rpx;
+        font-size: 40rpx;
       }
     }
 
     .btn {
-      width: 312 rpx;
-      height: 84 rpx;
+      width: 312rpx;
+      height: 84rpx;
       display: flex;
       justify-content: center;
       align-items: center;
       font-weight: bold;
-      font-size: 32 rpx;
+      font-size: 32rpx;
       color: #0D121A;
       background-size: 100% 100% !important;
 
@@ -741,12 +720,12 @@ uni-toast {
   }
 
   .pt18 {
-    padding-top: 18 rpx;
+    padding-top: 18rpx;
   }
 
   .popup_content {
-    padding: 32 rpx;
-    max-height: 1000 rpx;
+    padding: 32rpx;
+    max-height: 1000rpx;
     display: flex;
     flex-direction: column;
 
@@ -761,14 +740,14 @@ uni-toast {
   }
 
   .btns {
-    padding: 0 0 16 rpx;
+    padding: 0 0 16rpx;
     color: #0D121A;
 
     .cancel {
       width: 45%;
-      height: 84 rpx;
+      height: 84rpx;
       background: #FFFFFF;
-      border-radius: 16 rpx;
+      border-radius: 16rpx;
       display: flex;
       justify-content: center;
       align-items: center;
@@ -777,8 +756,8 @@ uni-toast {
 
     .confirm {
       width: 45%;
-      height: 84 rpx;
-      border-radius: 16 rpx;
+      height: 84rpx;
+      border-radius: 16rpx;
       display: flex;
       justify-content: center;
       align-items: center;

+ 231 - 181
pages/order/success.vue

@@ -9,88 +9,115 @@
       <view class="status_tip">套餐购买成功 请查看账单明细</view>
     </view>
     <view class="success_content">
-        <view class="success_info">
-            <view class="">
-                <view class="success_item flex jcsb aic">
-                    <view class="flex aic">
-                        <view class="label">收件地址</view>
-                        <text class="bold">123</text>
-                    </view>
-                    <view class="success_btn" @click="copyText()">复制</view>
-                  </view>
-
-                    <view class="success_item flex aic">
-                        <view class="label">收件人</view>
-                        <text>234</text>
-                    </view>
+      <view class="success_info">
+        <view class="">
+          <view class="success_item flex jcsb aic">
+            <view class="flex aic">
+              <view class="label">收件地址</view>
+              <text class="bold">{{ orderInfo.email }}</text>
             </view>
+<!--            <view class="success_btn" @click="copyText()">复制</view>-->
+          </view>
+
+          <view class="success_item flex aic">
+            <view class="label">收件人</view>
+            <text>{{ orderInfo.recipientName }}({{orderInfo.email}})</text>
+          </view>
         </view>
-        <view class="line" :style="{ background: `url(${successImg}) no-repeat` }">
-            <view class="line-circle"></view>
+      </view>
+      <view class="line" :style="{ background: `url(${successImg}) no-repeat` }">
+        <view class="line-circle"></view>
+      </view>
+      <view class="detail">
+        <view class="detail_item flex aic jcsb">
+          <text>订单金额</text>
+          <view class="datas flex">
+            <text>{{orderInfo.totalAmount}}元</text>
+          </view>
         </view>
-        <view class="detail">
-            <view class="detail_item flex aic jcsb">
-                <text>订单金额</text>
-                <view class="datas flex">
-                    <text>2500元</text>
-                </view>
-            </view>
-            <view class="detail_item flex aic jcsb">
-                <text>套餐名称</text>
-                <view class="datas flex">
-                    <text>A类套餐</text>
-                    <view class="copy">详情</view>
-                </view>
-            </view>
-            <view class="detail_item flex aic jcsb">
-                <text>套餐内容</text>
-                <view class="datas flex">
-                    <text>50条 (每条15-20s)</text>
-                </view>
-            </view>
-            <view class="detail_item flex aic jcsb">
-                <text>支付方式</text>
-                <view class="datas flex">
-                    <text>微信支付</text>
-                </view>
-            </view>
-            <view class="detail_item flex aic jcsb">
-                <text>订单编号</text>
-                <view class="datas flex">
-                    <text>12346789</text><view class="copy" @click="copyText()">复制</view>
-                </view>
-            </view>
-            <view class="detail_item flex aic jcsb">
-                <text>订单时间</text>
-                <view class="datas flex">
-                    <text>123</text>
-                </view>
-            </view>
+        <view class="detail_item flex aic jcsb">
+          <text>套餐名称</text>
+          <view class="datas flex">
+            <text>{{ orderInfo.packageName }}</text>
+            <view class="copy">详情</view>
+          </view>
         </view>
+        <view class="detail_item flex aic jcsb">
+          <text>套餐内容</text>
+          <view class="datas flex">
+            <text>{{orderInfo.quantity}}条 (每条15-20s)</text>
+          </view>
+        </view>
+        <view class="detail_item flex aic jcsb">
+          <text>支付方式</text>
+          <view class="datas flex">
+            <text>微信支付</text>
+          </view>
+        </view>
+        <view class="detail_item flex aic jcsb">
+          <text>订单编号</text>
+          <view class="datas flex">
+            <text>{{ orderInfo.orderNumber }}</text>
+            <view class="copy" @click="copyText()">复制</view>
+          </view>
+        </view>
+        <view class="detail_item flex aic jcsb">
+          <text>订单时间</text>
+          <view class="datas flex">
+            <text>{{orderInfo.createDate}}</text>
+          </view>
+        </view>
+      </view>
     </view>
     <view class="btns">
       <view class="bind" @click="bindCard">查看详情</view>
-      <view class="back" @click="toHome">返回首页</view>
+      <view class="back" @click="goHome">返回首页</view>
     </view>
   </view>
 </template>
 
 <script>
-import { copy } from "@/utils/utils";
+import {copy} from "@/utils/utils";
+import {getOrderDetail} from "../../apis/order";
+import {goHome} from "../../utils/utils";
+
+
 export default {
   components: {},
-    data() {
-      return {
-        bgImg: "https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/bg_top%403x.png",
-        payImg: "https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/ic_paysuccess.png",
-        successImg: 'https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/img_quekou.png'
-      };
-    },
-  computed: {},
+  data() {
+    return {
+      orderId: '',
+      orderInfo: {
+        packageName:"",
+        createDate:"",
+        orderNumber:'',
+        shootingRequirements:'',
+        email:'',
+      },
+      bgImg: "https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/bg_top%403x.png",
+      payImg: "https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/ic_paysuccess.png",
+      successImg: 'https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/img_quekou.png'
+    };
+  },
+  onLoad(options) {
+    if (options.orderId) this.orderId = options.orderId
+    this.getData()
+  },
+  computed: {
+
+  },
   watch: {},
   methods: {
+    getData() {
+      getOrderDetail({orderId: this.orderId}).then(res => {
+        this.orderInfo = res
+      })
+    },
+    goHome(){
+      goHome()
+    },
     // 复制
-    copyText(num){
+    copyText(num) {
       copy(num)
     }
   },
@@ -103,148 +130,171 @@ export default {
 }
 </script>
 <style lang='scss' scoped>
-.success{
-    width: 100%;
-    position: absolute;
-    top: 0;
-    bottom: 0;
-    display: flex;
-    flex-direction: column;
-    background-size: contain !important;
-    background-repeat: no-repeat !important;
-    background-position: top;
-    padding: 0 24rpx;
-  .success_status{
+.success {
+  width: 100%;
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  display: flex;
+  flex-direction: column;
+  background-size: contain !important;
+  background-repeat: no-repeat !important;
+  background-position: top;
+  padding: 0 24rpx;
+
+  .success_status {
     margin-top: 64rpx;
     display: flex;
     flex-direction: column;
     align-items: center;
-    .pay_img{
+
+    .pay_img {
       width: 48rpx;
       height: 48rpx;
       margin-left: 16rpx;
     }
-    .status_text{
+
+    .status_text {
       font-weight: 500;
       font-size: 40rpx;
       color: #0D121A;
     }
-    .status_tip{
+
+    .status_tip {
       font-weight: 400;
       font-size: 28rpx;
       color: #9EA3B1;
       margin-top: 20rpx;
     }
   }
-  .success_content{
-        border-radius: 32rpx;
-        overflow: hidden;
-        margin-top: 64rpx;
-        .success_info{
-            background-color: #fff;
-            padding: 36rpx 32rpx 8rpx;
-            .success_item{
-                margin-bottom: 20rpx;
-                .label{
-                    min-width: 120rpx;
-                    font-weight: 400;
-                    font-size: 28rpx;
-                    color: #9EA3B1;
-                    margin-right: 16rpx;
-                }
-                text{
-                    font-size: 32rpx;
-                    color: #0D121A;
-                }
-
-            }
-            
+
+  .success_content {
+    border-radius: 32rpx;
+    overflow: hidden;
+    margin-top: 64rpx;
+
+    .success_info {
+      background-color: #fff;
+      padding: 36rpx 32rpx 8rpx;
+
+      .success_item {
+        margin-bottom: 20rpx;
+
+        .label {
+          min-width: 120rpx;
+          font-weight: 400;
+          font-size: 28rpx;
+          color: #9EA3B1;
+          margin-right: 16rpx;
         }
-        .success_btn{
-          width: 80rpx;
-          height: 40rpx;
-          font-weight: 500;
-          background: #F4F5F9;
-          border-radius: 48rpx;
-          font-size: 24rpx;
+
+        text {
+          font-size: 32rpx;
           color: #0D121A;
-          text-align: center;
-          line-height: 40rpx;
-        }
-        .line{
-            width: 100%;
-            height: 40rpx;
-            background-size: cover !important;
-            padding: 0 32rpx;
-            display: flex;
-            justify-content: center;
-            align-items: center;
-            .line-circle{
-                width: 100%;
-                border: 2rpx dashed #EDEDED;
-                height: 2rpx;
-            }
-        }
-        .detail{
-            background-color: #fff;
-            padding: 32rpx 32rpx 40rpx;
-            .detail_item {
-                margin-bottom: 36rpx;
-                text{
-                    white-space: nowrap;
-                    font-weight: 400;
-                    font-size: 28rpx;
-                    color: #0D121A;
-                }
-                .datas{
-                    .copy{
-                        width: 80rpx;
-                        height: 40rpx;
-                        background: #F4F5F9;
-                        border-radius: 48rpx;
-                        font-weight: 500;
-                        font-size: 24rpx;
-                        color: #061714;
-                        text-align: center;
-                        line-height: 40rpx;
-                        margin-left: 16rpx;
-                    }
-                }
-            }
-            .detail_item:nth-last-child(1){
-                margin-bottom: 0;
-            }
-        }
-        .success_title{
-            color: #9DA3A2;
         }
+
+      }
+
     }
-    .btns{
-        padding: 96rpx 32rpx;
-        view{
-            width: 100%;
-            height: 84rpx;
-            // border-radius: 48rpx;
-            display: flex;
-            justify-content: center;
-            align-items: center;
-            font-size: 32rpx;
-        }
-        .bind{
-            color: #061714;
-            margin-bottom: 32rpx;
-            font-weight: 500rpx;
-            background: linear-gradient( 140deg, #246AF1 0%, #2F98EF 100%);
+
+    .success_btn {
+      width: 80rpx;
+      height: 40rpx;
+      font-weight: 500;
+      background: #F4F5F9;
+      border-radius: 48rpx;
+      font-size: 24rpx;
+      color: #0D121A;
+      text-align: center;
+      line-height: 40rpx;
+    }
+
+    .line {
+      width: 100%;
+      height: 40rpx;
+      background-size: cover !important;
+      padding: 0 32rpx;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+
+      .line-circle {
+        width: 100%;
+        border: 2rpx dashed #EDEDED;
+        height: 2rpx;
+      }
+    }
+
+    .detail {
+      background-color: #fff;
+      padding: 32rpx 32rpx 40rpx;
+
+      .detail_item {
+        margin-bottom: 36rpx;
+
+        text {
+          white-space: nowrap;
+          font-weight: 400;
+          font-size: 28rpx;
+          color: #0D121A;
         }
-        .back{
-            font-weight: bold;
-            background: #FFFFFF;
-            // border: 4rpx solid #E7EAEA;
+
+        .datas {
+          .copy {
+            width: 80rpx;
+            height: 40rpx;
+            background: #F4F5F9;
+            border-radius: 48rpx;
+            font-weight: 500;
+            font-size: 24rpx;
             color: #061714;
+            text-align: center;
+            line-height: 40rpx;
+            margin-left: 16rpx;
+          }
         }
+      }
+
+      .detail_item:nth-last-child(1) {
+        margin-bottom: 0;
+      }
     }
-    .ml16{
-      margin-left: 16rpx;
+
+    .success_title {
+      color: #9DA3A2;
     }
+  }
+
+  .btns {
+    padding: 96rpx 32rpx;
+
+    view {
+      width: 100%;
+      height: 84rpx;
+      // border-radius: 48rpx;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      font-size: 32rpx;
+    }
+
+    .bind {
+      color: #061714;
+      margin-bottom: 32rpx;
+      font-weight: 500rpx;
+      background: linear-gradient(140deg, #246AF1 0%, #2F98EF 100%);
+    }
+
+    .back {
+      font-weight: bold;
+      background: #FFFFFF;
+      // border: 4rpx solid #E7EAEA;
+      color: #061714;
+    }
+  }
+
+  .ml16 {
+    margin-left: 16rpx;
+  }
 }
 </style>

+ 59 - 62
pages/user/index.vue

@@ -6,7 +6,7 @@
     </view>
     <view class="news">
       <image :src="avatar"></image>
-      <view v-if="userInfo" class="phone">{{ userInfo.realName }}</view>
+      <view v-if="realName" class="phone">{{ realName }}</view>
       <view v-else class="phone" @click="toLogin()">点击登录</view>
     </view>
     <view class="content">
@@ -53,7 +53,7 @@ export default {
   components: {},
   data() {
     return {
-      userInfo: uni.getStorageSync('userInfo'),
+      realName: uni.getStorageSync('realName'),
       token: uni.getStorageSync('token'),
       bgImg: "https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/bg_top%403x.png",
       logoImg: "https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/img_logo%403x.png",
@@ -88,15 +88,12 @@ export default {
   computed: {},
   watch: {},
   onLoad() {
-    this.changeTabbar()
+
   },
   onShow() {
-
+    this.changeTabbar()
   },
   methods: {
-    toLogin(){
-
-    },
     changeTabbar() {
       uni.setTabBarStyle({
         color: '#9EA3B1',
@@ -106,15 +103,15 @@ export default {
     },
     toOrder(item) {
       this.$router.push({
-        path: '/pages/order/index?status=' + item.value
+        path: '/pages/order/index'
       })
     },
     outLogin() {
       logout().then(res => {
         uni.removeStorageSync('token')
-        uni.removeStorageSync('userInfo')
-        this.name = ''
-        this.token = ''
+        this.$router.push({
+          path: '/pages/index/index'
+        })
       })
     }
   },
@@ -140,42 +137,42 @@ export default {
   background-position: top;
 
   .title {
-    padding: 16 rpx 32 rpx;
+    padding: 16rpx 32rpx;
 
     image {
-      height: 56 rpx;
+      height: 56rpx;
     }
   }
 
   .news {
-    padding: 64 rpx 48 rpx 0;
+    padding: 64rpx 48rpx 0;
     display: flex;
     align-items: center;
 
     image {
-      width: 104 rpx;
-      height: 104 rpx;
+      width: 104rpx;
+      height: 104rpx;
       background-color: aqua;
       border-radius: 50%;
     }
 
     .phone {
       font-weight: bold;
-      font-size: 44 rpx;
+      font-size: 44rpx;
       color: #0D121A;
-      margin-left: 32 rpx;
+      margin-left: 32rpx;
     }
   }
 
   .content {
-    padding: 0 24 rpx;
-    margin-top: 40 rpx;
+    padding: 0 24rpx;
+    margin-top: 40rpx;
     box-sizing: content-box;
   }
 
   .more {
-    width: 32 rpx;
-    height: 32 rpx;
+    width: 32rpx;
+    height: 32rpx;
   }
 
   .order-wrap {
@@ -186,11 +183,11 @@ export default {
 
     .unpay {
       // box-sizing: border-box;
-      width: 638 rpx;
+      width: 638rpx;
       background: #FFEEE2;
-      border-radius: 24 rpx 24 rpx 0 rpx 0 rpx;
-      border: 2 rpx solid #FFFEFD;
-      padding: 16 rpx 18 rpx 16 rpx 16 rpx;
+      border-radius: 24rpx 24rpx 0rpx 0rpx;
+      border: 2rpx solid #FFFEFD;
+      padding: 16rpx 18rpx 16rpx 16rpx;
       display: flex;
       justify-content: space-between;
       align-items: center;
@@ -200,14 +197,14 @@ export default {
         align-items: center;
 
         image {
-          width: 48 rpx;
-          height: 48 rpx;
+          width: 48rpx;
+          height: 48rpx;
         }
 
         .tip {
-          font-size: 24 rpx;
+          font-size: 24rpx;
           color: #FF7441;
-          margin-left: 14 rpx;
+          margin-left: 14rpx;
 
           text {
             font-weight: bold;
@@ -216,26 +213,26 @@ export default {
       }
 
       .right {
-        width: 120 rpx;
-        height: 44 rpx;
+        width: 120rpx;
+        height: 44rpx;
         font-weight: 500;
         background: #FF7441;
-        border-radius: 24 rpx;
-        font-size: 24 rpx;
+        border-radius: 24rpx;
+        font-size: 24rpx;
         color: #FFFFFF;
         text-align: center;
-        line-height: 44 rpx;
+        line-height: 44rpx;
       }
     }
 
     .order {
-      padding: 32 rpx 32 rpx 40 rpx;
+      padding: 32rpx 32rpx 40rpx;
       width: 100%;
       box-sizing: border-box;
-      height: 260 rpx;
+      height: 260rpx;
       background: linear-gradient(180deg, #DEF5FD 0%, #FFFFFF 100%);
-      border-radius: 32 rpx;
-      border: 2 rpx solid #FFFFFF;
+      border-radius: 32rpx;
+      border: 2rpx solid #FFFFFF;
 
       .order_top {
         display: flex;
@@ -244,19 +241,19 @@ export default {
 
         .mytt {
           font-weight: 500;
-          font-size: 32 rpx;
+          font-size: 32rpx;
           color: #0D121A;
         }
 
         .myall {
           font-weight: 400;
-          font-size: 26 rpx;
+          font-size: 26rpx;
           color: #0D121A;
           display: flex;
           align-items: center;
 
           .all {
-            margin-right: 8 rpx;
+            margin-right: 8rpx;
 
           }
         }
@@ -266,23 +263,23 @@ export default {
         display: flex;
         justify-content: space-between;
         align-items: center;
-        margin-top: 48 rpx;
+        margin-top: 48rpx;
 
         .order-box-item {
           display: flex;
           flex-direction: column;
           align-items: center;
-          width: 128 rpx;
+          width: 128rpx;
 
           image {
-            width: 64 rpx;
-            height: 64 rpx;
+            width: 64rpx;
+            height: 64rpx;
           }
 
           .name {
-            font-size: 24 rpx;
+            font-size: 24rpx;
             color: #0D121A;
-            margin-top: 16 rpx;
+            margin-top: 16rpx;
           }
         }
       }
@@ -291,37 +288,37 @@ export default {
 
   .cantact {
     width: 100%;
-    height: 112 rpx;
+    height: 112rpx;
     background: #FFFFFF;
-    border-radius: 24 rpx;
+    border-radius: 24rpx;
     display: flex;
     justify-content: space-between;
     align-items: center;
-    padding: 24 rpx 32 rpx;
-    margin-top: 24 rpx;
+    padding: 24rpx 32rpx;
+    margin-top: 24rpx;
 
     .canl {
       display: flex;
       align-items: center;
 
       image {
-        margin-right: 24 rpx;
-        width: 64 rpx;
-        height: 64 rpx;
+        margin-right: 24rpx;
+        width: 64rpx;
+        height: 64rpx;
       }
     }
   }
 
   .outline {
-    width: 622 rpx;
-    height: 96 rpx;
-    border-radius: 36 rpx;
-    border: 4 rpx solid #E2E4EB;
-    font-size: 28 rpx;
+    width: 622rpx;
+    height: 96rpx;
+    border-radius: 36rpx;
+    border: 4rpx solid #E2E4EB;
+    font-size: 28rpx;
     color: #0D121A;
     text-align: center;
-    line-height: 96 rpx;
-    margin: 48 rpx auto;
+    line-height: 96rpx;
+    margin: 48rpx auto;
   }
 }
 </style>

+ 140 - 120
request/index.js

@@ -1,134 +1,154 @@
 import {
-	baseUrl
+    baseUrl
 } from "@/config"
-
 import {
-	wipeNulish
+    wipeNulish
 } from '@/utils/utils.js'
 
+import {getWxUserInfo} from "../utils/wxAuth";
+
 function requestHandle(obj) {
-	const reqData = wipeNulish(obj.data) || {}
-	const token = uni.getStorageSync('token') || ''
+    const reqData = wipeNulish(obj.data) || {}
+    const token = uni.getStorageSync('token') || 'no-login'
+
+    let base = baseUrl
+    const BASE_URL = obj.url.indexOf("http") > -1 || obj.url.indexOf("https://") > -1 ? obj.url : base + obj.url;
+    return new Promise((resolve, reject) => {
+        uni.request({
+            method: obj.method,
+            url: BASE_URL,
+            data: reqData,
+            header: {
+                token,
+            },
+            dataType: "json"
+        }).then(response => {
+            const {
+                data: {
+                    data,
+                    code,
+                    msg
+                }
+            } = response || {}
+            if (code === 10021) {
+                getWxUserInfo()
+                return
+            }
+            if (code === 0) {
+                if (msg) {
+                    uni.showToast({
+                        title: msg,
+                        icon: 'success'
+                    })
+                }
 
-	let base = baseUrl
-	const BASE_URL = obj.url.indexOf("http") > -1 || obj.url.indexOf("https://") > -1 ? obj.url : base + obj.url;
-	return new Promise((resolve, reject) => {
-		uni.request({
-			method: obj.method,
-			url: BASE_URL,
-			data: reqData,
-			header: {
-				token,
-			},
-			dataType: "json"
-		}).then(response => {
-			const { data: {
-					data,
-					code,
-					msg
-				}
-			} = response || {}
-			if (code !== 0) {
-				uni.showToast({
-					title: msg || '服务器开小差',
-					icon: 'none'
-				})
-			} else {
+            } else {
 
-				resolve(data)
-			}
-		}).catch(error => {
-			/**获取网络状态 */
-			uni.getNetworkType({
-				success: function(res) {
-					if (res.networkType === 'none') {
-						uni.showToast({
-							title: '网络未连接,请检查网络状态',
-							mask: false,
-							icon: 'none'
-						})
-					} else {
-						uni.showToast({
-							title: '网络连接超时',
-							icon: 'none'
-						})
-					}
-				}
-			})
-			reject(error)
-		})
-	})
+                resolve(data)
+            }
+
+            if (code !== 0) {
+                uni.showToast({
+                    title: msg || '服务器开小差',
+                    icon: 'none'
+                })
+            } else {
+
+                resolve(data)
+            }
+        }).catch(error => {
+            /**获取网络状态 */
+            uni.getNetworkType({
+                success: function (res) {
+                    if (res.networkType === 'none') {
+                        uni.showToast({
+                            title: '网络未连接,请检查网络状态',
+                            mask: false,
+                            icon: 'none'
+                        })
+                    } else {
+                        uni.showToast({
+                            title: '网络连接超时',
+                            icon: 'none'
+                        })
+                    }
+                }
+            })
+            reject(error)
+        })
+    })
 }
+
 // customRes 用于自定义反参状态处理,凡是未加此参数 都当作反参code是0处理
 const request = {
-	get: (obj) => {
-		return new Promise((resolve, reject) => {
-			requestHandle({
-					method: 'GET',
-					url: obj.url,
-					data: obj.data,
-					header: obj.header,
-					customRes: obj.customRes
-				})
-				.then((res) => {
-					resolve(res)
-				})
-				.catch((err) => {
-					reject(err)
-				})
-		});
-	},
-	post: (obj) => {
-		return new Promise((resolve, reject) => {
-			requestHandle({
-					method: 'POST',
-					url: obj.url,
-					data: obj.data,
-					header: obj.header,
-					customRes: obj.customRes
-				})
-				.then((res) => {
-					resolve(res)
-				})
-				.catch((err) => {
-					reject(err)
-				})
-		})
-	},
-	put: (obj) => {
-		return new Promise((resolve, reject) => {
-			requestHandle({
-					method: 'PUT',
-					url: obj.url,
-					data: obj.data,
-					header: obj.header,
-					customRes: obj.customRes
-				})
-				.then((res) => {
-					resolve(res)
-				})
-				.catch((err) => {
-					reject(err)
-				})
-		})
-	},
-	del: (obj) => {
-		return new Promise((resolve, reject) => {
-			requestHandle({
-					method: 'DELETE',
-					url: obj.url,
-					data: obj.data,
-					header: obj.header,
-					customRes: obj.customRes
-				})
-				.then((res) => {
-					resolve(res)
-				})
-				.catch((err) => {
-					reject(err)
-				})
-		})
-	}
+    get: (obj) => {
+        return new Promise((resolve, reject) => {
+            requestHandle({
+                method: 'GET',
+                url: obj.url,
+                data: obj.data,
+                header: obj.header,
+                customRes: obj.customRes
+            })
+                .then((res) => {
+                    resolve(res)
+                })
+                .catch((err) => {
+                    reject(err)
+                })
+        });
+    },
+    post: (obj) => {
+        return new Promise((resolve, reject) => {
+            requestHandle({
+                method: 'POST',
+                url: obj.url,
+                data: obj.data,
+                header: obj.header,
+                customRes: obj.customRes
+            })
+                .then((res) => {
+                    resolve(res)
+                })
+                .catch((err) => {
+                    reject(err)
+                })
+        })
+    },
+    put: (obj) => {
+        return new Promise((resolve, reject) => {
+            requestHandle({
+                method: 'PUT',
+                url: obj.url,
+                data: obj.data,
+                header: obj.header,
+                customRes: obj.customRes
+            })
+                .then((res) => {
+                    resolve(res)
+                })
+                .catch((err) => {
+                    reject(err)
+                })
+        })
+    },
+    del: (obj) => {
+        return new Promise((resolve, reject) => {
+            requestHandle({
+                method: 'DELETE',
+                url: obj.url,
+                data: obj.data,
+                header: obj.header,
+                customRes: obj.customRes
+            })
+                .then((res) => {
+                    resolve(res)
+                })
+                .catch((err) => {
+                    reject(err)
+                })
+        })
+    }
 }
 
 export default request

+ 307 - 225
uni.scss

@@ -24,32 +24,32 @@ $uni-color-warning: #f0ad4e;
 $uni-color-error: #dd524d;
 
 /* 文字基本颜色 */
-$uni-text-color:#333;//基本色
-$uni-text-color-inverse:#fff;//反色
-$uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
+$uni-text-color: #333; //基本色
+$uni-text-color-inverse: #fff; //反色
+$uni-text-color-grey: #999; //辅助灰色,如加载更多的提示信息
 $uni-text-color-placeholder: #808080;
-$uni-text-color-disable:#c0c0c0;
+$uni-text-color-disable: #c0c0c0;
 
 /* 背景颜色 */
-$uni-bg-color:#ffffff;
-$uni-bg-color-grey:#f8f8f8;
-$uni-bg-color-hover:#f1f1f1;//点击状态颜色
-$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
+$uni-bg-color: #ffffff;
+$uni-bg-color-grey: #f8f8f8;
+$uni-bg-color-hover: #f1f1f1; //点击状态颜色
+$uni-bg-color-mask: rgba(0, 0, 0, 0.4); //遮罩颜色
 
 /* 边框颜色 */
-$uni-border-color:#c8c7cc;
+$uni-border-color: #c8c7cc;
 
 /* 尺寸变量 */
 
 /* 文字尺寸 */
-$uni-font-size-sm:12px;
-$uni-font-size-base:14px;
-$uni-font-size-lg:16px;
+$uni-font-size-sm: 12px;
+$uni-font-size-base: 14px;
+$uni-font-size-lg: 16px;
 
 /* 图片尺寸 */
-$uni-img-size-sm:20px;
-$uni-img-size-base:26px;
-$uni-img-size-lg:40px;
+$uni-img-size-sm: 20px;
+$uni-img-size-base: 26px;
+$uni-img-size-lg: 40px;
 
 /* Border Radius */
 $uni-border-radius-sm: 2px;
@@ -72,227 +72,309 @@ $uni-opacity-disabled: 0.3; // 组件禁用态的透明度
 
 /* 文章场景相关 */
 $uni-color-title: #2C405A; // 文章标题颜色
-$uni-font-size-title:20px;
+$uni-font-size-title: 20px;
 $uni-color-subtitle: #555555; // 二级标题颜色
-$uni-font-size-subtitle:26px;
+$uni-font-size-subtitle: 26px;
 $uni-color-paragraph: #3F536E; // 文章段落颜色
-$uni-font-size-paragraph:15px;
+$uni-font-size-paragraph: 15px;
 
 
-$bg-color-main:#F5F5F5;
+$bg-color-main: #F5F5F5;
 
 /* 行为相关颜色 */
 $color-main: #1780E2;
 $color-status: #D6EFFF;
 $color-text-m: #152129;
 $color-text-s: #EAEAEB;
-$color-text-g:#707476;
+$color-text-g: #707476;
 $color-orange: #FF6234;
 
 
 .top-0 {
-    top: 0;
-  }
-  
-  .left-0 {
-    left: 0;
-  }
-  
-  .right-0 {
-    right: 0;
-  }
-  
-  .bottom-0 {
-    bottom: 0;
-  }
-  
-  .text-center {
-    text-align: center;
-  }
-  
-  .flex {
-    display: flex;
-  }
-  
-  .fdc {
-      flex-direction: column;
-  }
-  
-  .jcc {
-    justify-content: center;
-  }
-  
-  .jcfe{
-      justify-content: flex-end;
-  }
-  
-  .jce{
-      justify-content: end;
-  }
-  
-  .aic {
-    align-items: center;
-  }
-  
-  .aifs{
-      align-items: flex-start;
-  }
-  
-  .jcsb {
-    justify-content: space-between;
-  }
-  
-  .aife {
-    align-items: flex-end;
-  }
-  
-  .flex-wrap {
-    flex-wrap: wrap;
-  }
-  
-  .flex-nowrap {
-    flex-wrap: nowrap;
-  }
-  
-  .hidden {
-    overflow: hidden;
-  }
-  
-  .width100 {
-    width: 100%;
-  }
-  
-  .height100 {
-    height: 100%;
-  }
-  
-  .bold {
-    font-weight: bold;
-  }
-  
-  .position-r {
-    position: relative;
-  }
-  
-  .position-a {
-    position: absolute;
-  }
-  
-  .position-f {
-    position: fixed;
-  }
-  
-  .position-s {
-    position: sticky;
-  }
-  
-  .ellipsis {
-    text-overflow: ellipsis;
-    overflow: hidden;
-    white-space: nowrap;
-  }
-  
-  .ellipsis-1{
-      overflow: hidden;
-      word-break: break-all;
-      text-overflow: ellipsis;
-      display: -webkit-box;
-      -webkit-line-clamp: 1;
-      -webkit-box-orient: vertical;
-      -webkit-box-pack: center;//设置高度后只有一行时上下居中
-  }
-  
-  .ellipsis-2{
-      overflow: hidden;
-      word-break: break-all;
-      text-overflow: ellipsis;
-      display: -webkit-box;
-      -webkit-line-clamp: 2;
-      -webkit-box-orient: vertical;
-      -webkit-box-pack: center;//设置高度后只有一行时上下居中
-  }
-  .ellipsis-3{
-      overflow: hidden;
-      word-break: break-all;
-      text-overflow: ellipsis;
-      display: -webkit-box;
-      -webkit-line-clamp: 3;
-      -webkit-box-orient: vertical;
-      -webkit-box-pack: center;//设置高度后只有一行时上下居中
-  }
-  
-  .ellipsis1-2{
-      /* 允许单词内换行 */
-        word-break: break-all!important;
-        overflow: hidden!important;
-        text-overflow: ellipsis!important;
-        /* 开启盒子的弹性布局 */
-        display: -webkit-box!important;
-        /* 控制第几行出现省略号 */
-        -webkit-line-clamp: 2!important;
-        /* 设置子元素从上向下垂直排列 */
-        -webkit-box-orient: vertical!important;
-  }
-  .ellipsis1-1{
-        word-break: break-all!important;
-        overflow: hidden!important;
-        text-overflow: ellipsis!important;
-        display: -webkit-box!important;
-        -webkit-line-clamp: 1!important;
-        -webkit-box-orient: vertical!important;
-  }
-  
-  .bgf{
-      background: #fff;
-  }
-  
-  .bgf5{
-      background: #f5f5f5;
-  }
-  
-  .br16{
-      border-radius: 16rpx;
-  }
-  .br20{
-      border-radius: 20rpx;
-  }
-  
-  .mt20{
-      margin-top: 20rpx;
-  }
-  
-  .mb20{
-      margin-bottom: 20rpx;
-  }
-  .mb30{
-      margin-bottom: 30rpx;
-  }
-  
-  .fs24{
-      font-size: 24rpx;
-  }
-  
-  .fs28{
-      font-size: 28rpx;
-  }
-  .fs32{
-      font-size: 32rpx;
-  }
-  .fs36{
-      font-size: 36rpx;
-  }
-  .fs40{
-      font-size: 40rpx;
-  }
-
-  .fw400{
-      font-weight: 400;
-  }
-
-  .fw500{
-      font-weight: 500;
-  }
-
-  .w100{
-    width: 100%;
-  }
+  top: 0;
+}
+
+.left-0 {
+  left: 0;
+}
+
+.right-0 {
+  right: 0;
+}
+
+.bottom-0 {
+  bottom: 0;
+}
+
+.text-center {
+  text-align: center;
+}
+
+.flex {
+  display: flex;
+}
+
+.fdc {
+  flex-direction: column;
+}
+
+.jcc {
+  justify-content: center;
+}
+
+.jcfe {
+  justify-content: flex-end;
+}
+
+.jce {
+  justify-content: end;
+}
+
+.aic {
+  align-items: center;
+}
+
+.aifs {
+  align-items: flex-start;
+}
+
+.jcsb {
+  justify-content: space-between;
+}
+
+
+.aife {
+  align-items: flex-end;
+}
+
+.flex-wrap {
+  flex-wrap: wrap;
+}
+
+.flex-nowrap {
+  flex-wrap: nowrap;
+}
+
+.hidden {
+  overflow: hidden;
+}
+
+.width100 {
+  width: 100%;
+}
+
+.height100 {
+  height: 100%;
+}
+
+.bold {
+  font-weight: bold;
+}
+
+.position-r {
+  position: relative;
+}
+
+.position-a {
+  position: absolute;
+}
+
+.position-f {
+  position: fixed;
+}
+
+.position-s {
+  position: sticky;
+}
+
+.ellipsis {
+  text-overflow: ellipsis;
+  overflow: hidden;
+  white-space: nowrap;
+}
+
+.ellipsis-1 {
+  overflow: hidden;
+  word-break: break-all;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 1;
+  -webkit-box-orient: vertical;
+  -webkit-box-pack: center; //设置高度后只有一行时上下居中
+}
+
+.ellipsis-2 {
+  overflow: hidden;
+  word-break: break-all;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 2;
+  -webkit-box-orient: vertical;
+  -webkit-box-pack: center; //设置高度后只有一行时上下居中
+}
+
+.ellipsis-3 {
+  overflow: hidden;
+  word-break: break-all;
+  text-overflow: ellipsis;
+  display: -webkit-box;
+  -webkit-line-clamp: 3;
+  -webkit-box-orient: vertical;
+  -webkit-box-pack: center; //设置高度后只有一行时上下居中
+}
+
+.ellipsis1-2 {
+  /* 允许单词内换行 */
+  word-break: break-all !important;
+  overflow: hidden !important;
+  text-overflow: ellipsis !important;
+  /* 开启盒子的弹性布局 */
+  display: -webkit-box !important;
+  /* 控制第几行出现省略号 */
+  -webkit-line-clamp: 2 !important;
+  /* 设置子元素从上向下垂直排列 */
+  -webkit-box-orient: vertical !important;
+}
+
+.ellipsis1-1 {
+  word-break: break-all !important;
+  overflow: hidden !important;
+  text-overflow: ellipsis !important;
+  display: -webkit-box !important;
+  -webkit-line-clamp: 1 !important;
+  -webkit-box-orient: vertical !important;
+}
+
+.bgf {
+  background: #fff;
+}
+
+.bgf5 {
+  background: #f5f5f5;
+}
+
+.br16 {
+  border-radius: 16rpx;
+}
+
+.br20 {
+  border-radius: 20rpx;
+}
+
+.mt20 {
+  margin-top: 20rpx;
+}
+
+.mb20 {
+  margin-bottom: 20rpx;
+}
+
+.mb30 {
+  margin-bottom: 30rpx;
+}
+
+.fs24 {
+  font-size: 24rpx;
+}
+
+.fs28 {
+  font-size: 28rpx;
+}
+
+.fs32 {
+  font-size: 32rpx;
+}
+
+.fs36 {
+  font-size: 36rpx;
+}
+
+.fs40 {
+  font-size: 40rpx;
+}
+
+.fw400 {
+  font-weight: 400;
+}
+
+.fw500 {
+  font-weight: 500;
+}
+
+.w100 {
+  width: 100%;
+}
+
+.flex {
+  display: flex;
+}
+
+.flex1 {
+  flex: 1;
+  height: 100%;
+}
+
+.row-start {
+  display: flex;
+  flex-wrap: wrap;
+  justify-content: flex-start;
+  align-items: center;
+}
+
+.flex-start {
+  display: flex;
+  flex-wrap: wrap;
+  justify-content: flex-start;
+  align-items: center;
+}
+
+.flex-center {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.flex-right {
+  display: flex;
+  align-items: center;
+  justify-content: flex-end;
+}
+
+.flex-between {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.flex-between-no-center {
+  display: flex;
+  justify-content: space-between;
+  align-items: baseline;
+}
+
+.flex-around {
+  display: flex;
+  align-items: center;
+  flex-wrap: wrap;
+  justify-content: space-around;
+}
+
+.flex-column {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+}
+
+.fw {
+  font-weight: 600
+}
+.ml-12{
+  margin-left: 24rpx;
+}
+.ml-6{
+  margin-left: 12rpx;
+}
+ .mt-4{
+   margin-top: 8rpx;
+ }

+ 45 - 0
utils/filter.js

@@ -0,0 +1,45 @@
+// 定义全局过滤器
+
+const filters={
+    // orderStatus:function (value){
+    //     const orderStatusList = [
+    //         {
+    //             name: '待付款',
+    //             value: 0
+    //         }, {
+    //             name: '待接单',
+    //             value: 1
+    //         },
+    //         {
+    //             name: '拍摄中',
+    //             value: 2
+    //         },
+    //         {
+    //             name: '待验收',
+    //             value: 3
+    //         },
+    //         {
+    //             name: '已交付',
+    //             value: 4
+    //         },
+    //         {
+    //             name: '售后中',
+    //             value: 5
+    //         },
+    //         {
+    //             name: '已取消',
+    //             value: 6
+    //         },
+    //         {
+    //             name: '已退款',
+    //             value: 7
+    //         }
+    //     ]
+    //
+    //     const orderItem = orderStatusList.find(item => item.value === value)
+    //
+    //     return orderItem? orderItem.name: ''
+    // }
+}
+export default filters
+

+ 18 - 1
utils/preCheck.js

@@ -1 +1,18 @@
-import platform from '@/utils/platform.js'
+// import platform from './platform.js'
+// import {getWxUserInfo} from "./wxAuth";
+// if (platform() === 'H5') {
+//     const getWxQuery = (name) => {
+//         const url = window.location.href;
+//         const reg = /code=([^&]*)/;
+//         const arr = url.match(reg);
+//         return arr ? arr[1] : null;
+//     }
+//     const code = getWxQuery('code')
+//     console.log('code',code)
+//     if(!code){
+//         if (!uni.getStorageSync('token')) {
+//             console.log('preCheck-login')
+//             getWxUserInfo()
+//         }
+//     }
+// }

+ 236 - 230
utils/utils.js

@@ -7,42 +7,48 @@ import clone from './clone.js'
  * @param immediate true 表立即执行,false 表非立即执行
  */
 export let debounce = (func, wait, immediate) => {
-	let timeout;
-	return function() {
-		let context = this;
-		let args = arguments;
+    let timeout;
+    return function () {
+        let context = this;
+        let args = arguments;
 
-		if (timeout) clearTimeout(timeout);
-		if (immediate) {
-			let callNow = !timeout;
-			timeout = setTimeout(() => {
-				timeout = null;
-			}, wait);
-			if (callNow) func.apply(context, args);
-		} else {
-			timeout = setTimeout(() => {
-				func.apply(context, args);
-			}, wait);
-		}
-	};
+        if (timeout) clearTimeout(timeout);
+        if (immediate) {
+            let callNow = !timeout;
+            timeout = setTimeout(() => {
+                timeout = null;
+            }, wait);
+            if (callNow) func.apply(context, args);
+        } else {
+            timeout = setTimeout(() => {
+                func.apply(context, args);
+            }, wait);
+        }
+    };
 };
+export const goHome = () => {
+    uni.redirectTo({
+        url: '/page/index/index'
+    })
+    return
+}
 /**
  * @desc 函数节流
  * @param func 函数
  * @param delay 毫秒数
  */
 export let throttle = (func, delay) => {
-	let timeout;
-	return function() {
-		let args = arguments;
+    let timeout;
+    return function () {
+        let args = arguments;
 
-		if (!timeout) {
-			timeout = setTimeout(() => {
-				func.apply(this, args);
-				timeout = null;
-			}, delay);
-		}
-	};
+        if (!timeout) {
+            timeout = setTimeout(() => {
+                func.apply(this, args);
+                timeout = null;
+            }, delay);
+        }
+    };
 };
 /**
  * 函数节流
@@ -55,70 +61,70 @@ let startThrottleTimer = true; // 是否第一次执行 第一次点击时立即
 let isThrottleTimer = false; // 第一次是否执行
 let ThrottleTimer = true; // 节流函数开关
 // 节流函数
-export let Throttle = function(fn, delay) {
-	var arg = Array.from(arguments).splice(2);
-	if (ThrottleTimer) {
-		if (startThrottleTimer) {
-			fn.apply(this, arg);
-			startThrottleTimer = false;
-		}
-		ThrottleTimer = false;
-		setTimeout(() => {
-			ThrottleTimer = true;
-			if (isThrottleTimer) {
-				fn.apply(this, arg);
-			}
-			startThrottleTimer = true;
-			isThrottleTimer = !startThrottleTimer;
-		}, delay);
-	}
+export let Throttle = function (fn, delay) {
+    var arg = Array.from(arguments).splice(2);
+    if (ThrottleTimer) {
+        if (startThrottleTimer) {
+            fn.apply(this, arg);
+            startThrottleTimer = false;
+        }
+        ThrottleTimer = false;
+        setTimeout(() => {
+            ThrottleTimer = true;
+            if (isThrottleTimer) {
+                fn.apply(this, arg);
+            }
+            startThrottleTimer = true;
+            isThrottleTimer = !startThrottleTimer;
+        }, delay);
+    }
 };
 
 // 校验手机号
 export function phoneValidate(phone) {
-	const reg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/
-	return reg.test(phone)
+    const reg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/
+    return reg.test(phone)
 }
 
 // 校验+86手机号 \ 座机电话
 export function is86Phone(phone) {
-	const reg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/
-	if (reg.test(phone)) {
-		return true
-	}
-	const str2 = phone.substring(0, 2)
-	if (str2 == '86') {
-		const str3 = phone.substring(2, phone.length - 1)
-		if (reg.test(str3)) {
-			return true
-		}
-	}
-	const regMob = /^((0\d{2,3})-)?(\d{7,8})$/
-	if (regMob.test(phone)) {
-		return true
-	}
-	return false
+    const reg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/
+    if (reg.test(phone)) {
+        return true
+    }
+    const str2 = phone.substring(0, 2)
+    if (str2 == '86') {
+        const str3 = phone.substring(2, phone.length - 1)
+        if (reg.test(str3)) {
+            return true
+        }
+    }
+    const regMob = /^((0\d{2,3})-)?(\d{7,8})$/
+    if (regMob.test(phone)) {
+        return true
+    }
+    return false
 }
 
 // 复制文本
 export function copy(data, msg) {
-	uni.setClipboardData({
-		data: data,
-		success: () => {
-			uni.showToast({
-				title: msg || '复制成功',
-				icon: 'none',
-				mask: true
-			})
-		},fail:() => {
-			// uni.showToast({
-			// 	title: '复制失败',
-			// 	icon: 'none',
-			// 	mask: true
-			// })
-			copyFallback(data)
-		}
-	})
+    uni.setClipboardData({
+        data: data,
+        success: () => {
+            uni.showToast({
+                title: msg || '复制成功',
+                icon: 'none',
+                mask: true
+            })
+        }, fail: () => {
+            // uni.showToast({
+            // 	title: '复制失败',
+            // 	icon: 'none',
+            // 	mask: true
+            // })
+            copyFallback(data)
+        }
+    })
 }
 
 function copyFallback(text) {
@@ -128,195 +134,195 @@ function copyFallback(text) {
     textarea.style.position = 'fixed';  // 防止页面滚动
     document.body.appendChild(textarea);
     textarea.select();
-    
+
     try {
-      // 执行复制命令
-      const successful = document.execCommand('copy');
-      if (successful) {
-        uni.showToast({ title: '复制成功', icon: 'none' });
-      } else {
-        throw new Error('复制失败');
-      }
+        // 执行复制命令
+        const successful = document.execCommand('copy');
+        if (successful) {
+            uni.showToast({title: '复制成功', icon: 'none'});
+        } else {
+            throw new Error('复制失败');
+        }
     } catch (err) {
-      console.error('复制失败:', err);
-      uni.showToast({ title: '复制失败,请手动复制', icon: 'none' });
-      // 提示用户手动复制
-      prompt('请手动复制以下内容', text);
+        console.error('复制失败:', err);
+        uni.showToast({title: '复制失败,请手动复制', icon: 'none'});
+        // 提示用户手动复制
+        prompt('请手动复制以下内容', text);
     } finally {
-      document.body.removeChild(textarea);
+        document.body.removeChild(textarea);
     }
 }
 
 
 // 拨打电话
 export function callPhone(phone) {
-	uni.makePhoneCall({
-		phoneNumber: phone
-	})
+    uni.makePhoneCall({
+        phoneNumber: phone
+    })
 }
 
 // 拆分字符串--汉字 | 数字
 export function splitStr(str) {
-	if (!str) {
-		return
-	}
-	let show_text = str
-	const arr = Array.from(new Set(show_text.match(/\d+(.\d+)?/g)))
-	let replace_text = arr.map(item => {
-		if (item.length >= 8 && item.length <= 11) {
-			return item
-		}
-	})
-	for (var i = 0; i < replace_text.length; i++) {
-		var replaceString = '**' + replace_text[i] + "**"
-		show_text = show_text.replace(RegExp(replace_text[i]), replaceString)
-	}
-	return show_text.split('**')
+    if (!str) {
+        return
+    }
+    let show_text = str
+    const arr = Array.from(new Set(show_text.match(/\d+(.\d+)?/g)))
+    let replace_text = arr.map(item => {
+        if (item.length >= 8 && item.length <= 11) {
+            return item
+        }
+    })
+    for (var i = 0; i < replace_text.length; i++) {
+        var replaceString = '**' + replace_text[i] + "**"
+        show_text = show_text.replace(RegExp(replace_text[i]), replaceString)
+    }
+    return show_text.split('**')
 }
 
 // 预览pdf
 export function exportPDF(pdfUrl) {
-	//  #ifdef H5
-	window.open(
-		pdfUrl
-	)
-	// #endif
+    //  #ifdef H5
+    window.open(
+        pdfUrl
+    )
+    // #endif
 
-	// 微信下载文件需要在微信公众平台>开发>开发管理>服务器域名>downloadFile合法域名>配置白名单域名
-	// #ifdef MP-WEIXIN
-	uni.downloadFile({
-		url: pdfUrl,
-		success: res => {
-			console.log(res)
-			if (res.statusCode === 200) {
-				// 预览pdf文件
-				uni.openDocument({
-					filePath: res.tempFilePath,
-					showMenu: true, // 右上角菜单,可以进行分享保存pdf
-					success: function(file) {
-						console.log("file-success", file)
-					}
-				})
-			}
-		}
-	})
-	// #endif
+    // 微信下载文件需要在微信公众平台>开发>开发管理>服务器域名>downloadFile合法域名>配置白名单域名
+    // #ifdef MP-WEIXIN
+    uni.downloadFile({
+        url: pdfUrl,
+        success: res => {
+            console.log(res)
+            if (res.statusCode === 200) {
+                // 预览pdf文件
+                uni.openDocument({
+                    filePath: res.tempFilePath,
+                    showMenu: true, // 右上角菜单,可以进行分享保存pdf
+                    success: function (file) {
+                        console.log("file-success", file)
+                    }
+                })
+            }
+        }
+    })
+    // #endif
 
-	// #ifdef APP-PLUS
-	uni.downloadFile({
-		url: pdfUrl,
-		success: res => {
-			console.log(res)
-			if (res.statusCode === 200) {
-				// 保存pdf文件至手机,一般安卓端存储路径为:手机存储/dcim/camera文件夹下
-				uni.showLoading({
-					title: '请稍等...'
-				})
-				setTimeout(function() {
-					uni.hideLoading()
-					// 预览pdf文件
-					uni.openDocument({
-						filePath: res.tempFilePath,
-						showMenu: true,
-						success: function(file) {
-							console.log("file-success", file)
-						}
-					})
-				}, 1000)
-			}
-		}
-	})
-	// #endif
+    // #ifdef APP-PLUS
+    uni.downloadFile({
+        url: pdfUrl,
+        success: res => {
+            console.log(res)
+            if (res.statusCode === 200) {
+                // 保存pdf文件至手机,一般安卓端存储路径为:手机存储/dcim/camera文件夹下
+                uni.showLoading({
+                    title: '请稍等...'
+                })
+                setTimeout(function () {
+                    uni.hideLoading()
+                    // 预览pdf文件
+                    uni.openDocument({
+                        filePath: res.tempFilePath,
+                        showMenu: true,
+                        success: function (file) {
+                            console.log("file-success", file)
+                        }
+                    })
+                }, 1000)
+            }
+        }
+    })
+    // #endif
 }
 
 /**
  * 抹除api请求的对象的null和undefined
  */
 export const wipeNulish = (obj) => {
-	obj = Object(obj) // 不是对象类型就转成对象类型
-	obj = clone(obj, true) // 不改变原来的值
-	Object.keys(obj)
-		.forEach((key) => {
-			// 删除null和undefined
-			obj[key] == null && delete obj[key]
-			if (
-				typeof obj[key] === 'object' &&
-				Object.prototype.toString.call(obj) === '[object Object]'
-			) {
-				// 不对Array或Date或RegExp这样的对象处理
-				// 递归删除
-				wipeNulish(obj[key])
-			}
-		})
-	return obj
+    obj = Object(obj) // 不是对象类型就转成对象类型
+    obj = clone(obj, true) // 不改变原来的值
+    Object.keys(obj)
+        .forEach((key) => {
+            // 删除null和undefined
+            obj[key] == null && delete obj[key]
+            if (
+                typeof obj[key] === 'object' &&
+                Object.prototype.toString.call(obj) === '[object Object]'
+            ) {
+                // 不对Array或Date或RegExp这样的对象处理
+                // 递归删除
+                wipeNulish(obj[key])
+            }
+        })
+    return obj
 }
 
 // 调用历史栈页面方法
 export function pageInit(obj = {}) {
-	if (!obj.route || !obj.funName) {
-		return
-	}
-	return new Promise(resolve => {
-		let params = {
-			route: obj.route,
-			funName: obj.funName
-		}
-		const pages = getCurrentPages()
-		const listPage = pages.find(item => item.route === params.route)
-		if (listPage) {
-			console.log(listPage)
-			const fun = listPage.$vm[params.funName]
-			fun && fun()
-			setTimeout(_ => {
-				resolve()
-			}, 300)
-		} else {
-			resolve()
-		}
-	})
+    if (!obj.route || !obj.funName) {
+        return
+    }
+    return new Promise(resolve => {
+        let params = {
+            route: obj.route,
+            funName: obj.funName
+        }
+        const pages = getCurrentPages()
+        const listPage = pages.find(item => item.route === params.route)
+        if (listPage) {
+            console.log(listPage)
+            const fun = listPage.$vm[params.funName]
+            fun && fun()
+            setTimeout(_ => {
+                resolve()
+            }, 300)
+        } else {
+            resolve()
+        }
+    })
 }
 
 // 获取url参数--普通
 export const getUrlParamsNormal = (param) => {
-	let query = ''
-	let hash = window.location.hash
-	const index = hash.indexOf('#')
-	query = hash.substring(index, hash.length)
-	const indexQuery = hash.indexOf('?')
-	query = query.substring(indexQuery + 1, hash.length)
-	let vars = query.split("&")
-	for (let i = 0; i < vars.length; i++) {
-		let pair = vars[i].split("=")
-		if (pair[0] == param) {
-			return pair[1]
-		}
-	}
-	return (false)
+    let query = ''
+    let hash = window.location.hash
+    const index = hash.indexOf('#')
+    query = hash.substring(index, hash.length)
+    const indexQuery = hash.indexOf('?')
+    query = query.substring(indexQuery + 1, hash.length)
+    let vars = query.split("&")
+    for (let i = 0; i < vars.length; i++) {
+        let pair = vars[i].split("=")
+        if (pair[0] == param) {
+            return pair[1]
+        }
+    }
+    return (false)
 }
 
 // 检测微信是否安装
 export function checkApp() {
-	if (plus.runtime.isApplicationExist({
-			pname: 'com.tencent.mm',
-			action: 'weixin://'
-		})) {
-		return true
-		console.log("微信应用已安装");
-	} else {
-		return false
-		console.log("微信应用未安装");
-	}
+    if (plus.runtime.isApplicationExist({
+        pname: 'com.tencent.mm',
+        action: 'weixin://'
+    })) {
+        return true
+        console.log("微信应用已安装");
+    } else {
+        return false
+        console.log("微信应用未安装");
+    }
 }
 
 // 数字保留两位小数或保留整数
-export function numFixtwo(num){
-	
-	let number = Number(num)
-	// console.log(number,'num');
-	if(parseInt(number.toString()) == parseFloat(number.toString())){
-		return number
-	}else{
-		return number.toFixed(2)
-	}
-	
+export function numFixtwo(num) {
+
+    let number = Number(num)
+    // console.log(number,'num');
+    if (parseInt(number.toString()) == parseFloat(number.toString())) {
+        return number
+    } else {
+        return number.toFixed(2)
+    }
+
 }