xll 1 dienu atpakaļ
vecāks
revīzija
3cf0fb5596
26 mainītis faili ar 1836 papildinājumiem un 431 dzēšanām
  1. 2 1
      app.json
  2. 1 1
      nova-tourism/components/collect/index.wxml
  3. 1 1
      nova-tourism/components/homestay/index.js
  4. 1 1
      nova-tourism/components/homestay/index.wxml
  5. 12 1
      nova-tourism/pages/collect/collect-detail/index.js
  6. 2 2
      nova-tourism/pages/collect/collect-detail/index.less
  7. 1 1
      nova-tourism/pages/collect/collect-detail/index.wxss
  8. 5 1
      nova-tourism/pages/collect/good-list/index.js
  9. 34 14
      nova-tourism/pages/homestay/homestay-order2/index.js
  10. 56 63
      nova-tourism/pages/index/index.js
  11. 1 1
      nova-tourism/pages/my/merchant/code-verify/index.wxml
  12. 551 0
      nova-tourism/pages/my/merchant/merchant-home/gift-order/index.js
  13. 22 0
      nova-tourism/pages/my/merchant/merchant-home/gift-order/index.json
  14. 280 0
      nova-tourism/pages/my/merchant/merchant-home/gift-order/index.less
  15. 147 0
      nova-tourism/pages/my/merchant/merchant-home/gift-order/index.wxml
  16. 218 0
      nova-tourism/pages/my/merchant/merchant-home/gift-order/index.wxss
  17. 362 305
      nova-tourism/pages/my/merchant/merchant-home/index.js
  18. 35 4
      nova-tourism/pages/my/merchant/merchant-home/index.less
  19. 25 12
      nova-tourism/pages/my/merchant/merchant-home/index.wxml
  20. 0 0
      nova-tourism/pages/my/merchant/merchant-home/index.wxss
  21. 35 6
      nova-tourism/pages/my/merchant/merchant-home/my-users/index.js
  22. 2 1
      nova-tourism/pages/my/merchant/merchant-home/order2-list/index.wxml
  23. 8 8
      nova-tourism/pages/my/merchant/merchant-home/store-withdraw/index.js
  24. 1 1
      nova-tourism/pages/my/merchant/merchant-home/store-withdraw/index.wxml
  25. 28 1
      nova-tourism/service/request.js
  26. 6 6
      project.private.config.json

+ 2 - 1
app.json

@@ -42,7 +42,8 @@
         "pages/my/merchant/good/good-list/index",
         "pages/collect/good-list/index",
         "pages/my/sharing/index",
-        "pages/my/my-order/my-refund/refund-good/refund-express/index"
+        "pages/my/my-order/my-refund/refund-good/refund-express/index",
+        "pages/my/merchant/merchant-home/gift-order/index"
       ]
     },
     {

+ 1 - 1
nova-tourism/components/collect/index.wxml

@@ -1,7 +1,7 @@
 <!--nova-tourism/components/collect/index.wxml-->
 <nav type="title" background-color="#ffffff" frontColor="#000000" title="云上望仙" />
 <view class="all">
-  <image class="img2" src="https://file-cloud.fmode.cn/EbxZUK5lBI/20241121/jc17lo114657420.jpg"></image>
+  <image class="img2" src="https://file-cloud.fmode.cn/EbxZUK5lBI/20250419/l1fsbm101248703.jpg"></image>
   <view class="tab-bar">
     <view style="margin-left: 66rpx;" class="tab-item {{currentTab == 0? 'active' : ''}}" bindtap="switchTab" data-index="0">
       云上风物

+ 1 - 1
nova-tourism/components/homestay/index.js

@@ -145,7 +145,7 @@ Component({
       oddList = [...oddList, ...odd]
       evenList = [...evenList, ...even]
       storeList = [...(evenList || []), ...(oddList || [])]
-      console.log(storeList)
+      // console.log(storeList)
       this.setData({
         storeList,
         oddList,

+ 1 - 1
nova-tourism/components/homestay/index.wxml

@@ -2,7 +2,7 @@
 <scroll-view bindscroll="onScroll" class="all" id="scroller" scroll-y="true" bindscrolltolower="getShopStore" style="height: {{contentHeight}}rpx;">
   <view class="picturebox">
     <view class="img">
-      <image src="https://file-cloud.fmode.cn/EbxZUK5lBI/20241121/jc17lo114657420.jpg"></image>
+      <image src="https://file-cloud.fmode.cn/EbxZUK5lBI/20250419/l1fsbm101248703.jpg"></image>
     </view>
   </view>
 

+ 12 - 1
nova-tourism/pages/collect/collect-detail/index.js

@@ -562,7 +562,7 @@ Page({
   /**支付回调 */
   async acceptResult(e) {
     let {
-      order
+      order,good
     } = this.data
     let {
       params
@@ -577,6 +577,16 @@ Page({
       order.set('isPay', true)
       try {
         await order.save()
+        // let query = new Parse.Query('_User')
+        // let userParse = await query.get(uid)
+        // console.log(userParse)
+        // if(!userParse?.get('invite')){
+        //   let shop_query = new Parse.Query('ShopStore')
+        //   let shop = await shop_query.get(good?.shopStore?.objectId)
+        //     if(shop?.get('user')?.id){
+        //      await sev.bindShop(uid,shop?.id)
+        //     }
+        // }
         setTimeout(() => {
           wx.hideLoading()
           wx.redirectTo({
@@ -584,6 +594,7 @@ Page({
           })
         }, 1000);
       } catch (error) {
+        console.log(error)
         wx.showToast({
           title: '保存订单出错,请联系客服核对订单',
           icon: 'none'

+ 2 - 2
nova-tourism/pages/collect/collect-detail/index.less

@@ -516,7 +516,7 @@
     }
 
     .btn {
-        position: absolute;
+        position: fixed;
         font-size: 32rpx;
         height: 82rpx;
         width: 100%;
@@ -645,4 +645,4 @@
         background: white;
         border: 1rpx solid #F89B7F;
     }
-}
+}

+ 1 - 1
nova-tourism/pages/collect/collect-detail/index.wxss

@@ -425,7 +425,7 @@
   margin-left: 20rpx;
 }
 .specBox .btn {
-  position: absolute;
+  position: fixed;
   font-size: 32rpx;
   height: 82rpx;
   width: 100%;

+ 5 - 1
nova-tourism/pages/collect/good-list/index.js

@@ -72,15 +72,19 @@ Page({
     if (value && value != '') {}
     let sql = `SELECT good."objectId",good."name",good."price",good."image"
     FROM "ShopGoods" good
+    LEFT JOIN "ShopStore" shop ON shop."objectId"=good."shopStore"
     WHERE good."company" = '${company}'
     AND good."isDeleted" IS NOT TRUE
     ${store_id?`AND good."shopStore" = '${store_id}'`:''}
     AND good."status" IS TRUE
     AND good."name" LIKE '%${value}%'
+    AND shop."isDeleted" IS NOT TRUE
+    AND shop."isVerified" IS TRUE
     ORDER BY COALESCE(good."isRecom", FALSE) DESC,
     CASE WHEN good."top"= 0 THEN 1 ELSE 0 END,
     good."top" ASC
-    LIMIT 30 OFFSET ${goodList?.length||0}`
+    LIMIT 20 OFFSET ${goodList?.length||0}`
+    console.log(sql)
     let list = await req.customSQL(sql)||[]
     console.log(list)
     this.setData({

+ 34 - 14
nova-tourism/pages/homestay/homestay-order2/index.js

@@ -70,7 +70,7 @@ Page({
       endTime
     } = this.data
     let room = new Parse.Query('ShopRoom');
-    room.include('shop','shop.user');
+    room.include('shop', 'shop.user');
     let d = await room.get(this.data.roomId)
     let timeList = ['12:00', '14:00']
     if (d?.get('open_time')) {
@@ -113,8 +113,8 @@ Page({
       let year = day.date.getFullYear()
       let month = day.date.getMonth()
       let date = day.date.getDate()
-      let isSame = list.findIndex(item=>item.year==year && item.month==month && item.date==date)
-      if(isSame!=-1){
+      let isSame = list.findIndex(item => item.year == year && item.month == month && item.date == date)
+      if (isSame != -1) {
         day.topInfo = '被预定'
       }
       return day
@@ -135,16 +135,21 @@ Page({
     const [start, end] = event.detail;
     start.setHours(12, 0, 0);
     end.setHours(14, 0, 0);
-    let {roomId}=this.data
-    let isFree = await sev.isFree({from:start,to:end},roomId)
+    let {
+      roomId
+    } = this.data
+    let isFree = await sev.isFree({
+      from: start,
+      to: end
+    }, roomId)
     console.log(isFree)
-    if(!isFree){
+    if (!isFree) {
       await this.onDisplay()
       wx.showToast({
         title: '时间段内存在被预定日期,请重新选择',
-        icon:'none'
+        icon: 'none'
       })
-    }else{
+    } else {
       await this.setData({
         show: false,
         startTime: start,
@@ -181,6 +186,18 @@ Page({
 
   /**创建订单 */
   async submitOrder() {
+    let now = new Date()
+    tradeNo = "C" +
+      String(now.getFullYear()) +
+      (now.getMonth() + 1) +
+      now.getDate() +
+      now.getHours() +
+      now.getMinutes() +
+      now.getSeconds() +
+      Math.random().toString().slice(-6);
+    await this.setData({
+      tradeNo
+    })
     let {
       room,
       name,
@@ -261,7 +278,8 @@ Page({
   /**支付回调 */
   async acceptResult(e) {
     let {
-      order,room
+      order,
+      room
     } = this.data
     let {
       params
@@ -274,11 +292,13 @@ Page({
       order.set('isPay', true)
       try {
         await order.save()
-        let userParse = Parse.User.current()
-        if(!userParse?.get('invite')){
-          userParse.set('invite',{__type:'Pointer',className:'_User',objectId:room.shop?.user?.objectId})
-          await userParse.save()
-        }
+        // let userParse = Parse.User.current()
+        // console.log(userParse?.get('invite'))
+        // if (!userParse?.get('invite')) {
+        //   let uid = Parse.User.current()?.id
+        //   let a = await sev.bindShop(uid, room.shop?.objectId)
+        //   console.log(a)
+        // }
         setTimeout(() => {
           wx.hideLoading()
           wx.redirectTo({

+ 56 - 63
nova-tourism/pages/index/index.js

@@ -4,6 +4,7 @@ const getTabs = require("../../../utils/getTabs")
 const login = require("../../../utils/login");
 const dateF = require("../../../utils/date")
 import Toast from '@vant/weapp/toast/toast';
+const sev = require('../../service/request')
 
 Page({
 
@@ -13,7 +14,7 @@ Page({
   data: {
     active: 0,
     showModel: false,
-    isSignIn:false
+    isSignIn: false
   },
   /**
    * 生命周期函数--监听页面加载
@@ -33,15 +34,16 @@ Page({
       groupId,
       path
     } = options
-    let str = decodeURIComponent(q);
-    let obj = this.getParaName(str)
-    console.log(obj);
-    if(path){
+    console.log(options)
+
+    if (path) {
       wx.navigateTo({
         url: path,
       });
     }
   },
+
+
   async onChange(event) {
     let currentIndex = event.detail;
     let userInfo = wx.getStorageSync("userLogin");
@@ -69,44 +71,47 @@ Page({
       active: 2
     })
   },
-  //解析二维码
-  getParaName(url) {
-    if (!url || url.indexOf('?') == -1) {
-      return
-    }
-    let paraname = url.split('?')[1]
-    return this.setObject(paraname) //封装成对象
-  },
-  setObject(paraArr) {
-    let obj = {}
-    let arr1 = paraArr.split('&')
-    arr1.forEach(item => {
-      let str = item.split('=')
-      let key = str[0]
-      let val = str[1]
-      obj[key] = val
-    })
-    return obj
-  },
-  async agentParent(){
-    if(!Parse.User.current()?.id) return
-    wx.request({
-      url: 'https://server.fmode.cn/api/user/agent/parent',
-      data: {
-        uid: Parse.User.current()?.id
-      },
-      header: {
-        'content-type': 'application/json'
-      },
-      method: 'POST',
-      dataType: 'json',
-      responseType: 'text',
-      success: (result) => {
-        console.log(result);
-      },
-      fail: () => {},
-      complete: () => {}
-    });
+  /** 更新user的invitePath*/
+  async agentParent() {
+    if (!Parse.User.current()?.id) return
+   await sev.bindShop(Parse.User.current()?.id)
+    // wx.request({
+    //   url: 'https://server.fmode.cn/api/user/agent/parent',
+    //   data: {
+    //     uid: Parse.User.current()?.id
+    //   },
+    //   header: {
+    //     'content-type': 'application/json'
+    //   },
+    //   method: 'POST',
+    //   dataType: 'json',
+    //   responseType: 'text',
+    //   success: async (result) => {
+    //     let uid = Parse.User.current()?.id
+    //     console.log(result);
+    //     let query = new Parse.Query('_User')
+    //     let user = await query.get(uid)
+    //     let top_uid = user?.get('invitePath')[0]
+    //     console.log(top_uid)
+    //     if (!top_uid) return
+    //     let shop_query = new Parse.Query('ShopStore')
+    //     shop_query.equalTo('user', top_uid)
+    //     shop_query.notEqualTo('isDeleted', true)
+    //     shop_query.equalTo('isVerified', true)
+    //     shop_query.select('objectId')
+    //     let shop = await shop_query.first()
+    //     console.log(shop)
+    //     if (!shop?.id) return
+    //     user.set('store', {
+    //       __type: 'Pointer',
+    //       className: 'ShopStore',
+    //       objectId: shop?.id
+    //     })
+    //     await user.save()
+    //   },
+    //   fail: () => {},
+    //   complete: () => {}
+    // });
   },
   /**
    * 生命周期函数--监听页面初次渲染完成
@@ -132,36 +137,24 @@ Page({
       case 0:
         break;
       case 1:
-        // componentPage.setData({
-        //   scate: []
-        // })
-        // componentPage.refresh()
-
         break;
       case 2:
-        // componentPage.setData({
-        //   allCheck: false,
-        //   cartList: [],
-        //   totalPrice: 0.00,
-        // })
-        // componentPage.getShopcart()
         break;
       case 3:
-        // componentPage.refresh()
         break;
     }
   },
 
   /* 服务器是否需要续费 */
-  async getRenew(){
+  async getRenew() {
     let query = new Parse.Query("Company")
-    query.select('website','expireMap')
-    query.equalTo('objectId',company)
+    query.select('website', 'expireMap')
+    query.equalTo('objectId', company)
     let c = await query.first()
-    if(c?.id && c?.get('expireMap')){
+    if (c?.id && c?.get('expireMap')) {
       let url = getApp().globalData.rootPage || getApp().globalData.defaultTabBar.list[0].pagePath
       //website配置且renew(续费)存在
-      if(c.get('expireMap')?.renew && c.get('website')){
+      if (c.get('expireMap')?.renew && c.get('website')) {
         wx.showModal({
           title: '警告',
           content: '当前平台服务器承载已超出阈值,请与技术人员联系。',
@@ -171,14 +164,14 @@ Page({
           confirmText: '确定',
           confirmColor: '#3CC51F',
           success: (result) => {
-            if(result.confirm){
+            if (result.confirm) {
               wx.reLaunch({
                 url: `/common-page/pages/loading/index?url=${url}`,
               });
             }
           },
-          fail: ()=>{},
-          complete: ()=>{}
+          fail: () => {},
+          complete: () => {}
         });
       }
     }

+ 1 - 1
nova-tourism/pages/my/merchant/code-verify/index.wxml

@@ -59,7 +59,7 @@
     </view>
     <view class="list">
       <view class="key">订单总额:</view>
-      <view class="value">¥{{order.price}}</view>
+      <view class="value">¥{{order.totalPrice}}</view>
     </view>
   </view>
 </block>

+ 551 - 0
nova-tourism/pages/my/merchant/merchant-home/gift-order/index.js

@@ -0,0 +1,551 @@
+// nova-tourism/pages/my/merchant/merchant-home/gift-order/index.js
+const Parse = getApp().Parse;
+const company = getApp().globalData.company
+const dateF = require('../../../../../../utils/date')
+
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    orderList: [], //订单列表
+    storeId: '', //本店id
+    statusMap_shop: {
+      '100': '待支付',
+      '200': '已支付',
+      '300': '已发货',
+      '400': '已收货',
+      '500': '申请退款',
+      '601': '退款申请通过',
+      '602': '退款被驳回',
+      '700': '退款成功',
+      '800': '订单完成',
+    },
+    isShipments: false, //发货弹框
+    shipments_order: null, //发货订单
+    shipments_index: 0, //发货订单下标
+    trackingNumber: null, //快递单号
+
+    isShowExpress: false, //快递公司弹框
+    expVal: '', //快递公司搜索关键字
+    timeout: null, //搜索框计时器
+    expComList: [], //快递公司列表
+    checkExp: null, //选中的公司
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    let storeId = options.storeId;
+    this.setData({
+      storeId: storeId
+    })
+    this.refersh()
+  },
+  async refersh() {
+    this.getOrder()
+  },
+  /**获取订单 */
+  async getOrder() {
+    let {
+      storeId,
+      orderList
+    } = this.data
+    let query = new Parse.Query('Order')
+    query.include('targetObject', 'store', 'expressCompany')
+    query.equalTo('company', company)
+    query.equalTo('store', storeId)
+    query.notEqualTo('isDeleted', true)
+    query.containedIn('status', ['200', '300', '400', '500', '601', '602', '700', '800'])
+    query.limit(10)
+    query.skip(orderList?.length || 0)
+    query.descending('createdAt')
+    let r = await query.find()
+    if (r?.length <= 0) wx.showToast({
+      title: '到底了~',
+      icon: 'none',
+      duration: 500
+    })
+    let list = r?.map(item => {
+      let obj = item?.toJSON()
+      obj.createdAt = dateF.formatTime("YYYY-mm-dd HH:MM", obj.createdAt)
+      if (obj.payTime) obj.payTime = dateF.formatTime("YYYY-mm-dd HH:MM", obj.payTime.iso)
+      return obj
+    }) || []
+    this.setData({
+      orderList: [...(orderList || []), ...(list || [])]
+    })
+    // console.log(this.data.orderList)
+  },
+  /**
+   * 更新订单状态
+   * @param {*} index 订单下标
+   */
+  async refershOrder(index) {
+    let {
+      orderList
+    } = this.data
+    let item = orderList[index]
+    let query = new Parse.Query('Order')
+    query.include('targetObject', 'store', 'expressCompany')
+    query.notEqualTo('isDeleted', true)
+    query.containedIn('status', ['200', '300', '400', '500', '601', '602', '700', '800'])
+    query.equalTo('objectId', item.objectId)
+    let r = await query.first()
+    if (!r.id) {
+      orderList.splice(index, 1)
+      this.setData({
+        orderList
+      })
+      return
+    }
+    let obj = r?.toJSON()
+    obj.createdAt = dateF.formatTime("YYYY-mm-dd HH:MM", obj.createdAt)
+    if (obj.payTime) obj.payTime = dateF.formatTime("YYYY-mm-dd HH:MM", obj.payTime.iso)
+    orderList[index] = obj
+    this.setData({
+      orderList
+    })
+  },
+
+
+  /**快递订单-确认发货 */
+  async confirmShipment() {
+    let {
+      shipments_order,
+      trackingNumber,
+      checkExp,shipments_index
+    } = this.data
+    if ((!trackingNumber) || (!checkExp?.objectId)) {
+      wx.showToast({
+        title: '存在未填项',
+        icon: 'none'
+      })
+      return
+    }
+    let query = new Parse.Query('Order')
+    let o = await query.get(shipments_order?.objectId)
+    o.set('trackingNumber', trackingNumber)
+    o.set('expressCompany', {
+      __type: 'Pointer',
+      className: 'ExpressCompany',
+      objectId: checkExp?.objectId
+    })
+    o.set('status','300')
+    await o.save()
+    await this.refershOrder(shipments_index)
+    this.closeShipments()
+    wx.showToast({
+      title: '保存成功',
+      icon:'success'
+    })
+  },
+  /**发货弹框-开 */
+  openShipments(e) {
+    let {
+      index
+    } = e.currentTarget.dataset
+    let {
+      orderList,statusMap_shop
+    } = this.data
+    let shipments_order = orderList[index]
+    if (shipments_order.distributeType != 'delivery') return
+    if(shipments_order.status != '200'){
+      wx.showToast({
+        title: `当前订单 ${statusMap_shop[shipments_order.status]} ,无需发货。`,
+        icon:'none'
+      })
+      return
+    }
+    // console.log(shipments_order)
+    this.setData({
+      isShipments: true,
+      shipments_order,
+      shipments_index: index,
+      checkExp: shipments_order.expressCompany || null,
+      expVal: '',
+      trackingNumber:shipments_order.trackingNumber||'',
+    })
+  },
+  /**发货弹框-关 */
+  closeShipments() {
+    this.setData({
+      isShipments: false
+    })
+  },
+  /**确认退款 */
+  confirm_refund(e) {
+    let {
+      index
+    } = e.currentTarget.dataset
+    let {
+      orderList
+    } = this.data
+
+    let _this = this
+    wx.showModal({
+      title: '',
+      content: '已确认顾客退款到账吗?',
+      showCancel: true,
+      cancelText: '取消',
+      cancelColor: '#000000',
+      confirmText: '确定',
+      confirmColor: '#3CC51F',
+      success: async (result) => {
+        if (result.confirm) {
+          wx.showLoading({
+            title: '加载中',
+          })
+          let ShopOrder = new Parse.Query('Order')
+          let order = await ShopOrder.get(orderList[index]?.objectId)
+          if (order && order?.id) {
+            order.set('status', '700')
+            await order.save()
+            this.refershOrder(index)
+          } else {
+            wx.hideLoading()
+            wx.showToast({
+              title: '出错了',
+              icon: 'error',
+              image: '',
+              duration: 1500,
+            });
+            return
+          }
+          orderList.splice(index, 1)
+          _this.setData({
+            orderList
+          })
+          wx.hideLoading()
+          wx.showToast({
+            title: '已取消',
+            icon: 'none',
+            image: '',
+            duration: 1500,
+          });
+        }
+      },
+      fail: () => {},
+      complete: () => {}
+    });
+  },
+  /**驳回退款 */
+  overrule_refund(e) {
+    let {
+      index
+    } = e.currentTarget.dataset
+    let {
+      orderList
+    } = this.data
+
+    let _this = this
+    wx.showModal({
+      title: '',
+      content: '驳回当前退款申请吗?',
+      showCancel: true,
+      cancelText: '取消',
+      cancelColor: '#000000',
+      confirmText: '确定',
+      confirmColor: '#3CC51F',
+      success: async (result) => {
+        if (result.confirm) {
+          wx.showLoading({
+            title: '加载中',
+          })
+          let ShopOrder = new Parse.Query('Order')
+          let order = await ShopOrder.get(orderList[index]?.objectId)
+          if (order && order?.id) {
+            order.set('status', '602')
+            await order.save()
+            this.refershOrder(index)
+          } else {
+            wx.hideLoading()
+            wx.showToast({
+              title: '出错了',
+              icon: 'error',
+              image: '',
+              duration: 1500,
+            });
+            return
+          }
+          orderList.splice(index, 1)
+          _this.setData({
+            orderList
+          })
+          wx.hideLoading()
+          wx.showToast({
+            title: '已取消',
+            icon: 'none',
+            image: '',
+            duration: 1500,
+          });
+        }
+      },
+      fail: () => {},
+      complete: () => {}
+    });
+  },
+  /**同意退款 */
+  agree_refund(e) {
+    let {
+      index
+    } = e.currentTarget.dataset
+    let {
+      orderList
+    } = this.data
+
+    let _this = this
+    wx.showModal({
+      title: '',
+      content: '确认当前退款申请吗?',
+      showCancel: true,
+      cancelText: '取消',
+      cancelColor: '#000000',
+      confirmText: '确定',
+      confirmColor: '#3CC51F',
+      success: async (result) => {
+        if (result.confirm) {
+          wx.showLoading({
+            title: '加载中',
+          })
+          let ShopOrder = new Parse.Query('Order')
+          let order = await ShopOrder.get(orderList[index]?.objectId)
+          if (order && order?.id) {
+            order.set('status', '601')
+            await order.save()
+            this.refershOrder(index)
+          } else {
+            wx.hideLoading()
+            wx.showToast({
+              title: '出错了',
+              icon: 'error',
+              image: '',
+              duration: 1500,
+            });
+            return
+          }
+          orderList.splice(index, 1)
+          _this.setData({
+            orderList
+          })
+          wx.hideLoading()
+          wx.showToast({
+            title: '已取消',
+            icon: 'none',
+            image: '',
+            duration: 1500,
+          });
+        }
+      },
+      fail: () => {},
+      complete: () => {}
+    });
+  },
+  /**确认收货 */
+  confirm_receipt(e) {
+    let {
+      index
+    } = e.currentTarget.dataset
+    let {
+      orderList
+    } = this.data
+
+    let _this = this
+    wx.showModal({
+      title: '',
+      content: '确认当前自提订单已取货吗',
+      showCancel: true,
+      cancelText: '取消',
+      cancelColor: '#000000',
+      confirmText: '确定',
+      confirmColor: '#3CC51F',
+      success: async (result) => {
+        if (result.confirm) {
+          wx.showLoading({
+            title: '加载中',
+          })
+          let ShopOrder = new Parse.Query('Order')
+          let order = await ShopOrder.get(orderList[index]?.objectId)
+          if (order && order?.id) {
+            order.set('status', '800')
+            await order.save()
+            this.refershOrder(index)
+          } else {
+            wx.hideLoading()
+            wx.showToast({
+              title: '出错了',
+              icon: 'error',
+              image: '',
+              duration: 1500,
+            });
+            return
+          }
+          orderList.splice(index, 1)
+          _this.setData({
+            orderList
+          })
+          wx.hideLoading()
+          wx.showToast({
+            title: '已取消',
+            icon: 'none',
+            image: '',
+            duration: 1500,
+          });
+        }
+      },
+      fail: () => {},
+      complete: () => {}
+    });
+  },
+
+
+
+
+
+  closeExpress() {
+    this.setData({
+      isShowExpress: false
+    });
+  },
+  openExpress() {
+    this.getPointerItem()
+    this.setData({
+      isShowExpress: true
+    });
+  },
+  /**指针搜索框变化 */
+  async valChange(e) {
+    await this.setData({
+      expVal: e.detail || ''
+    })
+    let {
+      timeout
+    } = this.data
+    clearTimeout(timeout)
+    timeout = setTimeout(async () => {
+      await this.setData({
+        expComList: [],
+      })
+      this.getPointerItem()
+    }, 1000);
+    this.setData({
+      timeout
+    })
+  },
+  /**选中快递公司 */
+  checkPointer(e) {
+    let {
+      index
+    } = e.currentTarget.dataset
+    let {
+      expComList
+    } = this.data
+    this.setData({
+      checkExp: expComList[index]
+    })
+    // console.log(expComList[index])
+    this.closeExpress()
+  },
+  /** 查询快递公司*/
+  async getPointerItem() {
+    let {
+      expVal,
+      expComList
+    } = this.data
+    let query = new Parse.Query('ExpressCompany')
+    query.contains('name', expVal || '')
+    query.limit(30)
+    query.skip(expComList?.length || 0)
+    let d = await query.find()
+    let list = d?.map(item => item.toJSON())
+    this.setData({
+      expComList: [...(expComList || []), ...(list || [])]
+    })
+  },
+
+
+
+
+
+
+  /**预览图片 */
+  previewImg: function (e) {
+    let {
+      list
+    } = e.currentTarget.dataset
+    var photo = list || []
+    wx.previewImage({
+      current: photo[0],
+      urls: photo
+    });
+  },
+  /**复制文本 */
+  onCopy(e) {
+    let {
+      text
+    } = e.currentTarget.dataset
+    wx.setClipboardData({
+      data: text,
+      success: function (res) {
+        wx.getClipboardData({
+          success: function (res) {
+            wx.showToast({
+              title: '复制成功',
+            })
+          }
+        })
+      }
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+    this.getOrder()
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 22 - 0
nova-tourism/pages/my/merchant/merchant-home/gift-order/index.json

@@ -0,0 +1,22 @@
+{
+  "usingComponents": {
+    "van-tab": "@vant/weapp/tab/index",
+    "van-tabs": "@vant/weapp/tabs/index",
+    "van-empty": "@vant/weapp/empty/index",
+    "van-dialog": "@vant/weapp/dialog/index",
+    "van-tag": "@vant/weapp/tag/index",
+    "van-dropdown-menu": "@vant/weapp/dropdown-menu/index",
+    "van-dropdown-item": "@vant/weapp/dropdown-item/index",
+    "van-divider": "@vant/weapp/divider/index",
+    "van-popup": "@vant/weapp/popup/index",
+    "van-field": "@vant/weapp/field/index",
+    "van-cell": "@vant/weapp/cell/index",
+    "van-cell-group": "@vant/weapp/cell-group/index",
+    "van-checkbox": "@vant/weapp/checkbox/index",
+    "van-checkbox-group": "@vant/weapp/checkbox-group/index",
+    "van-steps": "@vant/weapp/steps/index",
+    "van-icon": "@vant/weapp/icon/index",
+    "van-search": "@vant/weapp/search/index"
+
+  }
+}

+ 280 - 0
nova-tourism/pages/my/merchant/merchant-home/gift-order/index.less

@@ -0,0 +1,280 @@
+.order {
+    border-radius: 20rpx;
+    padding: 20px;
+    width: 93vw;
+    margin: 20rpx auto;
+    background: white;
+    box-shadow: 5rpx 5rpx 20rpx #46a9a473;
+
+    .orderNum {
+        font-size: 24rpx;
+        color: #46a9a4;
+        margin-bottom: 10rpx;
+        display: flex;
+        justify-content: space-between;
+
+        text {
+            background: #d8faf8;
+            padding: 3rpx 8rpx;
+        }
+
+        .tag {
+            padding: 5rpx 10rpx;
+            height: 43rpx;
+            font-size: 22rpx;
+            color: #46a9a4;
+            background: #d8faf8;
+        }
+
+        .tag_errands {
+            color: orange;
+            background: rgba(255, 217, 0, 0.658);
+        }
+    }
+
+
+
+    .addressbox {
+        width: 100%;
+        border-bottom: 1rpx solid rgb(228, 228, 228);
+        padding-bottom: 20rpx;
+
+      
+    }
+
+    .goodDetil {
+        margin: 20rpx 0;
+
+        .goodTitle {
+            font-size: 30rpx;
+            font-weight: bold;
+            margin: 20rpx 0;
+        }
+
+        .picturebox {
+            margin: 20rpx;
+            width: 100%;
+            display: flex;
+            align-items: center;
+
+            .picture {
+                width: 120rpx;
+                height: 120rpx;
+                margin-left: 20rpx;
+            }
+        }
+
+        .weight {
+            font-size: 30rpx;
+            margin: 20rpx;
+        }
+    }
+
+    .staff {
+        font-size: 30rpx;
+
+        text {
+            font-weight: bold;
+        }
+    }
+
+    .cart {
+        .good_item {
+            overflow: hidden;
+            display: flex;
+            margin: 10rpx;
+            overflow: hidden;
+
+            >image {
+                width: 170rpx;
+                height: 170rpx;
+                flex-shrink: 0;
+                padding: 10rpx;
+                border-radius: 10rpx;
+            }
+
+            .left {
+                width: 470rpx;
+                margin: 10rpx 0rpx 10rpx 10rpx;
+
+                .name {
+                    font-size: 35rpx;
+                    display: -webkit-box;
+                    -webkit-box-orient: vertical;
+                    -webkit-line-clamp: 2;
+                    overflow: hidden;
+                }
+
+                .desc {
+                    margin: 10rpx 0;
+                    width: 100%;
+                    font-size: 25rpx;
+                    color: rgb(160, 160, 160);
+                    display: -webkit-box;
+                    -webkit-box-orient: vertical;
+                    -webkit-line-clamp: 1;
+                    overflow: hidden;
+                }
+
+                .buttom {
+                    display: flex;
+                    align-items: center;
+                    justify-content: space-between;
+                    margin-top: 6rpx;
+
+                    .price {
+                        .price {
+                            font-size: 26rpx;
+                            color: rgb(160, 160, 160);
+                        }
+
+                        .original {
+                            font-size: 22rpx;
+                            color: rgb(160, 160, 160);
+                            text-decoration: line-through
+                        }
+                    }
+
+                    .add {
+                        margin-left: 10rpx;
+                        width: 150rpx;
+                        font-size: 26rpx;
+                        color:rgb(160, 160, 160);
+                    }
+                }
+            }
+        }
+    }
+
+    .totalPrice {
+        text-align: end;
+        font-size: 28rpx;
+        color: gray;
+
+        text {
+            color: red;
+            font-size: 36rpx;
+            font-weight: bold;
+        }
+    }
+
+    .btn {
+        height: 80rpx;
+
+        button {
+            padding: 3rpx 15rpx;
+            float: right;
+            font-size: 28rpx;
+            background: #46a9a4;
+            color: white;
+            margin: 20rpx 0 10rpx 10rpx;
+        }
+    }
+}
+.refund_popup{
+    .title{
+      font-weight: bold;
+      padding: 20rpx;
+      font-size: 40rpx;
+      text-align: center;
+      border-bottom: rgb(228, 228, 228) 1rpx solid;
+    }
+    .refundPopup{
+      padding: 30rpx;
+      .address {
+        width: 100%;
+        display: flex;
+        align-items: center;
+        margin-top: 15rpx;
+        padding-left: 10rpx;
+        padding-right: 10rpx;
+
+        .a {
+            padding: 5rpx 8rpx;
+            border-radius: 5rpx;
+            margin-right: 20rpx;
+            font-size: 25rpx;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            background-color: #46a9a4;
+            color: #d8faf8;
+        }
+
+        .b {
+            padding: 5rpx 8rpx;
+            border-radius: 5rpx;
+            margin-right: 20rpx;
+            font-size: 25rpx;
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            background-color: #d8faf8;
+            color: #46a9a4;
+        }
+
+        .address2 {
+            width: 100%;
+            font-size: 30rpx;
+
+            .address-address {
+                color: rgb(78, 78, 78);
+                width: 100%;
+                display: flex;
+                align-items: center;
+                
+            }
+
+            .name {
+                color: rgb(175, 174, 174);
+                margin-top: 10rpx;
+            }
+        }
+    }
+
+    
+    }
+    button{
+      background:#46a9a4;
+      color: white;
+      width: 90vw;
+    }
+  }
+
+
+  
+
+
+
+
+
+
+
+
+
+
+
+
+  .expressPopup {
+    width: 100%;
+    height: 70vh;
+
+    .title {
+        font-size: 30rpx;
+        height: 90rpx;
+        line-height: 90rpx;
+        text-align: center;
+        border-bottom: 1rpx solid whitesmoke;
+    }
+
+    .itemBox {
+        overflow-y: auto;
+        height: calc(70vh - 250rpx);
+
+        .item {
+            padding: 20rpx;
+            font-size: 28rpx;
+            border-bottom: 1rpx solid whitesmoke;
+        }
+    }
+}

+ 147 - 0
nova-tourism/pages/my/merchant/merchant-home/gift-order/index.wxml

@@ -0,0 +1,147 @@
+<nav type="back" background-color="#46a9a4" title="订单列表" />
+
+<view class="list" wx:if="{{orderList && orderList.length>0}}">
+  <block wx:for="{{orderList}}" wx:key="index">
+    <view class="order">
+      <view class="orderNum">
+        <view>
+          <view>
+            订单编号:
+            <text data-text="{{item.orderNum}}" bind:tap="onCopy">{{item.orderNum}}</text>
+          </view>
+          <view style="margin-top: 10rpx;">下单时间:{{item.createdAt}}</view>
+        </view>
+        <view class="tag">{{statusMap_shop[item.status]}}</view>
+      </view>
+
+
+      <view class="addressbox" wx:if="{{item.distributeType=='delivery'}}">
+        <!-- <view class="address">
+            <view class="a">取</view>
+            <view class="address2">
+              <view class="address-address">{{item.address.full_region||'暂无'}} {{item.address.address||''}}</view>
+              <view class="name" data-mobile="{{item.address.mobile}}" bind:tap="callPhone">{{item.address.name||''}} {{item.address.mobile||''}}</view>
+            </view>
+          </view> -->
+        <!-- <view class="address">
+          <view class="b">收</view>
+          <view class="address2">
+            <view class="address-address">{{item.info.address||'暂无'}}</view>
+            <view class="name" data-mobile="{{item.terminus.mobile}}" bind:tap="callPhone">{{item.info.name||''}} {{item.info.mobile||''}}</view>
+          </view>
+        </view> -->
+      </view>
+      <view class="cart">
+        <block wx:for="{{item.targetObject}}" wx:key="index" wx:for-item="childer">
+          <view class="good_item">
+            <image data-list="{{[childer.image]}}" bind:tap="previewImg" src="{{childer.image||'https://file-cloud.fmode.cn/13WZ0W7u3l/20240830/jq956l022025894.jpg?imageView2/1/w/200/h/200'}}" alt="" />
+            <view class="left">
+              <view class="name">{{childer.name}}</view>
+              <block wx:if="{{item.specMap[childer.objectId].list}}">
+                <view class="buttom" wx:for="{{item.specMap[childer.objectId].list}}" wx:for-item="spec_item" wx:key="spec_item">
+                  <view class="price">
+                    <text class="price">{{spec_item.spec}} ¥{{spec_item.price}}</text>
+                  </view>
+                  <view class="add">
+                    <van-icon name="cross" />
+                    {{spec_item.count}}
+                  </view>
+                </view>
+              </block>
+              <block wx:else>
+                <view class="buttom">
+                  <view class="price">
+                    <text class="price">{{item.specMap[childer.objectId].spec}} ¥{{item.specMap[childer.objectId].price}}</text>
+                  </view>
+                  <view class="add">
+                    <van-icon name="cross" />
+                    {{item.specMap[childer.objectId].count}}
+                  </view>
+                </view>
+              </block>
+
+            </view>
+          </view>
+        </block>
+      </view>
+
+      <view class="li">
+        <van-cell title="支付时间:{{item.payTime}}" />
+        <van-cell title="发货信息" data-index="{{index}}" bind:tap="openShipments">
+          <block wx:if="{{item.distributeType!='delivery'}}">
+            自取
+          </block>
+          <block wx:elif="{{item.expressCompany.objectId&&item.trackingNumber}}">
+            {{item.expressCompany.name||'未知快递公司'}}
+            {{item.trackingNumber||'未知快递单号'}}
+          </block>
+          <block wx:else>
+            未发货(点击发货)
+          </block>
+        </van-cell>
+
+        <block wx:if="{{item.content||item.refundImgs.length>0}}">
+          <van-cell title="退款详情" />
+          <van-cell value="{{ item.content }}" />
+          <view style="display: flex;justify-content: flex-end;">
+            <block wx:for="{{item.refundImgs}}" wx:key="index" wx:for-index="ref_index" wx:for-item="ref_item">
+              <image data-list="{{item.refundImgs}}" bind:tap="previewImg" style="width: 100rpx;height: 100rpx;" src="{{ref_item}}" mode="aspectFit" />
+            </block>
+          </view>
+        </block>
+      </view>
+      <view class="totalPrice">合计:<text>¥{{item.totalPrice}}</text></view>
+
+      <view class="btn">
+        <!-- <button style="background:#d8faf8;color: #46a9a4;" data-index="{{index}}" bind:tap="delOrder">取消订单</button> -->
+        <button wx:if="{{item.distributeType=='delivery'&&item.status=='200'}}" data-index="{{index}}" bind:tap="openShipments">前往发货</button>
+        <button wx:if="{{item.distributeType=='verify'&&item.status=='200'}}" data-index="{{index}}" bind:tap="confirm_receipt">确认收货</button>
+        <button wx:if="{{item.status=='500'||item.status=='602'}}" data-index="{{index}}" bind:tap="agree_refund">同意退款</button>
+        <button wx:if="{{item.status=='500'}}" data-index="{{index}}" bind:tap="overrule_refund">驳回退款</button>
+        <button wx:if="{{item.status=='601'}}" data-index="{{index}}" bind:tap="confirm_refund">确认退款</button>
+      </view>
+    </view>
+
+
+
+  </block>
+</view>
+
+<!-- 发货弹框 -->
+<van-popup class="refund_popup" custom-style="height: 800rpx" show="{{ isShipments }}" position="bottom" round bind:close="closeShipments">
+  <view class="title">
+    发货
+  </view>
+  <view class="refundPopup">
+    <view class="address">
+      <view class="b">收</view>
+      <view class="address2">
+        <view class="address-address" data-text="{{shipments_order.info.address}}" bind:tap="onCopy">{{shipments_order.info.address||orderList[shipments_index].expressCompany.name||'暂无'}}</view>
+        <view class="name" data-text="{{shipments_order.info.name+' '+shipments_order.info.mobile}}" bind:tap="onCopy">{{shipments_order.info.name||''}} {{shipments_order.info.mobile||''}}</view>
+      </view>
+    </view>
+    <van-cell-group>
+      <van-cell bind:tap="openExpress" required title="快递公司" is-link value="{{checkExp.name||'请选择'}}" />
+      <van-field model:value="{{ trackingNumber }}" required clearable label="快递单号" placeholder="请输入快递单号" bind:click-icon="onClickIcon" />
+    </van-cell-group>
+    
+  </view>
+  <button bind:tap="confirmShipment">确认</button>
+</van-popup>
+
+
+<!-- 指针查询 -->
+<van-popup show="{{ isShowExpress }}" position="bottom" bind:close="closeExpress" round>
+  <view class="expressPopup">
+    <view class="title">选择快递公司</view>
+    <van-search bind:change="valChange" placeholder="请输入搜索关键词" />
+    <scroll-view class="itemBox" bindscrolltolower="getPointerItem" scroll-y>
+      <block wx:for="{{expComList}}" wx:for-item="pointer_item" wx:key="pointer_item">
+        <view class="item" data-index="{{index}}" bind:tap="checkPointer" style="color:{{checkExp.objectId==pointer_item.objectId?'#46a9a4':'black'}};">
+          {{pointer_item.name}}
+          <van-icon name="success" wx:if="{{checkExp.objectId==pointer_item.objectId}}" color="#46a9a4" />
+        </view>
+      </block>
+    </scroll-view>
+  </view>
+</van-popup>

+ 218 - 0
nova-tourism/pages/my/merchant/merchant-home/gift-order/index.wxss

@@ -0,0 +1,218 @@
+.order {
+  border-radius: 20rpx;
+  padding: 20px;
+  width: 93vw;
+  margin: 20rpx auto;
+  background: white;
+  box-shadow: 5rpx 5rpx 20rpx #46a9a473;
+}
+.order .orderNum {
+  font-size: 24rpx;
+  color: #46a9a4;
+  margin-bottom: 10rpx;
+  display: flex;
+  justify-content: space-between;
+}
+.order .orderNum text {
+  background: #d8faf8;
+  padding: 3rpx 8rpx;
+}
+.order .orderNum .tag {
+  padding: 5rpx 10rpx;
+  height: 43rpx;
+  font-size: 22rpx;
+  color: #46a9a4;
+  background: #d8faf8;
+}
+.order .orderNum .tag_errands {
+  color: orange;
+  background: rgba(255, 217, 0, 0.658);
+}
+.order .addressbox {
+  width: 100%;
+  border-bottom: 1rpx solid #e4e4e4;
+  padding-bottom: 20rpx;
+}
+.order .goodDetil {
+  margin: 20rpx 0;
+}
+.order .goodDetil .goodTitle {
+  font-size: 30rpx;
+  font-weight: bold;
+  margin: 20rpx 0;
+}
+.order .goodDetil .picturebox {
+  margin: 20rpx;
+  width: 100%;
+  display: flex;
+  align-items: center;
+}
+.order .goodDetil .picturebox .picture {
+  width: 120rpx;
+  height: 120rpx;
+  margin-left: 20rpx;
+}
+.order .goodDetil .weight {
+  font-size: 30rpx;
+  margin: 20rpx;
+}
+.order .staff {
+  font-size: 30rpx;
+}
+.order .staff text {
+  font-weight: bold;
+}
+.order .cart .good_item {
+  display: flex;
+  margin: 10rpx;
+  overflow: hidden;
+}
+.order .cart .good_item > image {
+  width: 170rpx;
+  height: 170rpx;
+  flex-shrink: 0;
+  padding: 10rpx;
+  border-radius: 10rpx;
+}
+.order .cart .good_item .left {
+  width: 470rpx;
+  margin: 10rpx 0rpx 10rpx 10rpx;
+}
+.order .cart .good_item .left .name {
+  font-size: 35rpx;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 2;
+  overflow: hidden;
+}
+.order .cart .good_item .left .desc {
+  margin: 10rpx 0;
+  width: 100%;
+  font-size: 25rpx;
+  color: #a0a0a0;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 1;
+  overflow: hidden;
+}
+.order .cart .good_item .left .buttom {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  margin-top: 6rpx;
+}
+.order .cart .good_item .left .buttom .price .price {
+  font-size: 26rpx;
+  color: #a0a0a0;
+}
+.order .cart .good_item .left .buttom .price .original {
+  font-size: 22rpx;
+  color: #a0a0a0;
+  text-decoration: line-through;
+}
+.order .cart .good_item .left .buttom .add {
+  margin-left: 10rpx;
+  width: 150rpx;
+  font-size: 26rpx;
+  color: #a0a0a0;
+}
+.order .totalPrice {
+  text-align: end;
+  font-size: 28rpx;
+  color: gray;
+}
+.order .totalPrice text {
+  color: red;
+  font-size: 36rpx;
+  font-weight: bold;
+}
+.order .btn {
+  height: 80rpx;
+}
+.order .btn button {
+  padding: 3rpx 15rpx;
+  float: right;
+  font-size: 28rpx;
+  background: #46a9a4;
+  color: white;
+  margin: 20rpx 0 10rpx 10rpx;
+}
+.refund_popup .title {
+  font-weight: bold;
+  padding: 20rpx;
+  font-size: 40rpx;
+  text-align: center;
+  border-bottom: #e4e4e4 1rpx solid;
+}
+.refund_popup .refundPopup {
+  padding: 30rpx;
+}
+.refund_popup .refundPopup .address {
+  width: 100%;
+  display: flex;
+  align-items: center;
+  margin-top: 15rpx;
+  padding-left: 10rpx;
+  padding-right: 10rpx;
+}
+.refund_popup .refundPopup .address .a {
+  padding: 5rpx 8rpx;
+  border-radius: 5rpx;
+  margin-right: 20rpx;
+  font-size: 25rpx;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background-color: #46a9a4;
+  color: #d8faf8;
+}
+.refund_popup .refundPopup .address .b {
+  padding: 5rpx 8rpx;
+  border-radius: 5rpx;
+  margin-right: 20rpx;
+  font-size: 25rpx;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background-color: #d8faf8;
+  color: #46a9a4;
+}
+.refund_popup .refundPopup .address .address2 {
+  width: 100%;
+  font-size: 30rpx;
+}
+.refund_popup .refundPopup .address .address2 .address-address {
+  color: #4e4e4e;
+  width: 100%;
+  display: flex;
+  align-items: center;
+}
+.refund_popup .refundPopup .address .address2 .name {
+  color: #afaeae;
+  margin-top: 10rpx;
+}
+.refund_popup button {
+  background: #46a9a4;
+  color: white;
+  width: 90vw;
+}
+.expressPopup {
+  width: 100%;
+  height: 70vh;
+}
+.expressPopup .title {
+  font-size: 30rpx;
+  height: 90rpx;
+  line-height: 90rpx;
+  text-align: center;
+  border-bottom: 1rpx solid whitesmoke;
+}
+.expressPopup .itemBox {
+  overflow-y: auto;
+  height: calc(70vh - 250rpx);
+}
+.expressPopup .itemBox .item {
+  padding: 20rpx;
+  font-size: 28rpx;
+  border-bottom: 1rpx solid whitesmoke;
+}

+ 362 - 305
nova-tourism/pages/my/merchant/merchant-home/index.js

@@ -3,352 +3,409 @@ const company = getApp().globalData.company
 const util = require('../../../../../utils/util.js')
 const dateF = require('../../../../../utils/date')
 const req = require('../../../../../utils/request')
-let uid = Parse.User.current()?.id
+
 Page({
 
-    /**
-     * 页面的初始数据
-     */
-    data: {
-        time: null,
-        store: null,
-        merchant: null,
-        totalCount: 0,
-        todayCount: 0,
-        totalPrice: 0,
-        todayPrice: 0,
-        withdraw: 0,
-        uid:null,
-    },
-
-    /**
-     * 生命周期函数--监听页面加载
-     */
-    onLoad: function (options) {
-      this.setData({uid:wx.getStorageSync('merchant')?.objectId||uid})
-        console.log(options)
-        var TIME = util.formatTime(new Date()); //当前时间
-        console.log(TIME);
-        let time = dateF.formatTime("YYYY-mm-dd", TIME)
-        this.setData({
-            time: time
-        });
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    time: null,
+    store: null,
+    merchant: null,
+    totalCount: 0,
+    todayCount: 0,
+    totalPrice: 0,
+    todayPrice: 0,
+    uid: null,
+    profit: 0, //分润
+  },
 
-        let merchant = wx.getStorageSync('merchant'); //用户
-        this.setData({ merchant: merchant })
-        if (!merchant) {
-            wx.redirectTo({
-                url: '/nova-tourism/pages/my/merchant/login/index'
-            });
-        }
-        this.getShopStore()
-    },
-
-
-    async getShopStore() {
-        let ShopStore = new Parse.Query('ShopStore')
-        ShopStore.equalTo('company', company)
-        ShopStore.equalTo('user', this.data.merchant.objectId)
-        let shopStore = await ShopStore.first()
-        if (shopStore && shopStore.id) {
-            let id = shopStore.toJSON().objectId
-            this.setData({
-                store: shopStore.toJSON()
-            })
-            console.log(this.data.store, 11111);
-            await this.getShopOrder(id)
-            await this.getTodayOrder(id)
-        } else {
-            wx.setStorageSync('store', undefined)
-            wx.setStorageSync('merchant', undefined)
-        }
-    },
-    async getShopOrder(id) {
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.setData({
+      uid: wx.getStorageSync('merchant')?.objectId
+    })
+    console.log(options)
+    var TIME = util.formatTime(new Date()); //当前时间
+    console.log(TIME);
+    let time = dateF.formatTime("YYYY-mm-dd", TIME)
+    this.setData({
+      time: time
+    });
+
+    let merchant = wx.getStorageSync('merchant'); //用户
+    this.setData({
+      merchant: merchant
+    })
+    if (!merchant) {
+      wx.redirectTo({
+        url: '/nova-tourism/pages/my/merchant/login/index'
+      });
+    }
+    this.refersh()
+  },
+  async refersh() {
+    await this.getShopStore()
+    if (!this.data.store?.objectId) return
+    this.getProfit()
+    await this.getShopOrder(this.data.store?.objectId)
+    await this.getTodayOrder(this.data.store?.objectId)
+  },
+  /**获取店铺 */
+  async getShopStore() {
+    let ShopStore = new Parse.Query('ShopStore')
+    ShopStore.equalTo('company', company)
+    ShopStore.equalTo('user', this.data.merchant.objectId)
+    let shopStore = await ShopStore.first()
+    if (shopStore && shopStore.id) {
+      let id = shopStore.toJSON().objectId
+      await this.setData({
+        store: shopStore.toJSON()
+      })
+
+    } else {
+      wx.setStorageSync('store', undefined)
+      wx.setStorageSync('merchant', undefined)
+    }
+  },
+
+  /**获取当前商户分润金额 */
+  async getProfit() {
+    let store_uid = wx.getStorageSync('merchant')?.objectId
+    if (!store_uid) return
+    let sql = `WITH t1 AS(--当前商户所绑定的用户
+    SELECT u."objectId" FROM "_User" u 
+    LEFT JOIN "ShopStore" s ON s."objectId" = u."store" 
+    WHERE s."user" = '${store_uid}'--当前店长uid
+  )
+  SELECT SUM((spec.value::json->>'invite-1')::FLOAT)
+  FROM "RoomOrder" o,
+  jsonb_each(o."incomeMap") AS spec (key, value)
+  WHERE o."company"='${company}'
+  AND o."isDeleted" IS NOT TRUE
+  AND o."isPay" IS TRUE
+  AND o."user" IN (SELECT "objectId" FROM t1)`
+    let data = await req.customSQL(sql)
+    console.log(data)
+    let profit = data[0]?.sum || 0
+    await this.setData({
+      profit
+    })
+    this.getWithdraw()
+  },
+  /**可提现金额=获取当前商户分润金额-申请提现金额 */
+  async getWithdraw() {
+    let sql = `select sum("count") as "withdraw" from "UserAgentWithdraw"
+        where "company" = '${company}' and "user" = '${this.data.merchant.objectId}' 
+        and "isDeleted" is not true
+        group by "user"`
+    let data = await req.customSQL(sql)
+    if (data && data.length > 0) {
+      // console.log(((this.data.profit||0)*1000 - (data[0].withdraw||0)*1000)/1000)
+      this.setData({
+        earnings: (this.data.profit - data[0].withdraw).toFixed(5)
+      })
+    } else {
+      this.setData({
+        earnings: this.data.profit
+      })
+    }
+    console.log(this.data.earnings)
+  },
 
-        let sql = ''
-        if (this.data.store.type == 'stay') {
-            sql = `select count("objectId") as "count", sum("price") as "totalPrice"  from "RoomOrder"
-           where "company" = '${company}' and "shopStore" = '${id}' and "isPay" = true 
+  /**获取累计订单数据 */
+  async getShopOrder(id) {
+    /**民宿订单sql */
+    let sql = ''
+    if (this.data.store.type == 'stay') {
+      sql = `select count("objectId") as "count", sum("price") as "totalPrice"  from "RoomOrder"
+           where "company" = '${company}' and "shopStore" = '${id}' and "isPay" = true and "isDeleted" is not true
            group by "shopStore"`
-        } else {
-            sql = `select count("objectId") as "count", sum("price") as "totalPrice"  from "ShopOrder"
+    } else {
+      sql = `select count("objectId") as "count", sum("totalPrice") as "totalPrice"  from "ShopOrder"
             where "company" = '${company}' and "shopStore" = '${id}' and "status" <> 100
             group by "shopStore"`
-        }
-        let data = await req.customSQL(sql)
-        console.log(data)
-        if (data && data.length > 0) {
-            this.setData({
-                totalCount: data[0].count,
-                totalPrice: data[0].totalPrice,
-            })
-        }
-        await this.getWithdraw()
-    },
+    }
+    let data = await req.customSQL(sql)
+    let gift_sql = `select count("objectId") as "count", sum("totalPrice") as "totalPrice"  from "Order"
+    where "company" = '${company}' and "store" = '${id}' and "isPay" = true and "isDeleted" is not true
+    group by "store"`
+    let gift_data = await req.customSQL(gift_sql)
+    let totalCount = parseFloat(data[0]?.count || 0) + parseFloat(gift_data[0]?.count || 0)
+    let totalPrice = ((parseFloat(data[0]?.totalPrice || 0) * 1000) + (parseFloat(gift_data[0]?.totalPrice || 0) * 1000)) / 1000
+    this.setData({
+      totalCount:totalCount||0,
+      totalPrice:totalPrice||0,
+      room_count: parseFloat(data[0]?.count || 0),
+      room_totalPrice: parseFloat(data[0]?.totalPrice || 0),
+      gift_count: parseFloat(gift_data[0]?.count || 0),
+      gift_totalPrice: parseFloat(gift_data[0]?.totalPrice || 0),
+    })
+  },
 
-    async getWithdraw() {
-        let sql = `select sum("count") as "withdraw" from "UserAgentWithdraw"
-        where "company" = '${company}' and "user" = '${this.data.merchant.objectId}' 
-        group by "user"`
 
-        let data = await req.customSQL(sql)
-        console.log(data)
-        if (data && data.length > 0) {
-            this.setData({
-                withdraw: data[0].withdraw,
-                earnings: (this.data.totalPrice - data[0].withdraw).toFixed(2)
-            })
-        } else {
-            this.setData({
-                earnings: this.data.totalPrice
-            })
-        }
-        console.log(this.data.earnings)
-    },
-
-    async getTodayOrder(id) {
-        var TIME = util.formatTime(new Date()); //当前时间
-        console.log(TIME);
-        let time = dateF.formatTime("YYYY-mm-dd 00:00:10", TIME)
-        console.log(time);
-        let sql = ''
-        if (this.data.store.type == 'stay') {
-            sql = `select count("objectId") as "count", sum("price") as "totalPrice"  from "RoomOrder"
+/** 获取今日订单数据*/
+  async getTodayOrder(id) {
+    var TIME = util.formatTime(new Date()); //当前时间
+    console.log(TIME);
+    let time = dateF.formatTime("YYYY-mm-dd 00:00:10", TIME)
+    console.log(time);
+    let sql = ''
+    if (this.data.store.type == 'stay') {
+      sql = `select count("objectId") as "count", sum("price") as "totalPrice"  from "RoomOrder"
            where "company" = '${company}' and "shopStore" = '${id}' and "isPay" = true and "createdAt" > '${time}'
            group by "shopStore"`
-        } else {
-            sql = `select count("objectId") as "count", sum("price") as "totalPrice"  from "ShopOrder"
+    } else {
+      sql = `select count("objectId") as "count", sum("price") as "totalPrice"  from "ShopOrder"
             where "company" = '${company}' and "shopStore" = '${id}' and "status" <> 100 and "createdAt" > '${time}'
             group by "shopStore"`
+    }
+    let data = await req.customSQL(sql)
+
+    let gift_sql = `select count("objectId") as "count", sum("totalPrice") as "totalPrice"  from "Order"
+    where "company" = '${company}' and "store" = '${id}' and "isPay" = true and "createdAt" > '${time}' and "isDeleted" is not true
+    group by "store"`
+    let gift_data = await req.customSQL(gift_sql)
+    let todayCount = parseFloat(data[0]?.count || 0) + parseFloat(gift_data[0]?.count || 0)
+    let todayPrice = ((parseFloat(data[0]?.totalPrice || 0) * 1000) + (parseFloat(gift_data[0]?.totalPrice || 0) * 1000)) / 1000
+    this.setData({
+      todayCount:todayCount||0,
+      todayPrice:todayPrice||0,
+      room_todayCount: parseFloat(data[0]?.count || 0),
+      room_todayPrice: parseFloat(data[0]?.totalPrice || 0),
+      gift_todayCount: parseFloat(gift_data[0]?.count || 0),
+      gift_todayPrice: parseFloat(gift_data[0]?.totalPrice || 0),
+    })
+
+  },
+
+  // orderlist() {
+  //     let storeId = this.data.store.objectId
+  //     wx.navigateTo({
+  //         url: '../merchant-home/order-list/index?storeId=' + storeId
+  //     });
+  // },
+  //民宿
+  order2list() {
+    let storeId = this.data.store.objectId
+    wx.navigateTo({
+      url: '../merchant-home/order2-list/index?storeId=' + storeId
+    });
+  },
+  giftOrder2list() {
+    let storeId = this.data.store.objectId
+    wx.navigateTo({
+      url: '../merchant-home/gift-order/index?storeId=' + storeId
+    });
+  },
+  // order3list() {
+  //     let storeId = this.data.store.objectId
+  //     wx.navigateTo({
+  //         url: '../merchant-home/order3-list/index?storeId=' + storeId
+  //     });
+  // },
+
+  // goods() {
+  //     let id = this.data.store.objectId
+  //     wx.navigateTo({
+  //         url: '/nova-tourism/pages/my/merchant/merchant-home/goods/index?id=' + id
+  //     });
+
+  // },
+
+  logout() {
+    wx.showModal({
+      title: '确认要退出吗?',
+      showCancel: true,
+      success(res) {
+        if (res.confirm) {
+          wx.removeStorageSync('merchant')
+          wx.removeStorageSync('store')
+          wx.navigateTo({
+            url: '../../../../pages/index/index'
+          })
+        } else {
+
         }
-        let data = await req.customSQL(sql)
-        if (data && data.length > 0) {
-            this.setData({
-                todayCount: data[0].count,
-                todayPrice: data[0].totalPrice,
-            })
-        }
+      }
+    })
+  },
+  package() {
 
-    },
-
-    // orderlist() {
-    //     let storeId = this.data.store.objectId
-    //     wx.navigateTo({
-    //         url: '../merchant-home/order-list/index?storeId=' + storeId
-    //     });
-    // },
-    //民宿
-    order2list() {
-        let storeId = this.data.store.objectId
-        wx.navigateTo({
-            url: '../merchant-home/order2-list/index?storeId=' + storeId
-        });
-    },
-    // order3list() {
-    //     let storeId = this.data.store.objectId
-    //     wx.navigateTo({
-    //         url: '../merchant-home/order3-list/index?storeId=' + storeId
-    //     });
-    // },
-
-    // goods() {
-    //     let id = this.data.store.objectId
-    //     wx.navigateTo({
-    //         url: '/nova-tourism/pages/my/merchant/merchant-home/goods/index?id=' + id
-    //     });
-
-    // },
-
-    logout() {
-        wx.showModal({
-            title: '确认要退出吗?',
-            showCancel: true,
-            success(res) {
-                if (res.confirm) {
-                    wx.removeStorageSync('merchant')
-                    wx.removeStorageSync('store')
-                    wx.navigateTo({
-                        url: '../../../../pages/index/index'
-                    })
-                } else {
-
-                }
-            }
-        })
-    },
-    package() {
+    wx.navigateTo({
+      url: '/nova-tourism/pages/my/merchant/merchant-home/package/index'
+    });
 
-        wx.navigateTo({
-            url: '/nova-tourism/pages/my/merchant/merchant-home/package/index'
-        });
+  },
+  dishes() {
+    let id = this.data.store.objectId
+    wx.navigateTo({
+      url: '/nova-tourism/pages/my/merchant/merchant-home/dishes/index?id=' + id
+    });
 
-    },
-    dishes() {
-        let id = this.data.store.objectId
-        wx.navigateTo({
-            url: '/nova-tourism/pages/my/merchant/merchant-home/dishes/index?id=' + id
-        });
+  },
+  tables() {
+    let id = this.data.store.objectId
+    wx.navigateTo({
+      url: '/nova-tourism/pages/my/merchant/merchant-home/tables/index?id=' + id
+    });
 
-    },
-    tables() {
-        let id = this.data.store.objectId
-        wx.navigateTo({
-            url: '/nova-tourism/pages/my/merchant/merchant-home/tables/index?id=' + id
-        });
+  },
+  // category() {
+  //     let id = this.data.store.objectId
+  //     let type = this.data.store.type
+  //     wx.navigateTo({
+  //         url: `/nova-tourism/pages/my/merchant/merchant-home/category/index?id=${id}&&type=${type}`
+  //     });
+
+  // },
+  goodmanage() {
+    wx.navigateTo({
+      url: '../good/good-list/index'
+    });
 
-    },
-    // category() {
-    //     let id = this.data.store.objectId
-    //     let type = this.data.store.type
-    //     wx.navigateTo({
-    //         url: `/nova-tourism/pages/my/merchant/merchant-home/category/index?id=${id}&&type=${type}`
-    //     });
-
-    // },
-    goodmanage() {
-      wx.navigateTo({
-          url: '../good/good-list/index'
-      });
+  },
+  roommanage() {
+    wx.navigateTo({
+      url: '../room-manage/index'
+    });
+
+  },
+  account() {
+    wx.navigateTo({
+      url: '../merchant-home/account/index'
+    });
 
   },
-    roommanage() {
+
+  comments() {
+    switch (this.data.store.type) {
+      case 'stay':
         wx.navigateTo({
-            url: '../room-manage/index'
+          url: '../../merchant/comments/hotel/index'
         });
-
-    },
-    account() {
+        break;
+      case 'catering':
         wx.navigateTo({
-            url: '../merchant-home/account/index'
+          url: '/nova-tourism/pages/my/merchant/comments/setmeal/index'
         });
+        break;
+      case 'shop':
+        wx.navigateTo({
+          url: '/nova-tourism/pages/my/merchant/comments/setmeal/index'
+        });
+        break;
+      default:
+        break;
+    }
 
-    },
-
-    comments() {
-        switch (this.data.store.type) {
-            case 'stay':
-                wx.navigateTo({
-                    url: '../../merchant/comments/hotel/index'
-                });
-                break;
-            case 'catering':
-                wx.navigateTo({
-                    url: '/nova-tourism/pages/my/merchant/comments/setmeal/index'
-                });
-                break;
-            case 'shop':
-                wx.navigateTo({
-                    url: '/nova-tourism/pages/my/merchant/comments/setmeal/index'
-                });
-                break;
-            default:
-                break;
-        }
+  },
 
-    },
-
-
-    async codeVerify() {
-        console.log(this.data.store.type);
-        let that = this
-        wx.scanCode({
-            success(res) {
-                let content = res.result
-                console.log(content)
-                let code1 =content|| content.match(/\id=(.*)/)[1]
-                console.log(code1);
-                switch (that.data.store.type) {
-                    case 'stay':
-                        wx.navigateTo({
-                            url: `../code-verify/index?id=${code1}`
-                        });
-                        break;
-                    case 'catering':
-                        wx.navigateTo({
-                            url: `/nova-tourism/pages/shop-admin/index?id=${code1}`
-                        });
-                        break;
-                    case 'shop':
-                        wx.navigateTo({
-                            url: `/nova-tourism/pages/shop-admin/index?id=${code1}`
-                        });
-                        break;
-                    default:
-                        break;
-                }
-                // wx.navigateTo({
-                //     url: `/nova-tourism/pages/my/merchant/code-verify/index?id=${res.id}`
-                // });
-            },
-            fail(err) {
-                console.log(err)
-                wx.showToast({
-                    title: '扫码失败,请确认二维码信息正确',
-                    icon: 'none'
-                })
-            }
-        })
-    },
-    toWithdraw() {
-        let id = this.data.store.storeName
-        wx.navigateTo({
-            url: `../../merchant/merchant-home/store-withdraw/index?earnings=${this.data.earnings}&&id=${id}`,
+
+  async codeVerify() {
+    console.log(this.data.store.type);
+    let that = this
+    wx.scanCode({
+      success(res) {
+        let content = res.result
+        console.log(content)
+        let code1 = content || content.match(/\id=(.*)/)[1]
+        console.log(code1);
+        switch (that.data.store.type) {
+          case 'stay':
+            wx.navigateTo({
+              url: `../code-verify/index?id=${code1}`
+            });
+            break;
+          case 'catering':
+            wx.navigateTo({
+              url: `/nova-tourism/pages/shop-admin/index?id=${code1}`
+            });
+            break;
+          case 'shop':
+            wx.navigateTo({
+              url: `/nova-tourism/pages/shop-admin/index?id=${code1}`
+            });
+            break;
+          default:
+            break;
+        }
+        // wx.navigateTo({
+        //     url: `/nova-tourism/pages/my/merchant/code-verify/index?id=${res.id}`
+        // });
+      },
+      fail(err) {
+        console.log(err)
+        wx.showToast({
+          title: '扫码失败,请确认二维码信息正确',
+          icon: 'none'
         })
-    },
+      }
+    })
+  },
+  toWithdraw() {
+    let id = this.data.store.storeName
+    wx.navigateTo({
+      url: `../../merchant/merchant-home/store-withdraw/index?earnings=${this.data.profit||0}&&id=${id}`,
+    })
+  },
 
-    gourl(e) {
-      const url = e.currentTarget.dataset.url;
-      wx.navigateTo({
-          url: `${url}`,
-      });
+  gourl(e) {
+    const url = e.currentTarget.dataset.url;
+    wx.navigateTo({
+      url: `${url}`,
+    });
   },
 
-    /**
-     * 生命周期函数--监听页面初次渲染完成
-     */
-    onReady: function () {
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
 
-    },
+  },
 
-    /**
-     * 生命周期函数--监听页面显示
-     */
-    onShow: function () {
-        this.getShopStore()
-    },
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    // this.getShopStore()
+  },
 
-    /**
-     * 生命周期函数--监听页面隐藏
-     */
-    onHide: function () {
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
 
-    },
+  },
 
-    /**
-     * 生命周期函数--监听页面卸载
-     */
-    onUnload: function () {
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
 
-    },
+  },
 
-    /**
-     * 页面相关事件处理函数--监听用户下拉动作
-     */
-    onPullDownRefresh: function () {
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
 
-    },
+  },
 
-    /**
-     * 页面上拉触底事件的处理函数
-     */
-    onReachBottom: function () {
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
 
-    },
+  },
 
-    /**
-     * 用户点击右上角分享
-     */
-    onShareAppMessage: function () {
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
 
-    }
+  }
 })

+ 35 - 4
nova-tourism/pages/my/merchant/merchant-home/index.less

@@ -35,7 +35,15 @@ page {
 
                 .order-titles {
                     text-align: center;
-                    margin: 30rpx 0;
+                    margin: 5rpx 0;
+                    height: 99rpx;
+
+                    .item{
+                        font-size: 25rpx;
+                    }
+                    .gray{
+                        color:rgb(185, 185, 185);
+                    }
                 }
             }
 
@@ -47,7 +55,15 @@ page {
 
                 .order-titles {
                     text-align: center;
-                    margin: 30rpx 0;
+                    margin: 5rpx 0;
+                    height: 99rpx;
+
+                    .item{
+                        font-size: 25rpx;
+                    }
+                    .gray{
+                        color:rgb(185, 185, 185);
+                    }
                 }
             }
         }
@@ -65,7 +81,15 @@ page {
 
                 .order-titles {
                     text-align: center;
-                    margin: 30rpx 0;
+                    margin: 5rpx 0;
+                    height: 99rpx;
+
+                    .item{
+                        font-size: 25rpx;
+                    }
+                    .gray{
+                        color:rgb(185, 185, 185);
+                    }
                 }
             }
 
@@ -77,7 +101,14 @@ page {
 
                 .order-titles {
                     text-align: center;
-                    margin: 30rpx 0;
+                    margin: 5rpx 0;
+                    height: 99rpx;
+                    .item{
+                        font-size: 25rpx;
+                    }
+                    .gray{
+                        color:rgb(185, 185, 185);
+                    }
                 }
             }
         }

+ 25 - 12
nova-tourism/pages/my/merchant/merchant-home/index.wxml

@@ -4,10 +4,6 @@
     <image class="store-img" src="{{store.cover}}" />
     <view class="store-box">
       <view class="store-name">{{store.storeName}}</view>
-      <!-- <view class="store-score">
-                <van-rate readonly value="{{ store.score }}" size="{{ 15 }}" color="#fd863a" allow-half />
-                {{store.score}}
-            </view> -->
       <view class="draw_box" style="margin-top: 10rpx;">
         <view class="withdraw" bindtap="toWithdraw">
           提现
@@ -15,31 +11,41 @@
         <view>
           可提现 {{earnings}} 元
         </view>
-
       </view>
-
-
     </view>
   </view>
   <view class="business">
     <view class="business-x">
       <view class="order-number">
         <view class="order-title">总订单数</view>
-        <view class="order-titles">{{totalCount}}</view>
+        <view class="order-titles">
+          <view class="item gray">民宿:{{room_count||0}},商品:{{gift_count||0}}</view>
+          <view class="item">合计:{{totalCount}}</view>
+        </view>
       </view>
       <view class="order-today">
         <view class="order-title">今日订单数</view>
-        <view class="order-titles">{{todayCount}}</view>
+        <view class="order-titles">
+          <view class="item gray">民宿:{{room_todayCount||0}},商品:{{gift_todayCount||0}}</view>
+          <view class="item">合计:{{todayCount}}</view>
+        </view>
       </view>
     </view>
     <view class="business-y">
       <view class="order-number">
         <view class="order-title">总营业额</view>
-        <view class="order-titles">{{totalPrice}}</view>
+        <view class="order-titles">
+          <view class="item gray">民宿:{{room_totalPrice||0}},商品:{{gift_totalPrice||0}}</view>
+          <view class="item"></view>
+          <view class="item">合计:{{totalPrice}}</view>
+        </view>
       </view>
       <view class="order-today">
         <view class="order-title">今日营业额</view>
-        <view class="order-titles">{{todayPrice}}</view>
+        <view class="order-titles">
+          <view class="item gray">民宿:{{room_todayPrice||0}} ,商品:{{gift_todayPrice||0}}</view>
+          <view class="item">合计:{{todayPrice}}</view>
+        </view>
       </view>
     </view>
   </view>
@@ -58,7 +64,14 @@
       <view class="box-title" bindtap="order2list">
         <view class="box-details">
           <van-icon name="https://file-cloud.fmode.cn/sHNeVwSaAg/20230705/dkdoeo112500451.png" size="20" />
-          <view class="name">订单管理</view>
+          <view class="name">民宿订单管理</view>
+        </view>
+        <van-icon name="arrow" />
+      </view>
+      <view class="box-title" bindtap="giftOrder2list">
+        <view class="box-details">
+          <van-icon name="https://file-cloud.fmode.cn/sHNeVwSaAg/20230705/dkdoeo112500451.png" size="20" />
+          <view class="name">商品订单管理</view>
         </view>
         <van-icon name="arrow" />
       </view>

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
nova-tourism/pages/my/merchant/merchant-home/index.wxss


+ 35 - 6
nova-tourism/pages/my/merchant/merchant-home/my-users/index.js

@@ -1,4 +1,8 @@
 // nova-tourism/pages/my/merchant/merchant-home/my-users/index.js
+let Parse = getApp().Parse;
+const company = getApp().globalData.company
+const uid = Parse.User.current()?.id
+
 Page({
 
   /**
@@ -12,18 +16,43 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
-    this.agentParent()
+    this.getToStoreUser()
+  },
+  /** 获取本店用户*/
+  async getToStoreUser() {
+    let {
+      users
+    } = this.data
+    let toStoreUid = wx.getStorageSync('merchant')?.objectId
+    let store = wx.getStorageSync('store')?.objectId
+    if (!toStoreUid) return
+    if (!store) return
+    let query = new Parse.Query('_User')
+    query.equalTo('company', company);
+    query.equalTo('store', store);
+    query.notEqualTo('isDeleted', true);
+    query.limit(30)
+    query.skip(users?.length || 0)
+    let r = await query.find()
+    let list = r?.map(item => item?.toJSON())
+    this.setData({
+      users: [...users, ...(list || [])]
+    })
   },
+
+
   async agentParent() {
     if (!wx.getStorageSync('merchant')?.objectId) return
     let that = this
-    let {users} = this.data
+    let {
+      users
+    } = this.data
     wx.request({
       url: 'https://server.fmode.cn/api/user/agent/children',
       data: {
         uid: wx.getStorageSync('merchant')?.objectId,
-        limit:50,
-        skip:users?.length||0
+        limit: 50,
+        skip: users?.length || 0
       },
       header: {
         'content-type': 'application/json'
@@ -34,7 +63,7 @@ Page({
       success: (result) => {
         console.log(result);
         that.setData({
-          users:[...users,...(result?.data?.data||[])]
+          users: [...users, ...(result?.data?.data || [])]
         })
       },
       fail: () => {},
@@ -80,7 +109,7 @@ Page({
    * 页面上拉触底事件的处理函数
    */
   onReachBottom() {
-    this.agentParent()
+    this.getToStoreUser()
   },
 
   /**

+ 2 - 1
nova-tourism/pages/my/merchant/merchant-home/order2-list/index.wxml

@@ -101,4 +101,5 @@
                 </block>
             </view> -->
     </view>
-</block>
+</block>
+<van-empty wx:if="{{list.length<=0}}" description="暂无订单" />

+ 8 - 8
nova-tourism/pages/my/merchant/merchant-home/store-withdraw/index.js

@@ -56,14 +56,14 @@ Page({
             });
             return
         }
-        if (this.data.price < 1000) {
-            wx.showToast({
-                title: '最低提现金额为1000元',
-                icon: 'none',
-
-            });
-            return
-        }
+        // if (this.data.price < 1000) {
+        //     wx.showToast({
+        //         title: '最低提现金额为1000元',
+        //         icon: 'none',
+
+        //     });
+        //     return
+        // }
 
         if (!this.data.name) {
             wx.showToast({

+ 1 - 1
nova-tourism/pages/my/merchant/merchant-home/store-withdraw/index.wxml

@@ -37,4 +37,4 @@
         </block>
     </view>
 </view>
-<view class="withdrawal" bindtap="getUserAgentWithdraw">提</view>
+<view class="withdrawal" bindtap="getUserAgentWithdraw">提</view>

+ 28 - 1
nova-tourism/service/request.js

@@ -173,10 +173,37 @@ function getDays(date1, date2) {
   return daysDiff;
 }
 
+/**
+ * 用户绑定邀请关系和店铺
+ * @param {*} uid 用户id
+ * @param {*} shop_id 店铺id
+ */
+async function bindShop(uid, shop_id) {
+  console.log(uid, shop_id)
+  wx.request({
+    url: "https://server.fmode.cn/api/yswx/bindShop",
+    data: {
+      uid, shop_id
+    },
+    method: "POST",
+    success(success) {
+      console.log('成功')
+    console.log(success)
+    return success
+    },
+    fail(err) {
+      console.log('失败')
+      console.log(err)
+      return err
+    },
+  });
+}
+
+
 module.exports = {
   getStores,
   getAddress,
   isFree,
   getRoomOccupiaDate,
-  getDays
+  getDays,bindShop
 };

+ 6 - 6
project.private.config.json

@@ -8,16 +8,16 @@
     "miniprogram": {
       "list": [
         {
-          "name": "nova-tourism/pages/homestay/homestay-detail/index",
-          "pathName": "nova-tourism/pages/homestay/homestay-detail/index",
-          "query": "store_id=6XHZx7FkON&start=2025-04-18&end=2025-04-19",
+          "name": "nova-tourism/pages/my/merchant/merchant-home/gift-order/index",
+          "pathName": "nova-tourism/pages/my/merchant/merchant-home/gift-order/index",
+          "query": "storeId=wMpDxcTLBL",
           "launchMode": "default",
           "scene": null
         },
         {
-          "name": "nova-tourism/pages/my/sharing/index",
-          "pathName": "nova-tourism/pages/my/sharing/index",
-          "query": "path=yswx&uid=lfBs1y1d3y",
+          "name": "nova-tourism/pages/my/merchant/merchant-home/index",
+          "pathName": "nova-tourism/pages/my/merchant/merchant-home/index",
+          "query": "type=stay",
           "launchMode": "default",
           "scene": null
         }

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels