Browse Source

提交

master
chenkainan 11 months ago
parent
commit
4860b0a808
  1. 386
      components/calendar.vue
  2. 28
      manifest.json
  3. 30
      pages.json
  4. 418
      pages/index/index.vue
  5. 28
      pages/login/login.vue
  6. 16
      pages/user/user.vue
  7. 8
      static/js/request.js
  8. 135
      subPackages/order/orderDetail.vue
  9. 163
      subPackages/order/orderList.vue
  10. 50
      subPackages/user/accountPassword.vue

386
components/calendar.vue

@ -0,0 +1,386 @@
<template>
<view>
<!-- 日历 -->
<view class="calendar">
<view class="calendar-top flex-between">
<view @click="preNextDate(0)">
<img src="https://static.ticket.sz-trip.com/tourGuide/images/index/leftIcon.png" class="iconfont"
style="margin-right: 13rpx;" />
{{ monthShow ? '上一月' : '上一周' }}
</view>
<view>{{year}}{{month}}</view>
<view @click="preNextDate(1)">
{{ monthShow ? '下一月' : '下一周' }}
<img src="https://static.ticket.sz-trip.com/tourGuide/images/index/rightIcon.png" class="iconfont"
style="margin-left: 13rpx;" />
</view>
</view>
<view class="calendar-bottom">
<view class="week-item" v-for="(item,index) in weekList" :key="item + index">
{{item}}
</view>
<view v-for="(item, index) in everyDay" :key="item.day + index" class="day-box flex-center"
:class="(nowDay > item.date) ? 'grayDate' : ''" v-if="monthShow">
<view :class="['day-item', selectDay == item.date ? 'daySelect' : '']"
@click="changeDate(item.date)">
{{ nowDay== item.date ? '今日' : item.day }}
<view class="day-lunar" v-if="isShowLunar">{{showLunar(item)}}</view>
<view class="day-point" v-else></view>
<!-- <view class="day-point" v-if="(item.day && selectDay != item.date) && item.flag && !isShowLunar"></view> -->
</view>
</view>
<view v-for="(item, index) in weekDates" :key="item + index" class="day-box flex-center"
:class="(nowDay > getNowTime(item)) ? 'grayDate' : ''" v-if="!monthShow">
<view :class="['day-item', selectDay == getNowTime(item) ? 'daySelect' : '']"
@click="changeDate(getNowTime(item))">
{{ nowDay == getNowTime(item) ? '今日' : getNowTime(item).slice(-2) }}
<view class="day-lunar" v-if="isShowLunar">{{showLunar(getNowTime(item))}}</view>
<view class="day-point" v-if="(item.day && selectDay != item.date) && item.flag && !isShowLunar"></view>
</view>
</view>
<view class="" style="width: 100%;height: 50rpx;padding: 20rpx;" @click="changeWeekMonth">
<img :src="monthShow ? 'https://static.ticket.sz-trip.com/hsrNewTown/images/calendar/top.png' : 'https://static.ticket.sz-trip.com/hsrNewTown/images/calendar/bottom.png'"
class="iconfont" />
</view>
</view>
</view>
</view>
</template>
<script>
import {
lunar
} from "../static/js/lunar.js"
export default {
props: {
isShowLunar: {
type: Boolean,
default: false
},
},
data() {
return {
weekList: ['日', '一', '二', '三', '四', '五', '六'],
monthShow: false,
year: 0,
month: 0,
day: 0,
week: '',
nowDay: '',
selectDay: '',
everyDay: [],
weekDates: [],
}
},
mounted() {
this.year = Number(this.getNowTime(new Date(), 2).slice(0, 4));
this.month = Number(this.getNowTime(new Date(), 2).slice(5, 7));
this.day = Number(this.getNowTime(new Date(), 2).slice(8, 10));
this.nowDay = this.getNowTime(new Date())
this.selectDay = this.getNowTime(new Date())
this.getWeekDates(new Date())
},
methods: {
//
changeDate(item) {
if (this.nowDay <= item) {
this.year = Number(item.slice(0, 4));
this.month = Number(item.slice(5, 7));
this.day = Number(item.slice(8, 10));
this.selectDay = item
this.$emit('changeDate', this.selectDay)
}
},
//
showLunar(date) {
if(this.monthShow) {
if (!date.date) return;
var lunarObj = lunar.solar2lunar(date.date.slice(0, 4), date.date.slice(5, 7), date.date.slice(8, 10));
}else {
var lunarObj = lunar.solar2lunar(date.slice(0, 4), date.slice(5, 7), date.slice(8, 10));
}
return lunarObj.festival || lunarObj.lunarFestival || lunarObj.IDayCn;
},
//
getNowTime(time, type) {
var date = time,
year = date.getFullYear(),
month = date.getMonth() + 1,
day = date.getDate(),
hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(),
minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes(),
second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
month >= 1 && month <= 9 ? (month = "0" + month) : "";
day >= 0 && day <= 9 ? (day = "0" + day) : "";
if (type == 1) {
if (uni.getSystemInfoSync().platform == 'ios') {
var timer = year + '/' + month + '/' + day + ' ' + hour + ':' + minute + ':' + second;
} else {
var timer = year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second;
}
} else {
var timer = year + '/' + month + '/' + day;
}
return timer;
},
//
getEveryDay(data) {
let date = new Date(data);
let month = date.getMonth();
//
date.setMonth(month + 1);
//-28293031便
date.setDate(0);
let dayArry = [];
let day = date.getDate(); //
for (let i = 1; i <= day; i++) {
date.setDate(i); //date.setDate(i)dayArry.push(i)date.setDate(i)
dayArry.push({
day: i,
week: this.getWeekday(date.getDay()),
date: this.getNowTime(date),
flag: 0
}); //
}
this.everyDay = dayArry;
this.resetDay();
},
getWeekday(day) {
return ['日', '一', '二', '三', '四', '五', '六'][day];
},
//
resetDay() {
let arr = this.weekList;
let w = this.everyDay[0].week;
arr.forEach((v, index) => {
if (v == w) {
let id = index;
if (id != 0) {
for (let i = 0; i < id; i++) {
this.everyDay.unshift({
day: '',
week: ''
});
}
}
}
});
},
//
getWeekDates(day) {
const currentDayOfWeek = day.getDay(); // ( 0 = ,...6 =
const startDate = new Date(day);
startDate.setDate(day.getDate() - currentDayOfWeek);
const weekDates = [];
for (let i = 0; i < 7; i++) {
const date = new Date(startDate);
date.setDate(startDate.getDate() + i);
weekDates.push(date)
}
this.weekDates = weekDates
},
//
preNextDate(e) {
if (this.monthShow) {
if (e) {
//
this.month += 1;
if (this.month > 12) {
this.year += 1;
this.month = 1;
}
if (uni.getSystemInfoSync().platform == 'ios') {
this.getEveryDay(this.year + '/' + this.month + '/' + 1);
} else {
this.getEveryDay(this.year + '-' + this.month);
}
} else {
//
this.month -= 1;
if (this.month == 0) {
this.year -= 1;
this.month = 12;
}
if (uni.getSystemInfoSync().platform == 'ios') {
this.getEveryDay(this.year + '/' + this.month + '/' + 1);
} else {
this.getEveryDay(this.year + '-' + this.month);
}
}
} else {
if (e) {
//
this.getNextWeekDates()
} else {
//
this.getPreviousWeekDates()
}
}
},
getPreviousWeekDates() {
const today = this.weekDates[0]
const previousWeekStartDate = new Date(today);
previousWeekStartDate.setDate(today.getDate() - 7); //
const previousWeekDates = [];
for (let i = 0; i < 7; i++) {
const date = new Date(previousWeekStartDate);
date.setDate(previousWeekStartDate.getDate() + i);
previousWeekDates.push(date);
}
this.weekDates = previousWeekDates;
this.year = Number(this.getNowTime(this.weekDates[0], 2).slice(0, 4));
this.month = Number(this.getNowTime(this.weekDates[0], 2).slice(5, 7));
},
getNextWeekDates() {
const today = this.weekDates[0]
const nextWeekStartDate = new Date(today);
nextWeekStartDate.setDate(today.getDate() + 7); //
const nextWeekDates = [];
for (let i = 0; i < 7; i++) {
const date = new Date(nextWeekStartDate);
date.setDate(nextWeekStartDate.getDate() + i);
nextWeekDates.push(date);
}
this.weekDates = nextWeekDates;
this.year = Number(this.getNowTime(this.weekDates[0], 2).slice(0, 4));
this.month = Number(this.getNowTime(this.weekDates[0], 2).slice(5, 7));
},
// /
changeWeekMonth() {
this.monthShow = !this.monthShow
this.month = Number(this.selectDay.slice(5, 7));
if (this.monthShow) {
this.year = Number(this.selectDay.slice(0, 4))
if (uni.getSystemInfoSync().platform == 'ios') {
this.getEveryDay(this.year + '/' + this.month + '/' + 1);
} else {
this.getEveryDay(this.year + '/' + this.month);
}
} else {
this.getWeekDates(new Date(this.selectDay))
}
},
}
}
</script>
<style lang="scss" scoped>
.calendar {
.calendar-top {
font-size: 27rpx;
font-family: PingFang SC;
font-weight: 500;
color: #000000;
padding: 59rpx 0 38rpx;
view:nth-child(2) {
font-size: 35rpx;
font-weight: bold;
}
.iconfont {
width: 11rpx;
height: 20rpx;
vertical-align: inherit;
}
}
.calendar-bottom {
display: flex;
flex-wrap: wrap;
padding: 33rpx 0 40rpx;
width: 697rpx;
height: auto;
background: #FFFFFF;
border-radius: 20rpx;
position: relative;
.week-item {
width: 14%;
text-align: center;
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #666666;
}
.day-box {
width: 14%;
height: 100rpx;
display: flex;
align-items: center;
justify-content: center;
.day-item {
font-size: 29rpx;
font-family: PingFang SC;
font-weight: 500;
color: #000000;
display: flex;
flex-direction: column;
justify-content: space-around;
text-align: center;
.day-lunar {
font-weight: 500;
font-size: 17rpx;
color: #999999;
text-align: center;
}
.day-point{
width: 5rpx;
height: 5rpx;
background: #FF3615;
border-radius: 50%;
margin: 5rpx auto 0;
}
}
.daySelect {
width: 80rpx;
height: 80rpx;
text-align: center;
background: #96684F;
border-radius: 27rpx;
color: #fff;
.day-lunar {
color: #fff;
}
}
}
.grayDate {
.day-item {
color: #999999;
.day-point{
background: #CCCCCC;
}
}
}
.iconfont {
width: 20rpx;
height: 20rpx;
display: block;
margin: 0 auto;
}
}
}
</style>

28
manifest.json

@ -76,20 +76,20 @@
}, },
"vueVersion" : "2", "vueVersion" : "2",
"h5" : { "h5" : {
// "devServer" : { "devServer" : {
// "port" : 5173, // "port" : 5173, //
// "disableHostCheck" : true, "disableHostCheck" : true,
// "proxy" : { "proxy" : {
// "/api" : { "/api" : {
// "target" : "http://47.103.142.123:1010/", // "target" : "http://47.103.142.123:1010/", //
// "changeOrigin" : true, // "changeOrigin" : true, //
// "secure" : true, // https "secure" : true, // https
// "pathRewrite" : { "pathRewrite" : {
// "^/api" : "" //devApi '' "^/api" : "" //devApi ''
// } }
// } }
// } }
// }, },
"router" : { "router" : {
"mode" : "history" "mode" : "history"
}, },

30
pages.json

@ -52,6 +52,24 @@
"style": { "style": {
"navigationBarTitleText": "注册信息" "navigationBarTitleText": "注册信息"
} }
},
{
"path": "user/accountPassword",
"style": {
"navigationBarTitleText": "订单详情"
}
},
{
"path": "order/orderList",
"style": {
"navigationBarTitleText": "我的订单"
}
},
{
"path": "order/orderDetail",
"style": {
"navigationBarTitleText": "订单详情"
}
} }
] ]
}], }],
@ -69,12 +87,12 @@
"selectedIconPath": "/static/images/homes.png", "selectedIconPath": "/static/images/homes.png",
"text": "首页" "text": "首页"
}, },
{ // {
"pagePath": "pages/dialogue/index", // "pagePath": "pages/dialogue/index",
"iconPath": "/static/images/dialogue.png", // "iconPath": "/static/images/dialogue.png",
"selectedIconPath": "/static/images/dialogues.png", // "selectedIconPath": "/static/images/dialogues.png",
"text": "对话" // "text": "对话"
}, // },
{ {
"pagePath": "pages/verification/index", "pagePath": "pages/verification/index",
"iconPath": "/static/images/hx.png", "iconPath": "/static/images/hx.png",

418
pages/index/index.vue

@ -9,7 +9,7 @@
立即核销 立即核销
<image src="https://static.ticket.sz-trip.com/tourGuide/images/index/hexiao.png" mode=""></image> <image src="https://static.ticket.sz-trip.com/tourGuide/images/index/hexiao.png" mode=""></image>
</view> </view>
<view class="nav-item flex-around"> <view class="nav-item flex-around" @click="gotoPath('/subPackages/order/orderList')">
查看订单 查看订单
<image src="https://static.ticket.sz-trip.com/tourGuide/images/index/dingdan.png" mode=""></image> <image src="https://static.ticket.sz-trip.com/tourGuide/images/index/dingdan.png" mode=""></image>
</view> </view>
@ -19,60 +19,17 @@
<view class="type-box"> <view class="type-box">
<view v-for="(item,index) in typeList" :key="index" <view v-for="(item,index) in typeList" :key="index"
:class="['type-item', {'type-active': index == typeIndex}]" @click="typeIndex = index"> :class="['type-item', {'type-active': index == typeIndex}]" @click="typeIndex = index;getList()">
{{item.title}} {{item.title}}
<view class="type-line" v-if="index == typeIndex"></view> <view class="type-line" v-if="index == typeIndex"></view>
</view> </view>
</view> </view>
<!-- 日历 --> <!-- 日历 -->
<view class="calendar" v-if="typeIndex == 0"> <calendarVue :isShowLunar="true" @changeDate="getDate"></calendarVue>
<view class="calendar-top flex-between">
<view @click="preNextDate(0)">
<img src="https://static.ticket.sz-trip.com/tourGuide/images/index/leftIcon.png" class="iconfont"
style="margin-right: 13rpx;" />
{{ monthShow ? '上一月' : '上一周' }}
</view>
<view>{{year}}{{month}}</view>
<view @click="preNextDate(1)">
{{ monthShow ? '下一月' : '下一周' }}
<img src="https://static.ticket.sz-trip.com/tourGuide/images/index/rightIcon.png" class="iconfont"
style="margin-left: 13rpx;" />
</view>
</view>
<view class="calendar-bottom">
<view class="week-item" v-for="(item,index) in weekList" :key="item + index">
{{item}}
</view>
<view v-for="(item, index) in everyDay" :key="item.day" class="day-box flex-center"
:class="(nowDay > item.date) ? 'grayDate' : ''" v-if="monthShow">
<view :class="['day-item', selectDay == item.date ? 'daySelect' : '']"
@click="changeDate(item.date)">
{{ nowDay== item.date ? '今日' : item.day }}
<view class="day-lunar">{{showLunar(item)}}</view>
</view>
</view>
<view v-for="(item, index) in weekDates" :key="item + index" class="day-box flex-center"
:class="(nowDay > getNowTime(item)) ? 'grayDate' : ''" v-if="!monthShow">
<view :class="['day-item', selectDay == getNowTime(item) ? 'daySelect' : '']"
@click="changeDate(getNowTime(item))">
{{ nowDay == getNowTime(item) ? '今日' : getNowTime(item).slice(-2) }}
<view class="day-lunar">{{showLunar(getNowTime(item))}}</view>
</view>
</view>
<view class="" style="width: 100%;height: 50rpx;padding: 20rpx;" @click="changeWeekMonth">
<img :src="monthShow ? 'https://static.ticket.sz-trip.com/hsrNewTown/images/calendar/top.png' : 'https://static.ticket.sz-trip.com/hsrNewTown/images/calendar/bottom.png'"
class="iconfont" />
</view>
</view>
</view>
<!-- 选择场次 --> <!-- 选择场次 -->
<view v-for="(item,index) in sessionList" :key="index" class="session-item flex-between"> <view v-for="(item,index) in typeIndex ? sessionLists : sessionList" :key="index" class="session-item flex-between">
{{item.title}} {{item.title}}
<switch :checked="item.isChecked" color="#96684F" @change="switchChange(item,index)"/> <switch :checked="item.isChecked" color="#96684F" @change="switchChange(item,index)"/>
</view> </view>
@ -80,40 +37,30 @@
</template> </template>
<script> <script>
import { import calendarVue from '../../components/calendar.vue';
lunar
} from "../../static/js/lunar.js"
export default { export default {
components: {calendarVue},
data() { data() {
return { return {
typeList: [{ typeList: [{
title: '导游服务', title: '导游服务',
id: '' id: ''
}, },
{ // {
title: '线上咨询', // title: '线',
id: '' // id: ''
}, // },
{ // {
title: '拼团产品', // title: '',
id: '' // id: ''
}, // },
{ {
title: '线路产品', title: '线路产品',
id: '' id: ''
} }
], ],
typeIndex: 0, typeIndex: 0,
weekList: ['日', '一', '二', '三', '四', '五', '六'],
monthShow: false,
year: 0,
month: 0,
day: 0,
week: '',
nowDay: '',
selectDay: '', selectDay: '',
everyDay: [],
weekDates: [],
sessionList: [ sessionList: [
{ {
title: '上午场', title: '上午场',
@ -128,53 +75,85 @@
isChecked: false isChecked: false
} }
], ],
isAllChecked: false sessionLists: [
{
title: '当天状态',
isChecked: false
}
],
isAllChecked: false,
} }
}, },
onLoad() { onLoad() {
this.year = Number(this.getNowTime(new Date(), 2).slice(0, 4));
this.month = Number(this.getNowTime(new Date(), 2).slice(5, 7));
this.day = Number(this.getNowTime(new Date(), 2).slice(8, 10));
this.nowDay = this.getNowTime(new Date())
this.selectDay = this.getNowTime(new Date()) this.selectDay = this.getNowTime(new Date())
this.getWeekDates(new Date()) this.getList()
}, },
methods: { methods: {
// //
switchChange(item, index) { switchChange(item, index) {
item.isChecked = !item.isChecked item.isChecked = !item.isChecked
if(index == 2) { // if(index == 2) {
for (let i = 0; i < 2; i++) { // for (let i = 0; i < 2; i++) {
this.sessionList[i].isChecked = this.sessionList[2].isChecked // this.sessionList[i].isChecked = this.sessionList[2].isChecked
} // }
}else { // }else {
if(this.sessionList[0].isChecked && this.sessionList[1].isChecked) { // if(this.sessionList[0].isChecked && this.sessionList[1].isChecked) {
this.sessionList[2].isChecked = true // this.sessionList[2].isChecked = true
}else { // }else {
this.sessionList[2].isChecked = false // this.sessionList[2].isChecked = false
} // }
} // }
let url = this.typeIndex ? '/api/Merchants/updateGuideSched' : '/api/Merchants/updateGuideSchedService'
this.Post({
date: this.selectDay,
online_type: item.isChecked ? 1 : 0, //
date_half: this.typeIndex ? '' : index + 1, // 1 2 3
classify: this.typeIndex ? 2 : '' // 12线
}, url).then(res => {
})
}, },
// getDate(date) {
changeDate(item) { console.log('传递过来的日期',date)
if (this.nowDay <= item) { this.selectDay = date
this.year = Number(item.slice(0, 4));
this.month = Number(item.slice(5, 7)); this.sessionList.forEach(item => item.isChecked = false)
this.day = Number(item.slice(8, 10)); this.sessionLists[0].isChecked = false
this.selectDay = item
} this.getList()
},
changeWork(date) {
// // date_half123
// this.Post({
// date: date,
// date_half
// },'/api/Merchants/updateGuideSchedService').then(res => {
// })
}, },
// getList() {
showLunar(date) { // classify12线3
if(this.monthShow) { this.Post({
if (!date.date) return; start_date: this.selectDay,
var lunarObj = lunar.solar2lunar(date.date.slice(0, 4), date.date.slice(5, 7), date.date.slice(8, 10)); end_date: this.selectDay,
classify: this.typeIndex ? 2 : 3
},'/api/Merchants/getGuideSchedList').then(res => {
if(res.data && res.data.length > 0) {
let data = res.data[0]
if(this.typeIndex) {
// 线
this.sessionLists[0].isChecked = data.online_type ? true : false
}else { }else {
var lunarObj = lunar.solar2lunar(date.slice(0, 4), date.slice(5, 7), date.slice(8, 10)); //
this.sessionList[0].isChecked = data.morning_type ? true : false
this.sessionList[1].isChecked = data.afternoon_type ? true : false
this.sessionList[2].isChecked = data.day_type ? true : false
} }
}
return lunarObj.festival || lunarObj.lunarFestival || lunarObj.IDayCn; })
}, },
// //
getNowTime(time, type) { getNowTime(time, type) {
@ -199,150 +178,6 @@
return timer; return timer;
}, },
//
getEveryDay(data) {
let date = new Date(data);
let month = date.getMonth();
//
date.setMonth(month + 1);
//-28293031便
date.setDate(0);
let dayArry = [];
let day = date.getDate(); //
for (let i = 1; i <= day; i++) {
date.setDate(i); //date.setDate(i)dayArry.push(i)date.setDate(i)
dayArry.push({
day: i,
week: this.getWeekday(date.getDay()),
date: this.getNowTime(date),
flag: 0
}); //
}
this.everyDay = dayArry;
this.resetDay();
},
getWeekday(day) {
return ['日', '一', '二', '三', '四', '五', '六'][day];
},
//
resetDay() {
let arr = this.weekList;
let w = this.everyDay[0].week;
arr.forEach((v, index) => {
if (v == w) {
let id = index;
if (id != 0) {
for (let i = 0; i < id; i++) {
this.everyDay.unshift({
day: '',
week: ''
});
}
}
}
});
},
//
getWeekDates(day) {
const currentDayOfWeek = day.getDay(); // ( 0 = ,...6 =
const startDate = new Date(day);
startDate.setDate(day.getDate() - currentDayOfWeek);
const weekDates = [];
for (let i = 0; i < 7; i++) {
const date = new Date(startDate);
date.setDate(startDate.getDate() + i);
weekDates.push(date)
}
this.weekDates = weekDates
},
//
preNextDate(e) {
if (this.monthShow) {
if (e) {
//
this.month += 1;
if (this.month > 12) {
this.year += 1;
this.month = 1;
}
if (uni.getSystemInfoSync().platform == 'ios') {
this.getEveryDay(this.year + '/' + this.month + '/' + 1);
} else {
this.getEveryDay(this.year + '-' + this.month);
}
} else {
//
this.month -= 1;
if (this.month == 0) {
this.year -= 1;
this.month = 12;
}
if (uni.getSystemInfoSync().platform == 'ios') {
this.getEveryDay(this.year + '/' + this.month + '/' + 1);
} else {
this.getEveryDay(this.year + '-' + this.month);
}
}
} else {
if (e) {
//
this.getNextWeekDates()
} else {
//
this.getPreviousWeekDates()
}
}
},
getPreviousWeekDates() {
const today = this.weekDates[0]
const previousWeekStartDate = new Date(today);
previousWeekStartDate.setDate(today.getDate() - 7); //
const previousWeekDates = [];
for (let i = 0; i < 7; i++) {
const date = new Date(previousWeekStartDate);
date.setDate(previousWeekStartDate.getDate() + i);
previousWeekDates.push(date);
}
this.weekDates = previousWeekDates;
this.year = Number(this.getNowTime(this.weekDates[0], 2).slice(0, 4));
this.month = Number(this.getNowTime(this.weekDates[0], 2).slice(5, 7));
},
getNextWeekDates() {
const today = this.weekDates[0]
const nextWeekStartDate = new Date(today);
nextWeekStartDate.setDate(today.getDate() + 7); //
const nextWeekDates = [];
for (let i = 0; i < 7; i++) {
const date = new Date(nextWeekStartDate);
date.setDate(nextWeekStartDate.getDate() + i);
nextWeekDates.push(date);
}
this.weekDates = nextWeekDates;
this.year = Number(this.getNowTime(this.weekDates[0], 2).slice(0, 4));
this.month = Number(this.getNowTime(this.weekDates[0], 2).slice(5, 7));
},
// /
changeWeekMonth() {
this.monthShow = !this.monthShow
this.month = Number(this.selectDay.slice(5, 7));
if (this.monthShow) {
this.year = Number(this.selectDay.slice(0, 4))
if (uni.getSystemInfoSync().platform == 'ios') {
this.getEveryDay(this.year + '/' + this.month + '/' + 1);
} else {
this.getEveryDay(this.year + '/' + this.month);
}
} else {
this.getWeekDates(new Date(this.selectDay))
}
},
} }
} }
</script> </script>
@ -351,7 +186,7 @@
.content { .content {
background: #FFFFFF; background: #FFFFFF;
min-height: 100vh; min-height: 100vh;
padding: 40rpx 26rpx 100rpx; padding: 40rpx 26rpx 200rpx;
} }
.topImg { .topImg {
@ -407,99 +242,6 @@
} }
} }
.calendar {
.calendar-top {
font-size: 27rpx;
font-family: PingFang SC;
font-weight: 500;
color: #000000;
padding: 59rpx 0 38rpx;
view:nth-child(2) {
font-size: 35rpx;
font-weight: bold;
}
.iconfont {
width: 11rpx;
height: 20rpx;
vertical-align: inherit;
}
}
.calendar-bottom {
display: flex;
flex-wrap: wrap;
padding: 33rpx 0 40rpx;
width: 697rpx;
height: auto;
background: #FFFFFF;
border-radius: 20rpx;
position: relative;
.week-item {
width: 14%;
text-align: center;
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #666666;
}
.day-box {
width: 14%;
height: 100rpx;
display: flex;
align-items: center;
justify-content: center;
.day-item {
font-size: 29rpx;
font-family: PingFang SC;
font-weight: 500;
color: #000000;
display: flex;
flex-direction: column;
justify-content: space-around;
text-align: center;
.day-lunar {
font-weight: 500;
font-size: 17rpx;
color: #999999;
text-align: center;
}
}
.daySelect {
width: 80rpx;
height: 80rpx;
text-align: center;
background: #96684F;
border-radius: 27rpx;
color: #fff;
.day-lunar {
color: #fff;
}
}
}
.grayDate {
.day-item {
color: #999999;
}
}
.iconfont {
width: 20rpx;
height: 20rpx;
display: block;
margin: 0 auto;
}
}
}
.session-item { .session-item {
width: 697rpx; width: 697rpx;
height: 93rpx; height: 93rpx;

28
pages/login/login.vue

@ -10,7 +10,7 @@
<view class="item flex-between"> <view class="item flex-between">
<image src="https://static.ticket.sz-trip.com/tourGuide/images/login/code.png" mode="" class="icon"></image> <image src="https://static.ticket.sz-trip.com/tourGuide/images/login/code.png" mode="" class="icon"></image>
<input type="text" v-model="form.captchaCodeId" placeholder="请输入图形验证码"/> <input type="text" v-model="form.captchaCodeId" placeholder="请输入图形验证码"/>
<image src="https://static.ticket.sz-trip.com/tourGuide/images/index/topImg.png" mode="" class="code-img"></image> <image :src="codeImg" mode="" class="code-img" @click="getCodeImg"></image>
</view> </view>
<view class="item flex-between"> <view class="item flex-between">
@ -31,22 +31,34 @@
data() { data() {
return { return {
form: { form: {
username: '17717512304', username: '',
captchaCodeId: '558092', captchaCodeId: '',
password: '512304' password: ''
}, },
showPassword: true showPassword: true,
codeImg: ''
} }
}, },
onShow() { onShow() {
this.getCodeImg()
},
methods: {
//
getCodeImg() {
this.Post({},'/api/Merchants/get_graphic').then(res => { this.Post({},'/api/Merchants/get_graphic').then(res => {
console.log(res) this.codeImg = res.data.code
}) })
}, },
methods: {
login() { login() {
this.Post(this.form,'/api/Merchants/login_member').then(res => { this.Post(this.form,'/api/Merchants/login_member').then(res => {
console.log(res) this.$store.commit('changeUserInfo', res.data)
if (this.$store.state.user.toPath.includes('user/user')) {
uni.switchTab({
url: this.$store.state.user.toPath
})
} else {
uni.navigateBack({})
}
}) })
} }
} }

16
pages/user/user.vue

@ -4,8 +4,8 @@
<view class="top-left"> <view class="top-left">
<image src="https://static.ticket.sz-trip.com/tourGuide/images/index/topImg.png" mode="" class="avatar"></image> <image src="https://static.ticket.sz-trip.com/tourGuide/images/index/topImg.png" mode="" class="avatar"></image>
<view class="flex-column"> <view class="flex-column">
<view class="top-title">苏小小</view> <view class="top-title">{{userInfo.nickname}}</view>
<view class="top-subtitle">大师级导游</view> <view class="top-subtitle">{{userInfo.group_data.name}}</view>
</view> </view>
</view> </view>
<view class="top-right"> <view class="top-right">
@ -34,14 +34,20 @@
}, },
{ {
title: '我的订单', title: '我的订单',
path: '' path: '/subPackages/order/orderList'
}, },
{ {
title: '账号密码', title: '账号密码',
path: '' path: '/subPackages/user/accountPassword'
} }
] ],
userInfo: {}
} }
},
onShow() {
this.Post({}, '/api/Merchants/get_login_details').then(res => {
this.userInfo = res.data
})
} }
} }
</script> </script>

8
static/js/request.js

@ -4,12 +4,12 @@ import store from '@/store'
let NEWAPIURL = process.env.NODE_ENV == 'development' ? 'http://47.103.142.123:1010' : 'http://47.103.142.123:1010' let NEWAPIURL = process.env.NODE_ENV == 'development' ? 'http://47.103.142.123:1010' : 'http://47.103.142.123:1010'
Vue.prototype.NEWAPIURL = NEWAPIURL Vue.prototype.NEWAPIURL = NEWAPIURL
// #ifdef H5 // #ifdef H5
// NEWAPIURL = '/api' NEWAPIURL = '/api'
// #endif // #endif
Vue.prototype.Post = (params, apiurl) => { Vue.prototype.Post = (params, apiurl) => {
if (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo')).token) params.token = JSON.parse(uni.getStorageSync('userInfo')).token if (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo')).token) params.merchants_token = JSON.parse(uni.getStorageSync('userInfo')).token
else if (store.state.user.userInfo.token) params.token = store.state.user.userInfo.token else if (store.state.user.userInfo.token) params.merchants_token = store.state.user.userInfo.token
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中'
@ -20,7 +20,7 @@ Vue.prototype.Post = (params, apiurl) => {
data: params || {}, data: params || {},
header: params.header || { header: params.header || {
'content-type': 'application/json', 'content-type': 'application/json',
'token': params.token || '' 'merchants_token': params.merchants_token || ''
}, },
success: res => { success: res => {
uni.hideLoading() uni.hideLoading()

135
subPackages/order/orderDetail.vue

@ -0,0 +1,135 @@
<template>
<view class="bg">
<div class="box">
<view class="box-title">订单详情</view>
<view class="item">
<view class="title">下单日期:</view>
<view class="subtitle">{{detail.a}}</view>
</view>
<view class="item">
<view class="title">订单号:</view>
<view class="subtitle">{{detail.b}}</view>
</view>
</div>
<div class="box">
<view class="box-title" style="text-align: left;">产品信息</view>
<view class="item">
<view class="title">产品类型:</view>
<view class="subtitle">{{detail.c}}</view>
</view>
<view class="item">
<view class="title">产品类型:</view>
<view class="subtitle">{{detail.d}}</view>
</view>
<view class="item">
<view class="title">产品类型:</view>
<view class="subtitle">{{detail.e}}</view>
</view>
<view class="item">
<view class="title">产品类型:</view>
<view class="subtitle">{{detail.f}}</view>
</view>
</div>
<div class="box">
<view class="box-title" style="text-align: left;">订单信息</view>
<view class="item">
<view class="title">下单日期:</view>
<view class="subtitle">{{detail.g}}</view>
</view>
<view class="item">
<view class="title">订单号:</view>
<view class="subtitle">{{detail.h}}</view>
</view>
<view class="item">
<view class="title">订单号:</view>
<view class="subtitle">{{detail.i}}</view>
</view>
<view class="item">
<view class="title">订单号:</view>
<view class="subtitle">{{detail.j}}</view>
</view>
<view class="item">
<view class="title">出行人手机号1:</view>
<view class="subtitle">{{detail.k}}</view>
</view>
<view class="item">
<view class="title">订单号:</view>
<view class="subtitle">{{detail.l}}</view>
</view>
<view class="item">
<view class="title">订单号:</view>
<view class="subtitle">{{detail.m}}</view>
</view>
</div>
</view>
</template>
<script>
export default {
data() {
return {
detail: {
a: '2024-11-23',
b: 'JD85212456964232',
c: '产品类型产品类型产品类型产品类型',
d: '产品名称产品名称产品名称产品名称 产品名称',
e: '规格名称规格名称规格名称规格名称',
f: '800元',
g: '2',
h: '1600元',
i: '2024-11-23',
j: '于冰',
k: '15036660000',
l: '孙宁',
m: '13188889999',
}
}
}
}
</script>
<style lang="scss" scoped>
.bg {
min-height: 100vh;
background: #F5F5F5;
padding: 50rpx 26rpx;
}
.box {
padding: 30rpx 26rpx;
background: #FFFFFF;
border-radius: 13rpx;
margin-bottom: 30rpx;
.box-title {
text-align: center;
font-weight: bold;
font-size: 32rpx;
color: #000000;
}
.item {
margin-top: 20rpx;
display: flex;
.title {
min-width: 210rpx;
font-weight: 500;
font-size: 28rpx;
color: #000000;
}
.subtitle {
font-weight: 500;
font-size: 28rpx;
color: #646464;
span {
color: #96684F;
}
}
}
}
</style>

163
subPackages/order/orderList.vue

@ -0,0 +1,163 @@
<template>
<view class="bg">
<view class="search-box flex-center">
<image src="https://static.ticket.sz-trip.com/tourGuide/images/order/search.png" mode=""></image>
<input type="text" placeholder="输入订单号搜索" v-model="keywords" />
<view class="search-btn" @click="getList">
搜索
</view>
</view>
<calendarVue :isShowLunar="false" @changeDate="getList"></calendarVue>
<view class="box" v-for="(item, index) in list" :key="index">
<view class="box-title">订单详情</view>
<view class="item">
<view class="title">下单日期:</view>
<view class="subtitle">{{item.a}}</view>
</view>
<view class="item">
<view class="title">订单号:</view>
<view class="subtitle">{{item.b}}</view>
</view>
<view class="item">
<view class="title">状态:</view>
<view class="subtitle"><span>{{item.c}}</span></view>
</view>
<view class="item">
<view class="title">产品类型:</view>
<view class="subtitle">{{item.d}}</view>
</view>
<view class="item">
<view class="title">产品名称:</view>
<view class="subtitle">{{item.e}}</view>
</view>
<view class="item">
<view class="title">预定人手机号:</view>
<view class="subtitle">{{item.f}}</view>
</view>
</view>
<view class="empty-text">
暂无订单数据
</view>
</view>
</template>
<script>
import calendarVue from '../../components/calendar.vue';
export default {
components: {calendarVue},
data() {
return {
list: [
{
a: '2024-11-23',
b: 'JD85212456964232',
c: '出票成功',
d: '产品类型产品类型产品类型产品类型 产品类型',
e: '产品名称产品名称产品名称产品名称 产品名称产品名称产品名称产品',
f: '16099998888'
},
{
a: '2024-11-23',
b: 'JD85212456964232',
c: '出票成功',
d: '产品类型产品类型产品类型产品类型 产品类型',
e: '产品名称产品名称产品名称产品名称 产品名称产品名称产品名称产品',
f: '16099998888'
}
],
keywords: ''
}
},
methods: {
getList() {
}
}
}
</script>
<style lang="scss" scoped>
.bg {
background: #F5F5F5;
min-height: 100vh;
padding: 50rpx 26rpx 50rpx;
}
.search-box {
width: 697rpx;
height: 93rpx;
background: #FFFFFF;
border-radius: 47rpx;
padding: 0 40rpx 0 26rpx;
image {
width: 42.67rpx;
height: 42.67rpx;
margin-right: 23rpx;
}
input {
font-weight: 400;
font-size: 27rpx;
color: #717171;
flex: 1;
}
.search-btn {
padding-left: 40rpx;
line-height: 64rpx;
border-left: 1rpx solid #717171;
font-weight: 400;
font-size: 27rpx;
color: #0B898E;
margin-left: 23rpx;
}
}
.box {
padding: 50rpx 26rpx;
background: #FFFFFF;
border-radius: 13rpx;
margin-top: 30rpx;
.box-title {
text-align: center;
font-weight: 500;
font-size: 32rpx;
color: #000000;
}
.item {
margin-top: 20rpx;
display: flex;
.title {
min-width: 200rpx;
font-weight: 500;
font-size: 28rpx;
color: #000000;
}
.subtitle {
font-weight: 500;
font-size: 28rpx;
color: #646464;
span {
color: #96684F;
}
}
}
}
.empty-text {
font-weight: 500;
font-size: 40rpx;
color: #646464;
text-align: center;
margin: 30rpx 0;
}
</style>

50
subPackages/user/accountPassword.vue

@ -0,0 +1,50 @@
<template>
<view class="bg">
<view class="item flex-between">
<view>登录账号</view>
<view>{{userInfo.mobile}}</view>
</view>
<view class="item flex-between">
<view>密码</view>
<view>****** <image url="https://static.ticket.sz-trip.com/tourGuide/images/user/rightGray.png"></image></view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
userInfo: {}
}
},
onShow() {
this.userInfo = (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo'))) || this.$store.state.user.userInfo || {}
console.log(this.userInfo)
}
}
</script>
<style lang="scss" scoped>
.bg {
min-height: 100vh;
background: #F5F5F5;
padding: 0 26rpx;
}
.item {
height: 110rpx;
font-weight: 500;
font-size: 28rpx;
color: #000000;
border-bottom: 1rpx solid #D8D8D8;
image {
width: 11.33rpx;
height: 20rpx;
margin-left: 20rpx;
vertical-align: middle;
}
}
</style>
Loading…
Cancel
Save