jiazhipeng 1 year ago
parent
commit
5bcf1cf397
  1. 5
      package-lock.json
  2. 1
      package.json
  3. 112
      pages.json
  4. 33
      pages/index/index.vue
  5. 13
      pages/mall/mall.vue
  6. 9
      static/js/CommonFunction.js
  7. 2
      store/modules/user.js
  8. 3
      subPackages/food/foodOrder.vue
  9. 54
      subPackages/hotelHomestay/detail.vue
  10. 16
      subPackages/hotelHomestay/order.vue
  11. 77
      subPackages/hotelHomestay/selectCalendar.vue
  12. 537
      subPackages/order/detail.vue

5
package-lock.json

@ -2,6 +2,11 @@
"requires": true, "requires": true,
"lockfileVersion": 1, "lockfileVersion": 1,
"dependencies": { "dependencies": {
"mobile-calendar-simple": {
"version": "2.4.0",
"resolved": "https://registry.npmmirror.com/mobile-calendar-simple/-/mobile-calendar-simple-2.4.0.tgz",
"integrity": "sha512-67Dg/pxQ7EK2uxGrjv4tLOBx+upIErxdtTC27o+luGFmhBtZ3+k1C2DGIzzJYhAF/YsMG9zkSl9XZY0TEt/HOg=="
},
"ydui-district": { "ydui-district": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmmirror.com/ydui-district/-/ydui-district-1.1.0.tgz", "resolved": "https://registry.npmmirror.com/ydui-district/-/ydui-district-1.1.0.tgz",

1
package.json

@ -1,5 +1,6 @@
{ {
"dependencies": { "dependencies": {
"mobile-calendar-simple": "^2.4.0",
"ydui-district": "^1.1.0" "ydui-district": "^1.1.0"
} }
} }

112
pages.json

@ -175,17 +175,15 @@
} }
}, },
{ {
"path" : "travelGuide/travelGuide", "path": "travelGuide/travelGuide",
"style" : "style": {
{
"navigationBarTitleText": "游记攻略", "navigationBarTitleText": "游记攻略",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path" : "travelGuide/detail", "path": "travelGuide/detail",
"style" : "style": {
{
"navigationBarTitleText": "攻略详情" "navigationBarTitleText": "攻略详情"
} }
}, },
@ -214,80 +212,86 @@
} }
}, },
{ {
"path" : "user/privacy", "path": "user/privacy",
"style" : { "style": {
"navigationBarTitleText" : "隐私管理" "navigationBarTitleText": "隐私管理"
} }
}, },
{ {
"path" : "user/privacyInfo", "path": "user/privacyInfo",
"style" : { "style": {
"navigationBarTitleText" : "详情" "navigationBarTitleText": "详情"
} }
}, },
{ {
"path" : "user/coupon", "path": "user/coupon",
"style" : { "style": {
"navigationBarTitleText" : "优惠券" "navigationBarTitleText": "优惠券"
} }
}, },
{ {
"path" : "user/collect", "path": "user/collect",
"style" : { "style": {
"navigationBarTitleText" : "个人收藏" "navigationBarTitleText": "个人收藏"
} }
}, },
{ {
"path" : "order/trades", "path": "order/trades",
"style" : { "style": {
"navigationBarTitleText" : "全部订单" "navigationBarTitleText": "全部订单"
} }
}, },
{ {
"path" : "order/detail", "path": "order/detail",
"style" : { "style": {
"navigationBarTitleText" : "订单状态", "navigationBarTitleText": "订单状态",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path" : "user/bindTel", "path": "user/bindTel",
"style" : { "style": {
"navigationBarTitleText" : "修改姓名" "navigationBarTitleText": "修改姓名"
} }
}, },
{ {
"path" : "user/changeNickname", "path": "user/changeNickname",
"style" : { "style": {
"navigationBarTitleText" : "修改手机号" "navigationBarTitleText": "修改手机号"
} }
}, },
{ {
"path" : "notice/noticeList", "path": "notice/noticeList",
"style" : { "style": {
"navigationBarTitleText" : "公告", "navigationBarTitleText": "公告",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path" : "notice/noticeDetail", "path": "notice/noticeDetail",
"style" : { "style": {
"navigationBarTitleText" : "公告详情", "navigationBarTitleText": "公告详情",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{ {
"path" : "search/search", "path": "search/search",
"style" : { "style": {
"navigationBarTitleText" : "搜索", "navigationBarTitleText": "搜索",
"enablePullDownRefresh" : false "enablePullDownRefresh": false
} }
}, },
{ {
"path" : "search/searchList", "path": "search/searchList",
"style" : { "style": {
"navigationBarTitleText" : "搜索结果", "navigationBarTitleText": "搜索结果",
"enablePullDownRefresh" : false "enablePullDownRefresh": false
}
},
{
"path": "hotelHomestay/selectCalendar",
"style": {
"navigationBarTitleText": "选择日期"
} }
} }
] ]

33
pages/index/index.vue

@ -79,7 +79,7 @@
<view @click="gotoPath('/subPackages/line/lineList')">更多 ></view> <view @click="gotoPath('/subPackages/line/lineList')">更多 ></view>
</view> </view>
<view class="box"> <view class="box">
<view v-for="(item,index) in lineList" :key="index" class="line-item"> <view v-for="(item,index) in lineList" :key="index" class="line-item" @click="goCalendarDetail(item.goods,1)">
<view class="hot flex-center" v-if="item.goods.image_tag">{{item.goods.image_tag}}</view> <view class="hot flex-center" v-if="item.goods.image_tag">{{item.goods.image_tag}}</view>
<image :src="showImg(item.goods.image)" mode="aspectFill" class="line-img"></image> <image :src="showImg(item.goods.image)" mode="aspectFill" class="line-img"></image>
@ -121,7 +121,7 @@
<view class="strategy-box box"> <view class="strategy-box box">
<view v-for="(num,nums) in 2" :key="nums"> <view v-for="(num,nums) in 2" :key="nums">
<view v-for="(item,index) in strategyList" :key="index" class="strategy-item" v-if="index % 2 === nums" @click="goDetail(item)"> <view v-for="(item,index) in strategyList" :key="index" class="strategy-item" v-if="index % 2 === nums" @click="goCalendarDetail(item)">
<view class="title-tag" v-if="item.image_tag">{{item.image_tag}}</view> <view class="title-tag" v-if="item.image_tag">{{item.image_tag}}</view>
<image class="strategy-image" :src="showImg(item.image)" mode="widthFix"></image> <image class="strategy-image" :src="showImg(item.image)" mode="widthFix"></image>
<view class="strategy-content"> <view class="strategy-content">
@ -279,6 +279,35 @@
break; break;
} }
}, },
// 线
goCalendarDetail(item,type) {
switch (item.link_type) {
case 0:
//
if(type == 1) {
// 线
}else {
uni.navigateTo({
url:'/subPackages/travelGuide/detail?id='+item.id
})
}
break;
case 1:
//
uni.navigateToMiniProgram({
shortLink: item.ext_link
})
break;
case 2:
// h5
uni.navigateTo({
url: '/subPackages/webPage/webPage?url=' + item.ext_link
});
break;
default:
break;
}
},
// //
getWeather() { getWeather() {
this.Post({},'/api/index/weather').then(res => { this.Post({},'/api/index/weather').then(res => {

13
pages/mall/mall.vue

@ -1,7 +1,20 @@
<template> <template>
<view></view>
</template> </template>
<script> <script>
export default {
data() {
return {
}
},
onShow() {
uni.navigateTo({
url: '/subPackages/techan/techanList'
});
}
}
</script> </script>
<style> <style>

9
static/js/CommonFunction.js

@ -130,6 +130,15 @@ Vue.prototype.gotoPath = path => {
// 返回上一页 // 返回上一页
Vue.prototype.goBack = () => { Vue.prototype.goBack = () => {
console.log(getCurrentPages())
var pages = getCurrentPages();
var page = pages[pages.length - 1];
if(page.route == 'subPackages/techan/techanList') {
uni.switchTab({
url: '/pages/index/index'
})
return;
}
getCurrentPages().length > 1 ? uni.navigateBack({}) : uni.switchTab({ getCurrentPages().length > 1 ? uni.navigateBack({}) : uni.switchTab({
url: '/pages/index/index' url: '/pages/index/index'
}) })

2
store/modules/user.js

@ -23,7 +23,7 @@ export default {
url: '/pages/login/login' url: '/pages/login/login'
}) })
}, },
// 线路下单 // 美食下单
changeFoodInfo(state, data){ changeFoodInfo(state, data){
state.foodInfo = data state.foodInfo = data
}, },

3
subPackages/food/foodOrder.vue

@ -42,7 +42,7 @@
<view class="left-text"> <view class="left-text">
手机号 手机号
</view> </view>
<input type="number" v-model="reserve_phone" maxlength="11" /> <input type="number" v-model="reserve_phone" placeholder="请输入联系手机号" maxlength="11" />
</view> </view>
<image class="cha" @click="cha" v-if="reserve_phone!= ''" :src="showImg('/uploads/20240827/5e5970926e92a2109da55bfe32a47e4b.png')" mode=""></image> <image class="cha" @click="cha" v-if="reserve_phone!= ''" :src="showImg('/uploads/20240827/5e5970926e92a2109da55bfe32a47e4b.png')" mode=""></image>
</view> </view>
@ -92,6 +92,7 @@
uni.navigateBack(); uni.navigateBack();
} }
console.log(this.info); console.log(this.info);
this.reserve_phone = JSON.parse(uni.getStorageSync('userInfo')).mobile
this.total() this.total()
}, },
methods: { methods: {

54
subPackages/hotelHomestay/detail.vue

@ -89,8 +89,8 @@
</view> </view>
</view> </view>
<view class="price-container"> <view class="price-container">
<view class="price">{{item.price/100}}</view> <view class="price">{{item.money/100}}</view>
<view class="btn" @click="goOrder(item)">预订</view> <view :class="['btn', {'noBuy': item.store == 0}]" @click="goOrder(item)">预订</view>
</view> </view>
</view> </view>
</view> </view>
@ -169,14 +169,20 @@
</view> </view>
</uni-popup> </uni-popup>
<uni-calendar ref="calendar" class="uni-calendar--hook" :clear-date="false" <uni-popup ref="calendarPopup" type="bottom">
:insert="false" :range="true" :startDate="calendarParam.startDate" <view style="width: 100vw;height: 60vh;">
:endDate="calendarParam.endDate" @confirm="confirmCalendar"/> <SelectCalendar :startDate="new Date(selectDate.startDay).Format('yyyy-MM-dd')" :endDate="new Date(selectDate.endDay).Format('yyyy-MM-dd')"></SelectCalendar>
</view>
</uni-popup>
</view> </view>
</template> </template>
<script> <script>
import SelectCalendar from './selectCalendar';
export default { export default {
components: {
SelectCalendar
},
data() { data() {
return { return {
headImg: "https://tongli.sz-trip.com/uploads/20240826/8653c32761e01ee683505eddba1ae22b.png", headImg: "https://tongli.sz-trip.com/uploads/20240826/8653c32761e01ee683505eddba1ae22b.png",
@ -202,12 +208,20 @@
} }
}, },
onShow(options) {
},
onLoad(options) { onLoad(options) {
this.id = options.id; this.id = options.id;
this.getInfo(); this.getInfo();
this.getGoodsList() this.getGoodsList()
uni.$on('changeHotelDate', data => {
if(data) {
this.selectDate = data
this.getGoodsList()
}
this.$refs.calendarPopup.close();
})
},
onUnload() {
uni.$off('changeHotelDate')
}, },
methods: { methods: {
swiperChange (e) { swiperChange (e) {
@ -268,7 +282,9 @@
// id // id
getGoodsList(){ getGoodsList(){
this.Post({ this.Post({
scenic_id: this.id scenic_id: this.id,
start_date: this.selectDate.startDay,
end_date: this.selectDate.endDay
},'/api/scenic/getGoodsByScenicId').then(res => { },'/api/scenic/getGoodsByScenicId').then(res => {
let result = res.data || [] let result = res.data || []
let data = [] let data = []
@ -312,18 +328,7 @@
return days; return days;
}, },
openCalendar () { openCalendar () {
this.calendarParam = { this.$refs.calendarPopup.open();
startDate: this.minSeldDate,
endDate: this.maxSeldDate,
// selected: this.allSeldDate.filter(v=>v.store>0).map(v=>{
// return {
// date: v.date,
// info: ''+this.showNoPriceNew(v.money),
// notNeedDot:true,
// }
// })
}
this.$refs.calendar.open();
}, },
confirmCalendar (val) { confirmCalendar (val) {
if (val.range.data.length<2) { if (val.range.data.length<2) {
@ -348,9 +353,9 @@
// //
goOrder (item) { goOrder (item) {
// if (item.xx) { if (item.store == 0) {
// return return
// } }
let param = { let param = {
skuInfo: item, skuInfo: item,
@ -692,6 +697,9 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.noBuy {
background: #ccc;
}
} }
} }

16
subPackages/hotelHomestay/order.vue

@ -214,7 +214,7 @@
}, },
total () { total () {
return this.skuInfo.price/100 * this.buyNum || 0 return this.skuInfo.money/100 * this.buyNum || 0
}, },
order () { order () {
@ -227,14 +227,18 @@
}); });
return; return;
} }
if (this.roomUser.some(v=>v.name.length<0)) { if (this.roomUser.some(v=>{return v.name.length==0})) {
uni.showToast({ uni.showToast({
title: '请输入住客姓名', title: '请输入住客姓名',
icon: 'none' icon: 'none'
}); });
return; return;
} }
if (this.roomUser.length != new Set(this.roomUser).length) {
let roomNames = []
this.roomUser.forEach(item => { roomNames.push(item.name) })
if (roomNames.length != Array.from(new Set(roomNames)).length) {
uni.showToast({ uni.showToast({
title: '住客姓名不能相同', title: '住客姓名不能相同',
icon: 'none' icon: 'none'
@ -248,17 +252,15 @@
specifications_id: this.skuInfo.id, specifications_id: this.skuInfo.id,
start_date: this.selectDate.startDay, start_date: this.selectDate.startDay,
end_date: this.selectDate.endDay, end_date: this.selectDate.endDay,
customer_name: this.roomUser.map(v=>v.name).join(','),
// reserve_mobile: this.phone,
} }
goods.push(goodsItem) goods.push(goodsItem)
let data = { let data = {
goods: goods, goods: goods,
reserve_phone: this.phone, reserve_name: roomNames.toString(),
reserve_phone: this.phone
} }
return
this.Post({ this.Post({
method: 'POST', method: 'POST',
data: JSON.stringify(data) data: JSON.stringify(data)

77
subPackages/hotelHomestay/selectCalendar.vue

@ -0,0 +1,77 @@
<template>
<div>
<!--如果需要solt-->
<!--用法二当mode=23的模式下分别为酒店\往返的离开日期-->
<Calendar @click="tip" :is-show="true" :start-date="startDate" :end-date="endDate" mode="2" :title="'日期选择'"
@callback="getDate" :transition="'slide'" :theme-color="'#71B580'" />
<div class="btn" @click="determine()">
确定
</div>
</div>
</template>
<script>
import Calendar from 'mobile-calendar-simple'
export default {
props: ['startDate', 'endDate'],
data() {
return { //yyyy-mm-ddyyyy/mm/dd
betweenStart: '',
betweenEnd: '',
calendarShow: true,
date: 'init', //
}
},
methods: {
determine() {
if (this.date == 'delete') {
uni.showToast({
title: "请选择日期",
icon: "none"
})
} else if (this.date == 'init') {
//
uni.$emit('changeHotelDate',null)
} else {
let date = this.date
let data = {
startDay: date.startStr.dateStr,
endDay: date.endStr.dateStr,
differDays: date.dayCount
}
uni.$emit('changeHotelDate',data)
}
},
//
getDate(date) {
this.date = date
},
tip() {
console.log(1);
}
},
components: {
Calendar
}
}
</script>
<style scoped>
.btn {
width: 697rpx;
height: 80rpx;
background: linear-gradient(90deg, #9EE4FE, #7FD491);
border-radius: 40rpx;
line-height: 80rpx;
font-size: 36rpx;
font-family: PingFang SC;
font-weight: 500;
color: #000000;
text-align: center;
position: fixed;
bottom: 30rpx;
z-index: 999;
text-align: center;
left: 50%;
transform: translate(-348.5rpx, 0);
}
</style>

537
subPackages/order/detail.vue

File diff suppressed because it is too large
Loading…
Cancel
Save