Browse Source

新增酒店预订

xiaoshushu 3 năm trước cách đây
mục cha
commit
c093461a49
39 tập tin đã thay đổi với 2154 bổ sung82 xóa
  1. 61 4
      smart-admin/src/main/java/com/huijy/web/controller/api/ApiIndexController.java
  2. 103 0
      smart-admin/src/main/java/com/huijy/web/controller/management/ShopRoomController.java
  3. 103 0
      smart-admin/src/main/java/com/huijy/web/controller/management/ShopRoomOrderController.java
  4. 12 0
      smart-system/src/main/java/com/huijy/management/domain/Shop.java
  5. 112 0
      smart-system/src/main/java/com/huijy/management/domain/ShopRoom.java
  6. 172 0
      smart-system/src/main/java/com/huijy/management/domain/ShopRoomOrder.java
  7. 4 2
      smart-system/src/main/java/com/huijy/management/mapper/ShopMapper.java
  8. 64 0
      smart-system/src/main/java/com/huijy/management/mapper/ShopRoomMapper.java
  9. 61 0
      smart-system/src/main/java/com/huijy/management/mapper/ShopRoomOrderMapper.java
  10. 61 0
      smart-system/src/main/java/com/huijy/management/service/IShopRoomOrderService.java
  11. 64 0
      smart-system/src/main/java/com/huijy/management/service/IShopRoomService.java
  12. 5 2
      smart-system/src/main/java/com/huijy/management/service/IShopService.java
  13. 95 0
      smart-system/src/main/java/com/huijy/management/service/impl/ShopRoomOrderServiceImpl.java
  14. 94 0
      smart-system/src/main/java/com/huijy/management/service/impl/ShopRoomServiceImpl.java
  15. 13 14
      smart-system/src/main/java/com/huijy/management/service/impl/ShopServiceImpl.java
  16. 4 0
      smart-system/src/main/resources/mapper/management/ShopMapper.xml
  17. 84 0
      smart-system/src/main/resources/mapper/management/ShopRoomMapper.xml
  18. 101 0
      smart-system/src/main/resources/mapper/management/ShopRoomOrderMapper.xml
  19. 59 2
      smart-ui-app/common/common.scss
  20. 9 3
      smart-ui-app/common/http.js
  21. 48 0
      smart-ui-app/common/util.js
  22. 51 23
      smart-ui-app/pages.json
  23. 1 1
      smart-ui-app/pages/index/index.vue
  24. 272 0
      smart-ui-app/pages/index/index2.vue
  25. 0 0
      smart-ui-app/pages/order/my.vue
  26. 0 0
      smart-ui-app/pages/order/sale.vue
  27. 0 0
      smart-ui-app/pages/shop/detail.vue
  28. 203 0
      smart-ui-app/pages/shop/hotel/detail.vue
  29. 61 0
      smart-ui-app/pages/shop/hotel/index.vue
  30. 19 0
      smart-ui-app/pages/shop/hotel/my.vue
  31. 206 0
      smart-ui-app/pages/shop/hotel/room.vue
  32. 1 21
      smart-ui-app/pages/shop/list.vue
  33. BIN
      smart-ui-app/static/a15.jpg
  34. BIN
      smart-ui-app/static/aa2.jpg
  35. BIN
      smart-ui-app/static/aa3.jpg
  36. BIN
      smart-ui-app/static/bjt.jpg
  37. BIN
      smart-ui-app/static/img11.jpg
  38. BIN
      smart-ui-app/static/lo.png
  39. 11 10
      smart-ui-app/uview-ui/components/u-upload/u-upload.vue

+ 61 - 4
smart-admin/src/main/java/com/huijy/web/controller/api/ApiIndexController.java

@@ -61,6 +61,12 @@ public class ApiIndexController extends ApiAbstractController {
     @Autowired
     private ServerConfig serverConfig;
 
+    @Autowired
+    private IShopRoomService roomService;
+
+    @Autowired
+    private IShopRoomOrderService orderService;
+
 
     //绑定手机号
     @PostMapping("/bindMobile")
@@ -275,9 +281,9 @@ public class ApiIndexController extends ApiAbstractController {
             return AjaxResult.error("提交数据为空");
         }
         //未审核时才允许更新门店信息
-        if (shop.getAuditFlag().equals("0")||shop.getAuditFlag().equals("2")) {
+        if (shop.getAuditFlag().equals("0") || shop.getAuditFlag().equals("2")) {
             //审核不通过重新提交材料,把审核状态改为待审核
-            if(shop.getAuditFlag().equals("2")){
+            if (shop.getAuditFlag().equals("2")) {
                 shop.setAuditFlag("0");
             }
             shopService.updateShop(shop);
@@ -312,7 +318,6 @@ public class ApiIndexController extends ApiAbstractController {
     }
 
     //门店数据上报
-
     @PostMapping("/pushRecord")
     @ApiOperation("门店数据上报")
     @Transactional
@@ -320,11 +325,63 @@ public class ApiIndexController extends ApiAbstractController {
         if (shopSalesRecord == null) {
             AjaxResult.error("上传数据为空");
         }
-        System.out.println("asdasd:"+shopSalesRecord.getShopGuestRecordList());
         shopSalesRecordService.insertShopSalesRecord(shopSalesRecord);
         return AjaxResult.success();
     }
 
+    //获取酒店房间
+    @GetMapping("/roomList")
+    @ApiOperation("获取酒店房间")
+    public AjaxResult getRoom(@RequestParam Long shopId) {
+        List<ShopRoom> list = roomService.selectShopRoomByShopId(shopId);
+        return AjaxResult.success(list);
+    }
+
+    //商家添加酒店房间
+    @PostMapping("/roomAdd")
+    @ApiOperation("商家添加酒店房间")
+    public AjaxResult roomAdd(@RequestBody ShopRoom room) {
+        if (room.getId() == null) {
+            return AjaxResult.success(roomService.insertShopRoom(room));
+        } else {
+            return AjaxResult.success(roomService.updateShopRoom(room));
+        }
+    }
+
+    //酒店列表
+    @GetMapping("/hotelList")
+    @ApiOperation("酒店列表")
+    public AjaxResult hotelList() {
+        List<Shop> list = shopService.selectShopByHotel();
+        return AjaxResult.success(list);
+    }
+
+    //酒店详情
+    @GetMapping("/hotelDetail")
+    @ApiOperation("酒店详情")
+    public AjaxResult hotelDetail(Long shopId) {
+        Shop shop = shopService.selectShopByShopId(shopId);
+        if (shop != null) {
+            List<ShopRoom> list = roomService.selectShopRoomByShopId(shop.getShopId());
+            shop.setRooms(list);
+        }
+        return AjaxResult.success(shop);
+    }
+
+    //酒店预订
+    @PostMapping("/hotelBook")
+    @ApiOperation("酒店预订")
+    public AjaxResult hotelBook(@RequestBody ShopRoomOrder order) {
+        return AjaxResult.success(orderService.insertShopRoomOrder(order));
+    }
+
+    //商家删除酒店房间
+    @GetMapping("/roomDel")
+    @ApiOperation("商家删除酒店房间")
+    public AjaxResult roomDel(Long id) {
+        return AjaxResult.success(roomService.deleteShopRoomById(id));
+    }
+
     //返回标记物类型
     @PostMapping("/getMarkerType")
     @ApiOperation("获取标记物类型")

+ 103 - 0
smart-admin/src/main/java/com/huijy/web/controller/management/ShopRoomController.java

@@ -0,0 +1,103 @@
+package com.huijy.web.controller.management;
+
+import java.util.List;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.huijy.common.annotation.Log;
+import com.huijy.common.core.controller.BaseController;
+import com.huijy.common.core.domain.AjaxResult;
+import com.huijy.common.enums.BusinessType;
+import com.huijy.management.domain.ShopRoom;
+import com.huijy.management.service.IShopRoomService;
+import com.huijy.common.utils.poi.ExcelUtil;
+import com.huijy.common.core.page.TableDataInfo;
+
+/**
+ * 酒店房间Controller
+ *
+ * @author lishuwen
+ * @date 2021-11-10
+ */
+@RestController
+@RequestMapping("/management/room")
+public class ShopRoomController extends BaseController
+{
+    @Autowired
+    private IShopRoomService shopRoomService;
+
+    /**
+     * 查询酒店房间列表
+     */
+    @PreAuthorize("@ss.hasPermi('management:room:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(ShopRoom shopRoom)
+    {
+        startPage();
+        List<ShopRoom> list = shopRoomService.selectShopRoomList(shopRoom);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出酒店房间列表
+     */
+    @PreAuthorize("@ss.hasPermi('management:room:export')")
+    @Log(title = "酒店房间", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(ShopRoom shopRoom)
+    {
+        List<ShopRoom> list = shopRoomService.selectShopRoomList(shopRoom);
+        ExcelUtil<ShopRoom> util = new ExcelUtil<ShopRoom>(ShopRoom.class);
+        return util.exportExcel(list, "酒店房间数据");
+    }
+
+    /**
+     * 获取酒店房间详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('management:room:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(shopRoomService.selectShopRoomById(id));
+    }
+
+    /**
+     * 新增酒店房间
+     */
+    @PreAuthorize("@ss.hasPermi('management:room:add')")
+    @Log(title = "酒店房间", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ShopRoom shopRoom)
+    {
+        return toAjax(shopRoomService.insertShopRoom(shopRoom));
+    }
+
+    /**
+     * 修改酒店房间
+     */
+    @PreAuthorize("@ss.hasPermi('management:room:edit')")
+    @Log(title = "酒店房间", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody ShopRoom shopRoom)
+    {
+        return toAjax(shopRoomService.updateShopRoom(shopRoom));
+    }
+
+    /**
+     * 删除酒店房间
+     */
+    @PreAuthorize("@ss.hasPermi('management:room:remove')")
+    @Log(title = "酒店房间", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(shopRoomService.deleteShopRoomByIds(ids));
+    }
+}

+ 103 - 0
smart-admin/src/main/java/com/huijy/web/controller/management/ShopRoomOrderController.java

@@ -0,0 +1,103 @@
+package com.huijy.web.controller.management;
+
+import java.util.List;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.huijy.common.annotation.Log;
+import com.huijy.common.core.controller.BaseController;
+import com.huijy.common.core.domain.AjaxResult;
+import com.huijy.common.enums.BusinessType;
+import com.huijy.management.domain.ShopRoomOrder;
+import com.huijy.management.service.IShopRoomOrderService;
+import com.huijy.common.utils.poi.ExcelUtil;
+import com.huijy.common.core.page.TableDataInfo;
+
+/**
+ * 酒店房间预订Controller
+ *
+ * @author lishuwen
+ * @date 2021-11-10
+ */
+@RestController
+@RequestMapping("/management/order")
+public class ShopRoomOrderController extends BaseController
+{
+    @Autowired
+    private IShopRoomOrderService shopRoomOrderService;
+
+    /**
+     * 查询酒店房间预订列表
+     */
+    @PreAuthorize("@ss.hasPermi('management:order:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(ShopRoomOrder shopRoomOrder)
+    {
+        startPage();
+        List<ShopRoomOrder> list = shopRoomOrderService.selectShopRoomOrderList(shopRoomOrder);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出酒店房间预订列表
+     */
+    @PreAuthorize("@ss.hasPermi('management:order:export')")
+    @Log(title = "酒店房间预订", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(ShopRoomOrder shopRoomOrder)
+    {
+        List<ShopRoomOrder> list = shopRoomOrderService.selectShopRoomOrderList(shopRoomOrder);
+        ExcelUtil<ShopRoomOrder> util = new ExcelUtil<ShopRoomOrder>(ShopRoomOrder.class);
+        return util.exportExcel(list, "酒店房间预订数据");
+    }
+
+    /**
+     * 获取酒店房间预订详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('management:order:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(shopRoomOrderService.selectShopRoomOrderById(id));
+    }
+
+    /**
+     * 新增酒店房间预订
+     */
+    @PreAuthorize("@ss.hasPermi('management:order:add')")
+    @Log(title = "酒店房间预订", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ShopRoomOrder shopRoomOrder)
+    {
+        return toAjax(shopRoomOrderService.insertShopRoomOrder(shopRoomOrder));
+    }
+
+    /**
+     * 修改酒店房间预订
+     */
+    @PreAuthorize("@ss.hasPermi('management:order:edit')")
+    @Log(title = "酒店房间预订", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody ShopRoomOrder shopRoomOrder)
+    {
+        return toAjax(shopRoomOrderService.updateShopRoomOrder(shopRoomOrder));
+    }
+
+    /**
+     * 删除酒店房间预订
+     */
+    @PreAuthorize("@ss.hasPermi('management:order:remove')")
+    @Log(title = "酒店房间预订", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(shopRoomOrderService.deleteShopRoomOrderByIds(ids));
+    }
+}

+ 12 - 0
smart-system/src/main/java/com/huijy/management/domain/Shop.java

@@ -1,6 +1,8 @@
 package com.huijy.management.domain;
 
 import java.util.Date;
+import java.util.List;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.huijy.common.annotation.Excel;
 import com.huijy.common.core.domain.BaseEntity;
@@ -95,6 +97,16 @@ public class Shop extends BaseEntity
      */
     private String shopType;
 
+    private List<ShopRoom>rooms;
+
+    public List<ShopRoom> getRooms() {
+        return rooms;
+    }
+
+    public void setRooms(List<ShopRoom> rooms) {
+        this.rooms = rooms;
+    }
+
     public void setShopId(Long shopId)
     {
         this.shopId = shopId;

+ 112 - 0
smart-system/src/main/java/com/huijy/management/domain/ShopRoom.java

@@ -0,0 +1,112 @@
+package com.huijy.management.domain;
+
+import com.huijy.common.annotation.Excel;
+import com.huijy.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 酒店房间对象 tb_shop_room
+ *
+ * @author lishuwen
+ * @date 2021-11-10
+ */
+public class ShopRoom extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * id
+     */
+    private Long id;
+
+    /**
+     * $column.columnComment
+     */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private Long shopId;
+
+    /**
+     * 房间类型
+     */
+    @Excel(name = "房间类型")
+    private String title;
+
+    /**
+     * 房间价格
+     */
+    @Excel(name = "房间价格")
+    private String price;
+
+    /**
+     * 房间图片
+     */
+    @Excel(name = "房间图片")
+    private String pic;
+
+    /**
+     * 房间数量
+     */
+    @Excel(name = "房间数量")
+    private String nums;
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setShopId(Long shopId) {
+        this.shopId = shopId;
+    }
+
+    public Long getShopId() {
+        return shopId;
+    }
+
+    public void setTitle(String room) {
+        this.title = room;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setPrice(String price) {
+        this.price = price;
+    }
+
+    public String getPrice() {
+        return price;
+    }
+
+    public void setPic(String pic) {
+        this.pic = pic;
+    }
+
+    public String getPic() {
+        return pic;
+    }
+
+    public void setNums(String nums) {
+        this.nums = nums;
+    }
+
+    public String getNums() {
+        return nums;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("shopId", getShopId())
+                .append("room", getTitle())
+                .append("price", getPrice())
+                .append("pic", getPic())
+                .append("nums", getNums())
+                .append("createTime", getCreateTime())
+                .toString();
+    }
+}

+ 172 - 0
smart-system/src/main/java/com/huijy/management/domain/ShopRoomOrder.java

@@ -0,0 +1,172 @@
+package com.huijy.management.domain;
+
+import com.huijy.common.annotation.Excel;
+import com.huijy.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 酒店房间预订对象 tb_shop_room_order
+ *
+ * @author lishuwen
+ * @date 2021-11-11
+ */
+public class ShopRoomOrder extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * id
+     */
+    private Long id;
+
+    /**
+     * 房间id
+     */
+    @Excel(name = "房间id")
+    private Long roomId;
+
+    /**
+     * 会员id
+     */
+    @Excel(name = "会员id")
+    private Long memberId;
+
+    /**
+     * 客户姓名
+     */
+    @Excel(name = "客户姓名")
+    private String name;
+
+    /**
+     * 客户电话
+     */
+    @Excel(name = "客户电话")
+    private String phone;
+
+    /**
+     * 客户身份证
+     */
+    @Excel(name = "客户身份证")
+    private String card;
+
+    /**
+     * 入住日期
+     */
+    @Excel(name = "入住日期")
+    private String min;
+
+    /**
+     * 预订状态
+     */
+    @Excel(name = "预订状态")
+    private Integer state;
+
+    /**
+     * 退房日期
+     */
+    @Excel(name = "退房日期")
+    private String max;
+
+    /**
+     * 天数
+     */
+    @Excel(name = "天数")
+    private Long days;
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setRoomId(Long roomId) {
+        this.roomId = roomId;
+    }
+
+    public Long getRoomId() {
+        return roomId;
+    }
+
+    public void setMemberId(Long memberId) {
+        this.memberId = memberId;
+    }
+
+    public Long getMemberId() {
+        return memberId;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setCard(String card) {
+        this.card = card;
+    }
+
+    public String getCard() {
+        return card;
+    }
+
+    public void setMin(String min) {
+        this.min = min;
+    }
+
+    public String getMin() {
+        return min;
+    }
+
+    public void setState(Integer state) {
+        this.state = state;
+    }
+
+    public Integer getState() {
+        return state;
+    }
+
+    public void setMax(String max) {
+        this.max = max;
+    }
+
+    public String getMax() {
+        return max;
+    }
+
+    public void setDays(Long days) {
+        this.days = days;
+    }
+
+    public Long getDays() {
+        return days;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("roomId", getRoomId())
+                .append("memberId", getMemberId())
+                .append("name", getName())
+                .append("phone", getPhone())
+                .append("card", getCard())
+                .append("min", getMin())
+                .append("state", getState())
+                .append("max", getMax())
+                .append("createTime", getCreateTime())
+                .append("days", getDays())
+                .toString();
+    }
+}

+ 4 - 2
smart-system/src/main/java/com/huijy/management/mapper/ShopMapper.java

@@ -1,6 +1,7 @@
 package com.huijy.management.mapper;
 
 import java.util.List;
+
 import com.huijy.management.domain.Shop;
 import org.apache.ibatis.annotations.Param;
 
@@ -10,8 +11,7 @@ import org.apache.ibatis.annotations.Param;
  * @author luobo
  * @date 2021-09-12
  */
-public interface ShopMapper
-{
+public interface ShopMapper {
     /**
      * 查询商铺管理
      *
@@ -61,4 +61,6 @@ public interface ShopMapper
     public int deleteShopByShopIds(Long[] shopIds);
 
     List<Shop> selectListByMemberId(@Param("memberId") Long memberId);
+
+    public List<Shop> selectShopByHotel();
 }

+ 64 - 0
smart-system/src/main/java/com/huijy/management/mapper/ShopRoomMapper.java

@@ -0,0 +1,64 @@
+package com.huijy.management.mapper;
+
+import java.util.List;
+
+import com.huijy.management.domain.ShopRoom;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 酒店房间Mapper接口
+ *
+ * @author lishuwen
+ * @date 2021-11-10
+ */
+public interface ShopRoomMapper {
+    /**
+     * 查询酒店房间
+     *
+     * @param id 酒店房间主键
+     * @return 酒店房间
+     */
+    public ShopRoom selectShopRoomById(Long id);
+
+    /**
+     * 查询酒店房间列表
+     *
+     * @param shopRoom 酒店房间
+     * @return 酒店房间集合
+     */
+    public List<ShopRoom> selectShopRoomList(ShopRoom shopRoom);
+
+    /**
+     * 新增酒店房间
+     *
+     * @param shopRoom 酒店房间
+     * @return 结果
+     */
+    public int insertShopRoom(ShopRoom shopRoom);
+
+    /**
+     * 修改酒店房间
+     *
+     * @param shopRoom 酒店房间
+     * @return 结果
+     */
+    public int updateShopRoom(ShopRoom shopRoom);
+
+    /**
+     * 删除酒店房间
+     *
+     * @param id 酒店房间主键
+     * @return 结果
+     */
+    public int deleteShopRoomById(Long id);
+
+    /**
+     * 批量删除酒店房间
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteShopRoomByIds(Long[] ids);
+
+    public List<ShopRoom> selectShopRoomByShopId(@Param("shopId") Long shopId);
+}

+ 61 - 0
smart-system/src/main/java/com/huijy/management/mapper/ShopRoomOrderMapper.java

@@ -0,0 +1,61 @@
+package com.huijy.management.mapper;
+
+import java.util.List;
+import com.huijy.management.domain.ShopRoomOrder;
+
+/**
+ * 酒店房间预订Mapper接口
+ * 
+ * @author lishuwen
+ * @date 2021-11-10
+ */
+public interface ShopRoomOrderMapper 
+{
+    /**
+     * 查询酒店房间预订
+     * 
+     * @param id 酒店房间预订主键
+     * @return 酒店房间预订
+     */
+    public ShopRoomOrder selectShopRoomOrderById(Long id);
+
+    /**
+     * 查询酒店房间预订列表
+     * 
+     * @param shopRoomOrder 酒店房间预订
+     * @return 酒店房间预订集合
+     */
+    public List<ShopRoomOrder> selectShopRoomOrderList(ShopRoomOrder shopRoomOrder);
+
+    /**
+     * 新增酒店房间预订
+     * 
+     * @param shopRoomOrder 酒店房间预订
+     * @return 结果
+     */
+    public int insertShopRoomOrder(ShopRoomOrder shopRoomOrder);
+
+    /**
+     * 修改酒店房间预订
+     * 
+     * @param shopRoomOrder 酒店房间预订
+     * @return 结果
+     */
+    public int updateShopRoomOrder(ShopRoomOrder shopRoomOrder);
+
+    /**
+     * 删除酒店房间预订
+     * 
+     * @param id 酒店房间预订主键
+     * @return 结果
+     */
+    public int deleteShopRoomOrderById(Long id);
+
+    /**
+     * 批量删除酒店房间预订
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteShopRoomOrderByIds(Long[] ids);
+}

+ 61 - 0
smart-system/src/main/java/com/huijy/management/service/IShopRoomOrderService.java

@@ -0,0 +1,61 @@
+package com.huijy.management.service;
+
+import java.util.List;
+import com.huijy.management.domain.ShopRoomOrder;
+
+/**
+ * 酒店房间预订Service接口
+ * 
+ * @author lishuwen
+ * @date 2021-11-10
+ */
+public interface IShopRoomOrderService 
+{
+    /**
+     * 查询酒店房间预订
+     * 
+     * @param id 酒店房间预订主键
+     * @return 酒店房间预订
+     */
+    public ShopRoomOrder selectShopRoomOrderById(Long id);
+
+    /**
+     * 查询酒店房间预订列表
+     * 
+     * @param shopRoomOrder 酒店房间预订
+     * @return 酒店房间预订集合
+     */
+    public List<ShopRoomOrder> selectShopRoomOrderList(ShopRoomOrder shopRoomOrder);
+
+    /**
+     * 新增酒店房间预订
+     * 
+     * @param shopRoomOrder 酒店房间预订
+     * @return 结果
+     */
+    public int insertShopRoomOrder(ShopRoomOrder shopRoomOrder);
+
+    /**
+     * 修改酒店房间预订
+     * 
+     * @param shopRoomOrder 酒店房间预订
+     * @return 结果
+     */
+    public int updateShopRoomOrder(ShopRoomOrder shopRoomOrder);
+
+    /**
+     * 批量删除酒店房间预订
+     * 
+     * @param ids 需要删除的酒店房间预订主键集合
+     * @return 结果
+     */
+    public int deleteShopRoomOrderByIds(Long[] ids);
+
+    /**
+     * 删除酒店房间预订信息
+     * 
+     * @param id 酒店房间预订主键
+     * @return 结果
+     */
+    public int deleteShopRoomOrderById(Long id);
+}

+ 64 - 0
smart-system/src/main/java/com/huijy/management/service/IShopRoomService.java

@@ -0,0 +1,64 @@
+package com.huijy.management.service;
+
+import java.util.List;
+import com.huijy.management.domain.ShopRoom;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 酒店房间Service接口
+ * 
+ * @author lishuwen
+ * @date 2021-11-10
+ */
+public interface IShopRoomService 
+{
+    /**
+     * 查询酒店房间
+     * 
+     * @param id 酒店房间主键
+     * @return 酒店房间
+     */
+    public ShopRoom selectShopRoomById(Long id);
+
+    /**
+     * 查询酒店房间列表
+     * 
+     * @param shopRoom 酒店房间
+     * @return 酒店房间集合
+     */
+    public List<ShopRoom> selectShopRoomList(ShopRoom shopRoom);
+
+    public List<ShopRoom> selectShopRoomByShopId(Long shopId);
+
+    /**
+     * 新增酒店房间
+     * 
+     * @param shopRoom 酒店房间
+     * @return 结果
+     */
+    public int insertShopRoom(ShopRoom shopRoom);
+
+    /**
+     * 修改酒店房间
+     * 
+     * @param shopRoom 酒店房间
+     * @return 结果
+     */
+    public int updateShopRoom(ShopRoom shopRoom);
+
+    /**
+     * 批量删除酒店房间
+     * 
+     * @param ids 需要删除的酒店房间主键集合
+     * @return 结果
+     */
+    public int deleteShopRoomByIds(Long[] ids);
+
+    /**
+     * 删除酒店房间信息
+     * 
+     * @param id 酒店房间主键
+     * @return 结果
+     */
+    public int deleteShopRoomById(Long id);
+}

+ 5 - 2
smart-system/src/main/java/com/huijy/management/service/IShopService.java

@@ -1,6 +1,7 @@
 package com.huijy.management.service;
 
 import java.util.List;
+
 import com.huijy.management.domain.Shop;
 
 /**
@@ -9,8 +10,7 @@ import com.huijy.management.domain.Shop;
  * @author luobo
  * @date 2021-09-12
  */
-public interface IShopService
-{
+public interface IShopService {
     /**
      * 查询商铺管理
      *
@@ -61,8 +61,11 @@ public interface IShopService
 
     /**
      * 根据会员id获取会员店铺列表
+     *
      * @param memberId
      * @return
      */
     List<Shop> getListByMemberId(Long memberId);
+
+    public List<Shop> selectShopByHotel();
 }

+ 95 - 0
smart-system/src/main/java/com/huijy/management/service/impl/ShopRoomOrderServiceImpl.java

@@ -0,0 +1,95 @@
+package com.huijy.management.service.impl;
+
+import java.util.List;
+import com.huijy.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.huijy.management.mapper.ShopRoomOrderMapper;
+import com.huijy.management.domain.ShopRoomOrder;
+import com.huijy.management.service.IShopRoomOrderService;
+
+/**
+ * 酒店房间预订Service业务层处理
+ *
+ * @author lishuwen
+ * @date 2021-11-10
+ */
+@Service
+public class ShopRoomOrderServiceImpl implements IShopRoomOrderService
+{
+    @Autowired
+    private ShopRoomOrderMapper shopRoomOrderMapper;
+
+    /**
+     * 查询酒店房间预订
+     *
+     * @param id 酒店房间预订主键
+     * @return 酒店房间预订
+     */
+    @Override
+    public ShopRoomOrder selectShopRoomOrderById(Long id)
+    {
+        return shopRoomOrderMapper.selectShopRoomOrderById(id);
+    }
+
+    /**
+     * 查询酒店房间预订列表
+     *
+     * @param shopRoomOrder 酒店房间预订
+     * @return 酒店房间预订
+     */
+    @Override
+    public List<ShopRoomOrder> selectShopRoomOrderList(ShopRoomOrder shopRoomOrder)
+    {
+        return shopRoomOrderMapper.selectShopRoomOrderList(shopRoomOrder);
+    }
+
+    /**
+     * 新增酒店房间预订
+     *
+     * @param shopRoomOrder 酒店房间预订
+     * @return 结果
+     */
+    @Override
+    public int insertShopRoomOrder(ShopRoomOrder shopRoomOrder)
+    {
+        shopRoomOrder.setCreateTime(DateUtils.getNowDate());
+        return shopRoomOrderMapper.insertShopRoomOrder(shopRoomOrder);
+    }
+
+    /**
+     * 修改酒店房间预订
+     *
+     * @param shopRoomOrder 酒店房间预订
+     * @return 结果
+     */
+    @Override
+    public int updateShopRoomOrder(ShopRoomOrder shopRoomOrder)
+    {
+        return shopRoomOrderMapper.updateShopRoomOrder(shopRoomOrder);
+    }
+
+    /**
+     * 批量删除酒店房间预订
+     *
+     * @param ids 需要删除的酒店房间预订主键
+     * @return 结果
+     */
+    @Override
+    public int deleteShopRoomOrderByIds(Long[] ids)
+    {
+        return shopRoomOrderMapper.deleteShopRoomOrderByIds(ids);
+    }
+
+    /**
+     * 删除酒店房间预订信息
+     *
+     * @param id 酒店房间预订主键
+     * @return 结果
+     */
+    @Override
+    public int deleteShopRoomOrderById(Long id)
+    {
+        return shopRoomOrderMapper.deleteShopRoomOrderById(id);
+    }
+}

+ 94 - 0
smart-system/src/main/java/com/huijy/management/service/impl/ShopRoomServiceImpl.java

@@ -0,0 +1,94 @@
+package com.huijy.management.service.impl;
+
+import java.util.List;
+
+import com.huijy.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.huijy.management.mapper.ShopRoomMapper;
+import com.huijy.management.domain.ShopRoom;
+import com.huijy.management.service.IShopRoomService;
+
+/**
+ * 酒店房间Service业务层处理
+ *
+ * @author lishuwen
+ * @date 2021-11-10
+ */
+@Service
+public class ShopRoomServiceImpl implements IShopRoomService {
+    @Autowired
+    private ShopRoomMapper shopRoomMapper;
+
+    /**
+     * 查询酒店房间
+     *
+     * @param id 酒店房间主键
+     * @return 酒店房间
+     */
+    @Override
+    public ShopRoom selectShopRoomById(Long id) {
+        return shopRoomMapper.selectShopRoomById(id);
+    }
+
+    /**
+     * 查询酒店房间列表
+     *
+     * @param shopRoom 酒店房间
+     * @return 酒店房间
+     */
+    @Override
+    public List<ShopRoom> selectShopRoomList(ShopRoom shopRoom) {
+        return shopRoomMapper.selectShopRoomList(shopRoom);
+    }
+
+    @Override
+    public List<ShopRoom> selectShopRoomByShopId(Long shopId) {
+        return shopRoomMapper.selectShopRoomByShopId(shopId);
+    }
+
+    /**
+     * 新增酒店房间
+     *
+     * @param shopRoom 酒店房间
+     * @return 结果
+     */
+    @Override
+    public int insertShopRoom(ShopRoom shopRoom) {
+        shopRoom.setCreateTime(DateUtils.getNowDate());
+        return shopRoomMapper.insertShopRoom(shopRoom);
+    }
+
+    /**
+     * 修改酒店房间
+     *
+     * @param shopRoom 酒店房间
+     * @return 结果
+     */
+    @Override
+    public int updateShopRoom(ShopRoom shopRoom) {
+        return shopRoomMapper.updateShopRoom(shopRoom);
+    }
+
+    /**
+     * 批量删除酒店房间
+     *
+     * @param ids 需要删除的酒店房间主键
+     * @return 结果
+     */
+    @Override
+    public int deleteShopRoomByIds(Long[] ids) {
+        return shopRoomMapper.deleteShopRoomByIds(ids);
+    }
+
+    /**
+     * 删除酒店房间信息
+     *
+     * @param id 酒店房间主键
+     * @return 结果
+     */
+    @Override
+    public int deleteShopRoomById(Long id) {
+        return shopRoomMapper.deleteShopRoomById(id);
+    }
+}

+ 13 - 14
smart-system/src/main/java/com/huijy/management/service/impl/ShopServiceImpl.java

@@ -1,6 +1,7 @@
 package com.huijy.management.service.impl;
 
 import java.util.List;
+
 import com.huijy.common.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -15,8 +16,7 @@ import com.huijy.management.service.IShopService;
  * @date 2021-09-12
  */
 @Service
-public class ShopServiceImpl implements IShopService
-{
+public class ShopServiceImpl implements IShopService {
     @Autowired
     private ShopMapper shopMapper;
 
@@ -27,8 +27,7 @@ public class ShopServiceImpl implements IShopService
      * @return 商铺管理
      */
     @Override
-    public Shop selectShopByShopId(Long shopId)
-    {
+    public Shop selectShopByShopId(Long shopId) {
         return shopMapper.selectShopByShopId(shopId);
     }
 
@@ -39,8 +38,7 @@ public class ShopServiceImpl implements IShopService
      * @return 商铺管理
      */
     @Override
-    public List<Shop> selectShopList(Shop shop)
-    {
+    public List<Shop> selectShopList(Shop shop) {
         return shopMapper.selectShopList(shop);
     }
 
@@ -51,8 +49,7 @@ public class ShopServiceImpl implements IShopService
      * @return 结果
      */
     @Override
-    public int insertShop(Shop shop)
-    {
+    public int insertShop(Shop shop) {
         shop.setCreateTime(DateUtils.getNowDate());
         shop.setEnableFlag("0");
         shop.setAuditFlag("0");
@@ -66,8 +63,7 @@ public class ShopServiceImpl implements IShopService
      * @return 结果
      */
     @Override
-    public int updateShop(Shop shop)
-    {
+    public int updateShop(Shop shop) {
 
         return shopMapper.updateShop(shop);
     }
@@ -79,8 +75,7 @@ public class ShopServiceImpl implements IShopService
      * @return 结果
      */
     @Override
-    public int deleteShopByShopIds(Long[] shopIds)
-    {
+    public int deleteShopByShopIds(Long[] shopIds) {
         return shopMapper.deleteShopByShopIds(shopIds);
     }
 
@@ -91,8 +86,7 @@ public class ShopServiceImpl implements IShopService
      * @return 结果
      */
     @Override
-    public int deleteShopByShopId(Long shopId)
-    {
+    public int deleteShopByShopId(Long shopId) {
         return shopMapper.deleteShopByShopId(shopId);
     }
 
@@ -100,4 +94,9 @@ public class ShopServiceImpl implements IShopService
     public List<Shop> getListByMemberId(Long memberId) {
         return shopMapper.selectListByMemberId(memberId);
     }
+
+    @Override
+    public List<Shop> selectShopByHotel() {
+        return shopMapper.selectShopByHotel();
+    }
 }

+ 4 - 0
smart-system/src/main/resources/mapper/management/ShopMapper.xml

@@ -50,6 +50,10 @@
         where shop_id = #{shopId}
     </select>
 
+    <select id="selectShopByHotel" resultMap="ShopResult">
+       SELECT * FROM t_shop WHERE shop_type=2 AND audit_flag=1 ORDER BY create_time DESC
+    </select>
+
     <insert id="insertShop" parameterType="Shop" useGeneratedKeys="true" keyProperty="shopId">
         insert into t_shop
         <trim prefix="(" suffix=")" suffixOverrides=",">

+ 84 - 0
smart-system/src/main/resources/mapper/management/ShopRoomMapper.xml

@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.huijy.management.mapper.ShopRoomMapper">
+    
+    <resultMap type="ShopRoom" id="ShopRoomResult">
+        <result property="id"    column="id"    />
+        <result property="shopId"    column="shop_id"    />
+        <result property="title"    column="title"    />
+        <result property="price"    column="price"    />
+        <result property="pic"    column="pic"    />
+        <result property="nums"    column="nums"    />
+        <result property="createTime"    column="create_time"    />
+    </resultMap>
+
+    <sql id="selectShopRoomVo">
+        select * from tb_shop_room
+    </sql>
+
+    <select id="selectShopRoomList" parameterType="ShopRoom" resultMap="ShopRoomResult">
+        <include refid="selectShopRoomVo"/>
+        <where>  
+            <if test="shopId != null "> and shop_id = #{shopId}</if>
+            <if test="title != null  and title != ''"> and title = #{title}</if>
+            <if test="price != null  and price != ''"> and price = #{price}</if>
+            <if test="pic != null  and pic != ''"> and pic = #{pic}</if>
+            <if test="nums != null  and nums != ''"> and nums = #{nums}</if>
+        </where>
+    </select>
+
+    <select id="selectShopRoomById" parameterType="Long" resultMap="ShopRoomResult">
+        <include refid="selectShopRoomVo"/>
+        where id = #{id}
+    </select>
+    
+    <select id="selectShopRoomByShopId" parameterType="Long" resultMap="ShopRoomResult">
+        SELECT * FROM tb_shop_room WHERE shop_id=#{shopId}
+    </select>
+
+    <insert id="insertShopRoom" parameterType="ShopRoom" useGeneratedKeys="true" keyProperty="id">
+        insert into tb_shop_room
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="shopId != null">shop_id,</if>
+            <if test="title != null">title,</if>
+            <if test="price != null">price,</if>
+            <if test="pic != null">pic,</if>
+            <if test="nums != null">nums,</if>
+            <if test="createTime != null">create_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="shopId != null">#{shopId},</if>
+            <if test="title != null">#{title},</if>
+            <if test="price != null">#{price},</if>
+            <if test="pic != null">#{pic},</if>
+            <if test="nums != null">#{nums},</if>
+            <if test="createTime != null">#{createTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateShopRoom" parameterType="ShopRoom">
+        update tb_shop_room
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="shopId != null">shop_id = #{shopId},</if>
+            <if test="title != null">title = #{title},</if>
+            <if test="price != null">price = #{price},</if>
+            <if test="pic != null">pic = #{pic},</if>
+            <if test="nums != null">nums = #{nums},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteShopRoomById" parameterType="Long">
+        delete from tb_shop_room where id = #{id}
+    </delete>
+
+    <delete id="deleteShopRoomByIds" parameterType="String">
+        delete from tb_shop_room where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 101 - 0
smart-system/src/main/resources/mapper/management/ShopRoomOrderMapper.xml

@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.huijy.management.mapper.ShopRoomOrderMapper">
+
+    <resultMap type="ShopRoomOrder" id="ShopRoomOrderResult">
+        <result property="id" column="id"/>
+        <result property="roomId" column="room_id"/>
+        <result property="memberId" column="member_id"/>
+        <result property="name" column="name"/>
+        <result property="phone" column="phone"/>
+        <result property="card" column="card"/>
+        <result property="min" column="min"/>
+        <result property="state" column="state"/>
+        <result property="max" column="max"/>
+        <result property="createTime" column="create_time"/>
+        <result property="days" column="days"/>
+    </resultMap>
+
+    <sql id="selectShopRoomOrderVo">
+        select id, room_id, member_id, name, phone, card, day, state, create_time from tb_shop_room_order
+    </sql>
+
+    <select id="selectShopRoomOrderList" parameterType="ShopRoomOrder" resultMap="ShopRoomOrderResult">
+        <include refid="selectShopRoomOrderVo"/>
+        <where>
+            <if test="roomId != null ">and room_id = #{roomId}</if>
+            <if test="memberId != null ">and member_id = #{memberId}</if>
+            <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
+        </where>
+    </select>
+
+    <select id="selectShopRoomOrderById" parameterType="Long" resultMap="ShopRoomOrderResult">
+        <include refid="selectShopRoomOrderVo"/>
+        where id = #{id}
+    </select>
+
+    <select id="selectShopRoomOrderByUser" parameterType="Long" resultMap="ShopRoomOrderResult">
+       SELECT o.*,r.title,r.pic,r.price,s.name FROM tb_shop_room_order o
+       LEFT JOIN tb_shop_room r ON r.id=o.room_id
+       LEFT JOIN t_shop s ON s.shop_id=r.shop_id
+       WHERE s.member_id=2
+    </select>
+
+    <insert id="insertShopRoomOrder" parameterType="ShopRoomOrder" useGeneratedKeys="true" keyProperty="id">
+        insert into tb_shop_room_order
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="roomId != null">room_id,</if>
+            <if test="memberId != null">member_id,</if>
+            <if test="name != null">name,</if>
+            <if test="phone != null">phone,</if>
+            <if test="card != null">card,</if>
+            <if test="min != null">min,</if>
+            <if test="state != null">state,</if>
+            <if test="max != null">max,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="days != null">days,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="roomId != null">#{roomId},</if>
+            <if test="memberId != null">#{memberId},</if>
+            <if test="name != null">#{name},</if>
+            <if test="phone != null">#{phone},</if>
+            <if test="card != null">#{card},</if>
+            <if test="min != null">#{min},</if>
+            <if test="state != null">#{state},</if>
+            <if test="max != null">#{max},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="days != null">#{days},</if>
+        </trim>
+    </insert>
+
+    <update id="updateShopRoomOrder" parameterType="ShopRoomOrder">
+        update tb_shop_room_order
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="roomId != null">room_id = #{roomId},</if>
+            <if test="memberId != null">member_id = #{memberId},</if>
+            <if test="name != null">name = #{name},</if>
+            <if test="phone != null">phone = #{phone},</if>
+            <if test="card != null">card = #{card},</if>
+            <if test="min != null">min = #{min},</if>
+            <if test="state != null">state = #{state},</if>
+            <if test="max != null">max = #{max},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="days != null">days = #{days},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteShopRoomOrderById" parameterType="Long">
+        delete from tb_shop_room_order where id = #{id}
+    </delete>
+
+    <delete id="deleteShopRoomOrderByIds" parameterType="String">
+        delete from tb_shop_room_order where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 59 - 2
smart-ui-app/common/common.scss

@@ -66,7 +66,13 @@
 			font-weight: bold;
 		}
 		.ms {
-			margin-top: 10px;
+			margin-top: 5px;
+			color: $dar2;
+			.rmb {
+				color: $orange;
+				font-size: 20px;
+				padding-right: 3px;
+			}
 			.ll {
 				color: #d72424;
 				font-size: 16px;
@@ -96,6 +102,42 @@
 		}
 	}
 }
+.menu {
+	background-color: white;
+	border-radius: 7px;
+	padding: 15px;
+	width: 100%;
+	margin-top: 10px;
+	box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+	.icon {
+		font-size: 30px;
+		background-color: red;
+		width: 38px;
+		height: 38px;
+		border-radius: 5px;
+		margin: 0 auto;
+		color: white;
+		padding: 3px;
+	}
+	.title {
+		padding-top: 4px;
+		font-size: 13px;
+	}
+}
+.feedback {
+	position: absolute;
+	width: 50%;
+	margin-top: -82px;
+	height: 78px;
+	opacity: 0;
+}
+.more {
+	float: right;
+	font-size: 13px;
+	font-weight: normal;
+	margin-top: 9px;
+	color: #b2b1b1;
+}
 .mt10 {
 	margin-top: 10px;
 }
@@ -211,7 +253,7 @@
 	.u-upload {
 		margin-left: 20px;
 	}
-	.u-radio-group{
+	.u-radio-group {
 		position: absolute;
 		padding-left: 12px;
 	}
@@ -295,3 +337,18 @@
 	color: $dar2;
 	font-size: 11px;
 }
+.u-popup {
+	padding: 20px;
+	.tttt {
+		font-weight: bold;
+		font-size: 18px;
+		margin-bottom: 10px;
+	}
+	.inp {
+		text-align: right !important;
+		padding-right: 5px !important;
+	}
+	.btn {
+		margin-top: 10px;
+	}
+}

+ 9 - 3
smart-ui-app/common/http.js

@@ -1,7 +1,7 @@
-//const ip = 'http://192.168.2.101:8080';
+//const ip = 'http://127.0.0.1:8080';
 //const ip = 'https://qfnj.gaswkj.com/prod-api';
-//const ip = 'http://192.168.2.102:8080';
-const ip = 'https://xdmly.qiyiiot.com/prod-api';
+const ip = 'http://192.168.2.101:8080';
+//const ip = 'https://xdmly.qiyiiot.com/prod-api';
 /**
  * 全部接口(集中管理)
  */
@@ -19,6 +19,12 @@ const urls = {
 	updateShop: ip + '/api/index/updateShop', //更新门店信息
 	getMarkerList: ip + '/api/index/getMarkerList/', //根据景区id获取标记物
 	pushHelp: ip + '/api/index/pushHelp', //上传会员拨打记录
+	roomList: ip + '/api/index/roomList', //酒店房间
+	roomAdd: ip + '/api/index/roomAdd', //商家添加,编辑酒店房间
+	hotelList: ip + '/api/index/hotelList', //酒店列表
+	hotelDetail: ip + '/api/index/hotelDetail', //酒店详情
+	hotelBook: ip + '/api/index/hotelBook', //酒店房间预订
+	roomDel: ip + '/api/index/roomDel', //商家删除酒店房间
 	uploadImg: ip + '/api/index/uploadImg', //图片上传请求
 }
 /**

+ 48 - 0
smart-ui-app/common/util.js

@@ -29,6 +29,52 @@ function formatLocation(longitude, latitude) {
 		latitude: latitude.toString().split('.')
 	}
 }
+
+//获取两日期之间日期列表函数
+function getdiffdate(stime,etime){
+    //初始化日期列表,数组
+    var diffdate = new Array();
+    var i=0;
+    //开始日期小于等于结束日期,并循环
+    while(stime<=etime){
+        diffdate[i] = stime;
+        
+        //获取开始日期时间戳
+        var stime_ts = new Date(stime).getTime();
+        
+        //增加一天时间戳后的日期
+        var next_date = stime_ts + (24*60*60*1000);
+        
+        //拼接年月日,这里的月份会返回(0-11),所以要+1
+        var next_dates_y = new Date(next_date).getFullYear()+'-';
+        var next_dates_m = (new Date(next_date).getMonth()+1 < 10)?'0'+(new Date(next_date).getMonth()+1)+'-':(new Date(next_date).getMonth()+1)+'-';
+        var next_dates_d = (new Date(next_date).getDate() < 10)?'0'+new Date(next_date).getDate():new Date(next_date).getDate();
+ 
+        stime = next_dates_y+next_dates_m+next_dates_d;
+        
+        //增加数组key
+        i++;
+    }
+	return diffdate;
+}
+/**
+ * 计算两个日期之间的天数
+ * @param dateString1  开始日期 yyyy-MM-dd
+ * @param dateString2  结束日期 yyyy-MM-dd
+ * @returns {number} 如果日期相同 返回一天 开始日期大于结束日期,返回0
+ */
+const getDaysBetween = (dateString1, dateString2) => {
+	let startDate = Date.parse(dateString1);
+	let endDate = Date.parse(dateString2);
+	if (startDate > endDate) {
+		return 0;
+	}
+	if (startDate == endDate) {
+		return 1;
+	}
+	let days = (endDate - startDate) / (1 * 24 * 60 * 60 * 1000);
+	return days;
+}
 var dateUtils = {
 	UNITS: {
 		'年': 31557600000,
@@ -234,4 +280,6 @@ module.exports = {
 	getDate: getDate,
 	dateTo: dateTo,
 	cn: convertToChinaNum,
+	getDaysBetween: getDaysBetween,
+	getdiffdate:getdiffdate
 }

+ 51 - 23
smart-ui-app/pages.json

@@ -4,14 +4,21 @@
 	},
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
-		    "path" : "pages/index/index2",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": "",
-		        "enablePullDownRefresh": false,
+			"path": "pages/shop/hotel/detail",
+			"style": {
+				"navigationBarTitleText": "酒店详情",
+				"enablePullDownRefresh": false
+			}
+		
+		},
+		{
+			"path": "pages/index/index2",
+			"style": {
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false,
 				"navigationStyle": "custom"
-		    }
-		    
+			}
+
 		},
 		{
 			"path": "pages/shop/list",
@@ -20,7 +27,7 @@
 				"enablePullDownRefresh": true,
 				"backgroundTextStyle": "dark"
 			}
-		
+
 		},
 		{
 			"path": "pages/shop/apply",
@@ -28,14 +35,13 @@
 				"navigationBarTitleText": "店铺开通申请",
 				"enablePullDownRefresh": false
 			}
-		
+
 		},
 		{
 			"path": "pages/index/index",
 			"style": {
-				"navigationBarTitleText": "",
-				"navigationStyle": "custom"
-				
+				"navigationBarTitleText": "旧版首页"
+
 			}
 		},
 		{
@@ -51,14 +57,14 @@
 				"navigationBarTitleText": "路线",
 				"enablePullDownRefresh": false
 			}
-		
+
 		},
 		{
 			"path": "pages/other/about",
 			"style": {
 				"navigationBarTitleText": "关于我们"
 			}
-		
+
 		},
 		{
 			"path": "pages/government/index",
@@ -67,7 +73,7 @@
 				"enablePullDownRefresh": true,
 				"backgroundTextStyle": "dark"
 			}
-		
+
 		},
 		{
 			"path": "pages/travel/index",
@@ -129,30 +135,52 @@
 			}
 
 		}
-	    
-        ,{
-            "path" : "pages/hotel/index",
+
+		, {
+			"path": "pages/shop/hotel/index",
+			"style": {
+				"navigationBarTitleText": "酒店列表",
+				"enablePullDownRefresh": false
+			}
+
+		},  {
+			"path": "pages/shop/hotel/my",
+			"style": {
+				"navigationBarTitleText": "我的预约",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/shop/detail",
+			"style": {
+				"navigationBarTitleText": "店铺信息",
+				"enablePullDownRefresh": false
+			}
+
+		}
+	    ,{
+            "path" : "pages/shop/hotel/room",
             "style" :                                                                                    
             {
-                "navigationBarTitleText": "酒店列表",
+                "navigationBarTitleText": "房间管理",
                 "enablePullDownRefresh": false
             }
             
         }
         ,{
-            "path" : "pages/hotel/appointment",
+            "path" : "pages/order/my",
             "style" :                                                                                    
             {
-                "navigationBarTitleText": "酒店预约",
+                "navigationBarTitleText": "我的预订",
                 "enablePullDownRefresh": false
             }
             
         }
         ,{
-            "path" : "pages/hotel/my",
+            "path" : "pages/order/sale",
             "style" :                                                                                    
             {
-                "navigationBarTitleText": "我的预约",
+                "navigationBarTitleText": "我的店铺订单",
                 "enablePullDownRefresh": false
             }
             

+ 1 - 1
smart-ui-app/pages/index/index.vue

@@ -163,7 +163,7 @@ export default {
 		position: absolute;
 		top: 45px;
 		left: 20px;
-		z-index: 111111;
+		z-index: 111;
 		.icon {
 			padding-right: 5px;
 		}

+ 272 - 0
smart-ui-app/pages/index/index2.vue

@@ -0,0 +1,272 @@
+<template>
+	<view class="page">
+		<view class="wd">
+			<view class="qw">28°</view>
+			<view class="xs">
+				<view>中雨 东风2级</view>
+				<view>空气优23</view>
+			</view>
+		</view>
+		<view class="ms">
+			<text class="icon">&#xe64a;</text>
+			<text>谢通门县欢迎您</text>
+			<navigator url="/pages/index/index" class="jb">旧版首页</navigator>
+		</view>
+		<view class="top"><image src="../../static/bjt.jpg" mode="widthFix"></image></view>
+		<view class="flex menu">
+			<view class="f" @click="tab('/pages/travel/index')">
+				<view class="icon" style="background-color: #0f0b51;">&#xe605;</view>
+				<view class="title">景区介绍</view>
+			</view>
+			<view class="f" @click="navigate('/pages/travel/introduction')">
+				<view class="icon" style="background-color: #2cc937;">&#xe647;</view>
+				<view class="title">旅游攻略</view>
+			</view>
+			<view class="f" @click="navigate('/pages/government/activity')">
+				<view class="icon" style="background-color: #e23e33;">&#xe645;</view>
+				<view class="title">热门活动</view>
+			</view>
+			<view class="f" @click="tab('/pages/government/index')">
+				<view class="icon" style="background-color: #e23e33;">&#xe695;</view>
+				<view class="title">党政服务</view>
+			</view>
+		</view>
+		<view class="flex" style="margin-top: 10px;">
+			<view class="f a1"><image src="../../static/img11.jpg" style="height: 170px;width: 93%;"></image></view>
+			<view class="f a1">
+				<image src="../../static/aa2.jpg" style="height: 80px;width: 100%;"></image>
+				<image src="../../static/aa3.jpg" style="height: 80px;width: 100%;margin-top: 5px;position: relative;">
+					<button class="feedback" open-type="feedback">我要投诉</button>
+				</image>
+			</view>
+		</view>
+		<view class="it">
+			<view class="title">
+				<image src="../../static/lo.png" class="lo" mode="widthFix"></image>
+				<view class="hd">热门景区</view>
+				<view class="more">更多 <text class="arrow icon">&#xe62d;</text></view>
+				<view class="clear"></view>
+			</view>
+			<view class="item">
+				<image src="../../static/a15.jpg" class="bmg"></image>
+				<view class="tit">2021年谢通门“文化旅游节”开幕</view>
+				<view class="desc omit">
+					谢通门是藏族独具特色的传统节日,至今已有600多年的历史。 “达玛文化旅游节”是谢通门县一年一度的传统节日,是历史民族文化的传承,该活动的举办将实现民族、经贸的交往交
+					流交融,为期五天的“达玛节”,除进行群众文艺演出、物交会外,还将进行赛马、赛牦牛、跑马射箭、抱石头等传统 民族体育活动。
+				</view>
+			</view>
+		</view>
+		<view class="it">
+			<view class="title">
+				<image src="../../static/lo.png" class="lo" mode="widthFix"></image>
+				<view class="hd">攻略指南</view>
+				<view class="more">更多 <text class="arrow icon">&#xe62d;</text></view>
+				<view class="clear"></view>
+			</view>
+			<view class="item flex">
+				<view class="f" style="overflow: hidden;"><image src="../../static/img2.jpg" class="img"></image></view>
+				<view class="f" style="padding: 10px;">
+					<view class="tit">日喀则的绝色风光</view>
+					<view class="str-summery">日喀则绝美的自然风光,历史悠久的古城古韵、青山绿水、蓝天白云......如此震撼人心的独特景致!</view>
+					<view class="lx">浏览</view>
+				</view>
+			</view>
+		</view>
+		<u-back-top :scroll-top="scrollTop"></u-back-top>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			ip: this.$http.urls.ip,
+			scrollTop: 0,
+			item: { showPictures: [] }
+		};
+	},
+	onPageScroll(e) {
+		this.scrollTop = e.scrollTop;
+	},
+	onLoad(e) {
+		//this.init();
+		//uni.setStorageSync("user",{"searchValue":null,"createBy":null,"createTime":null,"updateBy":null,"updateTime":null,"remark":null,"params":{},"memberId":2,"name":"wx_5259072147","mobile":"13097850972","email":null,"registerTime":"2021-09-30","lastLoginTime":"2021-11-04","lastLoginIp":"127.0.0.1","loginNum":2,"unionid":null,"openid":"oHYRz5QirxH4-tmZWP0D84HDCv1Q","nickName":"西域男孩","avatarUrl":"https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJCNYUsTpmibmbGAJa6icVT1RZ5uNmusrtibIBgFu112ibe4f0jEvicZlWf0DkeS3l0YlnYkq178W2h8fw/132","gender":"1","province":"广西","city":"玉林","country":"中国","language":"zh_CN","lastLat":null,"lastLng":null,"isShop":2,"apiToken":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyIiwiaWF0IjoxNjM2NjE4Mjc2LCJleHAiOjE2MzcyMjMwNzZ9.c4reK2ce_SfKOaWuaK8CdWv2kLQl4xl92-HLfWuvLySaRNp1oBrW51KToxggbvOcFgRS0bBpl7UCSOMKIkff5A"})
+	},
+	methods: {
+		init() {
+			this.$http.request({
+				url: this.$http.urls.getAboutUs,
+				success: res => {
+					this.item = res.data.data.aboutUs;
+					if (this.item.showPictures) {
+						this.item.showPictures = this.item.showPictures.split(',');
+					}
+					uni.setStorageSync('aboutUs', this.item);
+				}
+			});
+		},
+		//拨打sos
+		call() {
+			if (!this.$hasLogin()) {
+				uni.showModal({ content: '登陆才能使用该功能', showCancel: false });
+				return;
+			}
+			//获取拨打人位置
+			uni.authorize({
+				scope: 'scope.userLocation',
+				success: s => {
+					uni.getLocation({
+						type: 'wgs84',
+						success: res => {
+							uni.showModal({
+								title: '提示',
+								content: '是否拨打' + this.item.helpPhone + '求援电话?',
+								success: c => {
+									if (c.confirm) {
+										//上传拨打救援记录
+										this.$http.request({
+											method: 'POST',
+											url: this.$http.urls.pushHelp,
+											data: {
+												memberId: this.$getUser().memberId,
+												lat: res.latitude,
+												lng: res.longitude,
+												phone: this.item.helpPhone,
+												memberPhone: this.$getUser().mobile
+											},
+											success: r => {
+												uni.makePhoneCall({
+													phoneNumber: this.item.helpPhone
+												});
+											}
+										});
+									}
+								}
+							});
+						}
+					});
+				},
+				fail(res) {
+					//1.2 拒绝授权
+					console.log(JSON.stringify(res));
+				}
+			});
+		},
+		tab(url) {
+			uni.switchTab({
+				url: url
+			});
+		},
+		navigate(url) {
+			uni.navigateTo({ url: url });
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+.page {
+	padding: 10px;
+}
+.wd {
+	margin-top: 25px;
+	z-index: 111111;
+	.qw {
+		font-size: 25px;
+		float: left;
+		font-weight: bold;
+	}
+	.xs {
+		margin-left: 45px;
+		width: 100%;
+		margin-top: 6px;
+		font-size: 13px;
+	}
+}
+.ms {
+	font-size: 22px;
+	font-weight: bold;
+	margin-bottom: 15px;
+	margin-top: 10px;
+	.jb {
+		float: right;
+		font-size: 13px;
+		font-weight: normal;
+		margin-top: 6px;
+	}
+}
+.top {
+	image {
+		width: 100%;
+		border-radius: 5px;
+		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+	}
+}
+.a1 {
+	padding: 5px 0px 5px 0px;
+	image {
+		border-radius: 5px;
+	}
+}
+.it {
+	margin-top: 15px;
+	.title {
+		font-size: 20px;
+		margin-bottom: -15px;
+		font-weight: bold;
+		color: #333;
+		.lo {
+			width: 150px;
+		}
+		.hd {
+			position: absolute;
+			left: 20px;
+			margin-top: -35px;
+		}
+	}
+	.item {
+		margin-top: 10px;
+		padding: 10px;
+		.bmg {
+			width: 100%;
+			height: 150px;
+		}
+		.tit {
+			font-size: 17px;
+			font-weight: bold;
+		}
+		.desc {
+			font-size: 13px;
+			color: $dar;
+			padding-top: 3px;
+		}
+		.img {
+			height: 200px;
+			border-radius: 5px;
+		}
+		.str-summery {
+			font-size: 13px;
+			color: $dar;
+			padding-top: 10px;
+			text-align: left;
+			line-height: 20px;
+		}
+		.lx {
+			width: 150px;
+			color: #fff;
+			background: #d72424;
+			border-radius: 20px;
+			padding: 5px 12px;
+			font-size: 13px;
+			color: white;
+			font-weight: bold;
+			line-height: 23px;
+			margin-top: 20px;
+			.icon {
+				padding-right: 5px;
+				font-size: 20px;
+			}
+		}
+	}
+}
+</style>

+ 0 - 0
smart-ui-app/pages/hotel/my.vue → smart-ui-app/pages/order/my.vue


+ 0 - 0
smart-ui-app/pages/hotel/appointment.vue → smart-ui-app/pages/order/sale.vue


+ 0 - 0
smart-ui-app/pages/hotel/index.vue → smart-ui-app/pages/shop/detail.vue


+ 203 - 0
smart-ui-app/pages/shop/hotel/detail.vue

@@ -0,0 +1,203 @@
+<template>
+	<view class="page">
+		<u-swiper :list="item.imgs" :effect3d="true" :height="300"></u-swiper>
+		<view class="item">
+			<view class="name">{{ item.name }}</view>
+			<view class="address">
+				<view class="dz">{{ item.addres }}</view>
+				<view class="dh" @click="dh()">导航</view>
+			</view>
+			<view class="">
+				<map
+					style="width: 100%; height: 100px;margin-top: 20px;border-radius:5px;"
+					:latitude="item.lat"
+					:longitude="item.lng"
+					:markers="[{ latitude: item.lat, longitude: item.lng }]"
+				></map>
+			</view>
+		</view>
+		<view class="item">
+			<view class="title">
+				<image src="../../../static/lo.png" class="lo" mode="widthFix"></image>
+				<view class="hd">预订房间</view>
+			</view>
+			<view class="r_item" v-for="(it, index) in item.rooms" :key="index">
+				<image :src="ip + it.pic" mode="aspectFill" class="pic"></image>
+				<view class="con">
+					<view class="title omit">{{ it.title }}</view>
+					<view class="ms">
+						<text class="rmb">¥{{ it.price }}</text>
+						<text>起</text>
+					</view>
+					<view class="ms">还剩13间房</view>
+					<view class="btn" @click="popup(it)">预订</view>
+				</view>
+				<view class="clear"></view>
+			</view>
+		</view>
+		<!--预订房间-->
+		<u-popup v-model="popup_show" :mask-close-able="false" mode="center" border-radius="14" width="90%" height="auto" :closeable="true">
+			<view class="u-popup">
+				<view class="tttt" style="font-weight: bolder;">预订房间</view>
+				<u-steps :list="numList" mode="number" :current="0" active-color="#c74547" style="margin: 20px 0px 20px 0px;"></u-steps>
+				<view class="form_group hr">
+					<view class="lable">房型</view>
+					<input :value="book.room + '(¥' + book.price + '起)'" :disabled="true" />
+				</view>
+				<view class="form_group hr">
+					<view class="lable">姓名</view>
+					<input placeholder="请输入姓名" v-model="book.name" />
+				</view>
+				<view class="form_group hr">
+					<view class="lable">手机号</view>
+					<input type="number" placeholder="请输入手机号" v-model="book.phone" />
+				</view>
+				<view class="form_group">
+					<view class="lable">入住日期</view>
+					<input placeholder="请选择入住日期" v-model="book.day" :disabled="true" @click="show = true" />
+					<text class="day" v-if="book.days">{{ book.days }}天</text>
+					<u-calendar v-model="show" mode="range" :start-text="'入住'" :end-text="'退房'" @change="change" max-date="2050" :min-date="min_date"></u-calendar>
+				</view>
+				<button class="btn" @click="add()">确认</button>
+			</view>
+		</u-popup>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			ip: this.$http.urls.ip,
+			numList: [{ name: '资料填写' }, { name: '酒店确认' }, { name: '登记入住' }],
+			item: {}, //酒店信息
+			book: {}, //预订房间
+			min_date: this.$util.getDate('day'),
+			popup_show: false,
+			show: false
+		};
+	},
+	onLoad(e) {
+		this.$http.request({
+			url: this.$http.urls.hotelDetail,
+			data: { shopId: 30 },
+			success: res => {
+				this.item = res.data.data;
+				this.item.imgs = []; //轮播图
+				this.item.showPictures = this.item.showPictures.split(',');
+				this.item.showPictures.forEach(item => {
+					this.item.imgs.push({ image: this.ip + item });
+				});
+			}
+		});
+	},
+	methods: {
+		//导航
+		dh() {
+			uni.openLocation({
+				latitude: Number(this.item.lat),
+				longitude: Number(this.item.lng),
+				address: this.item.addres,
+				success: res => {},
+				fail: error => {
+					console.log(error);
+				}
+			});
+		},
+		change(e) {
+			this.book.day = e.startMonth + '-' + e.startDay + ' 至 ' + e.endMonth + '-' + e.endDay;
+			this.book.min = e.startDate;
+			this.book.max = e.endDate;
+			this.book.days = this.$util.getDaysBetween(e.startDate, e.endDate);
+		},
+		popup(item) {
+			this.book = {};
+			this.book.room = item.title;
+			this.book.price = item.price;
+			this.book.roomId = item.id;
+			this.popup_show = true;
+		},
+		add() {
+			let rule = [
+				{ name: 'name', checkType: 'notnull', errorMsg: '请输入你的姓名' },
+				{ name: 'phone', checkType: 'notnull', errorMsg: '请输入你的手机号' },
+				{ name: 'day', checkType: 'notnull', errorMsg: '请选择入住日期' }
+			];
+			if (!this.$verify.check(this.book, rule)) {
+				uni.showModal({ content: this.$verify.error, showCancel: false });
+				return;
+			}
+			this.book.memberId = this.$getUser().memberId;
+			this.$http.request({
+				method: 'POST',
+				url: this.$http.urls.hotelBook,
+				data: this.book,
+				success: res => {
+					uni.showToast({ title: '操作成功' });
+					this.popup_show = false;
+				}
+			});
+		}
+	}
+};
+</script>
+<style lang="scss">
+.page {
+	padding: 12px;
+	.item {
+		margin-top: 10px;
+		padding: 10px;
+		border-radius: 5px;
+		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+		.name {
+			font-size: 20px;
+			font-weight: bold;
+			border-bottom: 1px solid #f2e6e6;
+			padding: 0px 10px 10px 10px;
+		}
+		.address {
+			color: $dar2;
+			padding: 10px;
+			.dz {
+				width: 87%;
+				float: left;
+			}
+			.dh {
+				width: 13%;
+				float: left;
+				color: #03a9f4;
+				text-align: right;
+			}
+		}
+		.title {
+			font-size: 20px;
+			font-weight: bold;
+			color: #333;
+			.lo {
+				width: 150px;
+			}
+			.hd {
+				position: absolute;
+				left: 35px;
+				margin-top: -36px;
+			}
+		}
+		.r_item {
+			box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0);
+			.btn {
+				float: right;
+				margin-top: -54px;
+				padding: 5px 25px;
+				border-radius: 20px;
+				background-color: orange;
+				margin-right: -34px;
+			}
+		}
+	}
+	.day {
+		position: absolute;
+		color: orange;
+		right: 12px;
+	}
+}
+</style>

+ 61 - 0
smart-ui-app/pages/shop/hotel/index.vue

@@ -0,0 +1,61 @@
+<template>
+	<view>
+		<view class="list">
+			<u-divider style="padding-top: 10px;">精选酒店</u-divider>
+			<view class="r_item" v-for="(item, index) in list" :key="index" @click="detail(item)">
+				<image :src="ip + item.showPictures[0]" mode="aspectFill" class="pic"></image>
+				<view class="con">
+					<view class="title omit">{{ item.name }}</view>
+					<view class="ms omit">{{ item.addres }}</view>
+					<view class="ms">
+						<u-rate :count="5" v-model="value" active-color="#FF9800"></u-rate>
+						(5.0)
+					</view>
+				</view>
+				<view class="clear"></view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			ip: this.$http.urls.ip,
+			value: 5,
+			list: []
+		};
+	},
+	onLoad() {
+		this.getData();
+	},
+	methods: {
+		//获取数据
+		getData() {
+			this.$http.request({
+				url: this.$http.urls.hotelList,
+				success: res => {
+					this.list = res.data.data;
+					this.list.forEach(item => {
+						item.showPictures = item.showPictures.split(',');
+					});
+				}
+			});
+		},
+		//详情
+		detail(item) {
+			uni.navigateTo({ url: '/pages/shop/hotel/detail?shopId=' + item.shopId});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+.list {
+	padding: 0px 10px 70px 10px;
+	.ms {
+		color: $dar2;
+	}
+}
+</style>

+ 19 - 0
smart-ui-app/pages/shop/hotel/my.vue

@@ -0,0 +1,19 @@
+<template>
+	<view>
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			};
+		}
+	}
+</script>
+
+<style lang="scss">
+
+</style>

+ 206 - 0
smart-ui-app/pages/shop/hotel/room.vue

@@ -0,0 +1,206 @@
+<template>
+	<view>
+		<view class="list">
+			<view class="item" v-for="(it, index) in list" :key="index" @click="popup(it)">
+				<view class="lef"><image :src="ip + it.pic" mode="aspectFill" class="pic"></image></view>
+				<view class="con">
+					<view class="title omit">{{ it.title }}</view>
+					<view class="ms">¥{{ it.price }}/晚</view>
+					<view class="ms">共有{{ it.nums }}间</view>
+					<view class="del" @click.stop="del(it)">删除</view>
+				</view>
+				<view class="clear"></view>
+			</view>
+		</view>
+		<view class="noLogin">
+			<image class="u-error-icon" src="../../../static/sj.png" mode="widthFix" v-if="list.length == 0"></image>
+			<view class="dll" @click="popup()">添加房间</view>
+		</view>
+		<!--添加房间信息-->
+		<u-popup v-model="popup_show" :mask-close-able="false" mode="center" border-radius="14" width="90%" height="auto" :closeable="true">
+			<view class="u-popup">
+				<view class="tttt" style="font-weight: bolder;">{{ popup_title }}</view>
+				<view class="form_group hr">
+					<view class="lable">房间名称</view>
+					<input placeholder="例如单人房" v-model="item.title" />
+				</view>
+				<view class="form_group hr">
+					<view class="lable">房价价格</view>
+					<input type="number" placeholder="每晚价格" v-model="item.price" />
+				</view>
+				<view class="form_group hr">
+					<view class="lable">房间数量</view>
+					<input type="number" placeholder="请输入房间数量" v-model="item.nums" />
+				</view>
+				<view class="form_group"><view class="lable">房间图片</view></view>
+				<view class="pl5">
+					<u-upload
+						:ip="ip"
+						:action="upload.action"
+						:header="upload.header"
+						:size-type="upload.size"
+						:max-count="upload.count"
+						:name="upload.name"
+						:file-list="item.pic"
+						ref="pic"
+						width="140"
+						height="140"
+					></u-upload>
+				</view>
+				<button class="btn" @click="add()">保存</button>
+			</view>
+		</u-popup>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			ip: this.$http.urls.ip,
+			list: [],
+			item: {},
+			popup_show: false,
+			popup_title: '添加房间',
+			shopId: '',
+			upload: {
+				header: { apiToken: this.$getUser().apiToken },
+				name: 'img',
+				action: this.$http.urls.uploadImg,
+				size_type: 'compressed ',
+				count: 1
+			}
+		};
+	},
+	onLoad() {
+		this.shopId = 30;
+		this.getData();
+	},
+	methods: {
+		//获取数据
+		getData() {
+			this.$http.request({
+				url: this.$http.urls.roomList,
+				data: { shopId: this.shopId },
+				success: res => {
+					this.list = res.data.data;
+					this.list.forEach(item => {
+						item.pic=item.pic.split(",");
+					});
+				}
+			});
+		},
+		popup(item) {
+			if (item) {
+				item=JSON.stringify(item);
+				this.item =JSON.parse(item);
+				this.popup_title = '编辑房间';
+			} else {
+				this.item = {};
+			}
+			this.popup_show = true;
+		},
+		add() {
+			let pic = this.$refs.pic.lists.filter(val => {
+				return val.progress == 100;
+			});
+			pic.forEach(item => {
+				if (item.response) {
+					this.item.pic = item.response.fileName; //获取上传成功的网络地址
+				} else {
+					this.item.pic = item.url; //原来的地址
+				}
+			});
+			let rule = [
+				{ name: 'title', checkType: 'notnull', errorMsg: '请输入房间名称' },
+				{ name: 'price', checkType: 'notnull', errorMsg: '请输入房间价格' },
+				{ name: 'nums', checkType: 'notnull', errorMsg: '请输入房间数量' },
+				{ name: 'pic', checkType: 'notnull', errorMsg: '请上传一张房间图片' }
+			];
+			if (!this.$verify.check(this.item, rule)) {
+				uni.showModal({ content: this.$verify.error, showCancel: false });
+				return;
+			}
+			this.item.shopId = this.shopId;
+			this.$http.request({
+				method: 'POST',
+				url: this.$http.urls.roomAdd,
+				data: this.item,
+				success: res => {
+					uni.showToast({ title: '添加成功' });
+					this.popup_show = false;
+					this.getData();
+				}
+			});
+		},
+		del(item) {
+			uni.showModal({
+				title: '提示',
+				content: '是否删除该房间?',
+				success: res => {
+					if (res.confirm) {
+						this.$http.request({
+							url: this.$http.urls.roomDel,
+							data: { id: item.id },
+							success: res => {
+								uni.showToast({ title: '添加成功' });
+								this.list.splice(this.list.indexOf(item), 1);
+							}
+						});
+					}
+				}
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+.list {
+	padding: 0px 10px 70px 10px;
+	.item {
+		background-color: white;
+		padding: 15px 8px 15px 8px;
+		border-bottom: 1px solid #e5e5e5;
+		border-radius: 5px;
+		margin-top: 10px;
+		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.2);
+		.lef {
+			float: left;
+			width: 30%;
+			position: relative;
+			overflow: hidden;
+			height: 85px;
+			border-radius: 4px;
+			.pic {
+				width: 100%;
+				height: 85px;
+				background-color: #dcdcdc;
+			}
+		}
+		.con {
+			padding-left: 30px;
+			width: 60%;
+			float: left;
+			.title {
+				font-size: 15px;
+				text-align: left;
+				color: #252525;
+				font-weight: bold;
+			}
+			.ms {
+				margin-top: 5px;
+			}
+			.del {
+				float: right;
+				margin-top: -20px;
+				color: $theme-color;
+				margin-right: -25px;
+			}
+		}
+	}
+}
+.noLogin {
+	margin-top: -40px;
+}
+</style>

+ 1 - 21
smart-ui-app/pages/shop/list.vue

@@ -23,10 +23,6 @@
 							<text>审核不通过</text>
 						</view>
 					</view>
-					<view class="lx" @click.stop="up(item)" v-if="item.auditFlag == 1">
-						<text class="icon">&#xec1d;</text>
-						上报数据
-					</view>
 				</view>
 				<view class="clear"></view>
 			</view>
@@ -78,7 +74,7 @@ export default {
 		},
 		//详情
 		detail(item) {
-			uni.navigateTo({ url: '/pages/shop/apply?item=' + JSON.stringify(item) });
+			uni.navigateTo({ url: '/pages/shop/detail'});
 		}
 	},
 	//下拉刷新
@@ -153,22 +149,6 @@ export default {
 					}
 				}
 			}
-			.lx {
-				float: right;
-				color: #fff;
-				background: #d72424;
-				border-radius: 4px;
-				padding: 6px 8px;
-				font-size: 15px;
-				color: white;
-				font-weight: bold;
-				margin-right: -20px;
-				margin-top: -15px;
-				.icon {
-					padding-right: 5px;
-					font-size: 20px;
-				}
-			}
 		}
 	}
 }

BIN
smart-ui-app/static/a15.jpg


BIN
smart-ui-app/static/aa2.jpg


BIN
smart-ui-app/static/aa3.jpg


BIN
smart-ui-app/static/bjt.jpg


BIN
smart-ui-app/static/img11.jpg


BIN
smart-ui-app/static/lo.png


+ 11 - 10
smart-ui-app/uview-ui/components/u-upload/u-upload.vue

@@ -182,7 +182,6 @@ export default {
 		},
 		// 显示已上传的文件列表
 		fileList: {
-			type: Array,
 			default() {
 				return [];
 			}
@@ -272,16 +271,18 @@ export default {
 		fileList: {
 			immediate: true,
 			handler(val) {
-				val.map(value => {
-					// 首先检查内部是否已经添加过这张图片,因为外部绑定了一个对象给fileList的话(对象引用),进行修改外部fileList
-					// 时,会触发watch,导致重新把原来的图片再次添加到this.lists
-					// 数组的some方法意思是,只要数组元素有任意一个元素条件符合,就返回true,而另一个数组的every方法的意思是数组所有元素都符合条件才返回true
-					let tmp = this.lists.some(val => {
-						return val.url == value;
+				if(typeof val!='string'){
+					val.map(value => {
+						// 首先检查内部是否已经添加过这张图片,因为外部绑定了一个对象给fileList的话(对象引用),进行修改外部fileList
+						// 时,会触发watch,导致重新把原来的图片再次添加到this.lists
+						// 数组的some方法意思是,只要数组元素有任意一个元素条件符合,就返回true,而另一个数组的every方法的意思是数组所有元素都符合条件才返回true
+						let tmp = this.lists.some(val => {
+							return val.url == value;
+						});
+						// 如果内部没有这个图片(tmp为false),则添加到内部
+						!tmp && this.lists.push({blob:false,url: value, error: false, progress: 100 });
 					});
-					// 如果内部没有这个图片(tmp为false),则添加到内部
-					!tmp && this.lists.push({blob:false,url: value, error: false, progress: 100 });
-				});
+				}
 			}
 		},
 		// 监听lists的变化,发出事件