@ -1,3 +1,2 @@ |
|||||
/.hbuilderx/ |
/.hbuilderx/ |
||||
/unpackage/ |
/unpackage/ |
||||
/node_modules/ |
|
@ -0,0 +1,76 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
|
||||
|
<!--如果需要solt--> |
||||
|
<!--用法二:当mode=2、3的模式下分别为(酒店\往返)的离开日期--> |
||||
|
<Calendar @click="tip" :is-show="true" :start-date="startDate" :end-date="endDate" mode="2" :title="'日期选择'" |
||||
|
@callback="getDate" :transition="'slide'" :theme-color="'#96684F'" /> |
||||
|
<div class="btn" @click="determine()"> |
||||
|
确定 |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
import Calendar from 'mobile-calendar-simple' |
||||
|
export default { |
||||
|
props: ['startDate', 'endDate'], |
||||
|
data() { |
||||
|
return { //日期均为yyyy-mm-dd或者yyyy/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('changeScenicDate',null) |
||||
|
} else { |
||||
|
let date = this.date |
||||
|
let data = { |
||||
|
startDay: date.startStr.dateStr, |
||||
|
endDay: date.endStr.dateStr, |
||||
|
differDays: date.dayCount |
||||
|
} |
||||
|
uni.$emit('changeScenicDate',data) |
||||
|
} |
||||
|
}, |
||||
|
//获取回调的日期数据 |
||||
|
getDate(date) { |
||||
|
this.date = date |
||||
|
}, |
||||
|
tip() { |
||||
|
console.log(1); |
||||
|
} |
||||
|
}, |
||||
|
components: { |
||||
|
Calendar |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
<style scoped> |
||||
|
.btn { |
||||
|
width: 697rpx; |
||||
|
height: 73rpx; |
||||
|
background: #DC2525; |
||||
|
line-height: 73rpx; |
||||
|
font-size: 32rpx; |
||||
|
font-family: PingFang SC; |
||||
|
font-weight: bold; |
||||
|
color: #FFFFFF; |
||||
|
text-align: center; |
||||
|
position: fixed; |
||||
|
bottom: 30rpx; |
||||
|
z-index: 999; |
||||
|
text-align: center; |
||||
|
left: 50%; |
||||
|
transform: translate(-348.5rpx, 0); |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,585 @@ |
|||||
|
<template> |
||||
|
<transition :name="transition"> |
||||
|
<div class="calendar-tz" v-if="isShow" :class="isFixed&&'fixed'"> |
||||
|
<slot name="header"></slot> |
||||
|
<div class="week-number"> |
||||
|
<span v-for="(item,index) in weekList" :style="{color:(index==0||index==weekList.length-1)&&themeColor}" :key="index">{{item}}</span> |
||||
|
</div> |
||||
|
<p class="tips" v-if="title">{{title}}</p> |
||||
|
<div class="content" id="scrollWrap"> |
||||
|
<div class="con" v-for="(item,index) in calendar" :key="index" :id="item.year+''+item.month"> |
||||
|
<h3 v-text="item.year + '年' + item.month + '月'"></h3> |
||||
|
<span class="month-bg" :style="{color:getBetweenColor}">{{item.month}}</span> |
||||
|
<ul class="each-month"> |
||||
|
<li class="each-day" v-for="(day,idx) in item.dayList" :key="idx" :class="[addClassBg(day, item.month, item.year)]" :style="{background:themeOpacityBg(day, item.month, item.year)}" @click="chooseDate(day, item.month, item.year)"> |
||||
|
<div :class="[addClassName(day, item.month, item.year)]" :style="{background:themeBg(day, item.month, item.year)}"> |
||||
|
<p class="day-tip" :style="{color:themeColor}"><i v-text="setTip(day, item.month, item.year,1)"></i></p> |
||||
|
<p class="day">{{day?day:''}}</p> |
||||
|
<p class="recent"><i v-text="setTip(day, item.month, item.year,2)"></i></p> |
||||
|
</div> |
||||
|
</li> |
||||
|
</ul> |
||||
|
</div> |
||||
|
</div> |
||||
|
<slot name="footer"></slot> |
||||
|
</div> |
||||
|
</transition> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
props: { |
||||
|
isShow: {//是否显示 |
||||
|
type: [Boolean], |
||||
|
default() { |
||||
|
return false; |
||||
|
} |
||||
|
}, |
||||
|
isFixed: {//是否定位全屏 |
||||
|
type: [Boolean], |
||||
|
default() { |
||||
|
return true; |
||||
|
} |
||||
|
}, |
||||
|
transition: {//动画类型slide |
||||
|
type: [String], |
||||
|
default() { |
||||
|
return ""; |
||||
|
} |
||||
|
}, |
||||
|
title: {//头部的一段文本 |
||||
|
type: [String, Object], |
||||
|
default() { |
||||
|
return ""; |
||||
|
} |
||||
|
}, |
||||
|
mode: {//模式:1普通日历,2酒店,3飞机往返 |
||||
|
type: [String, Number], |
||||
|
default() { |
||||
|
return 1; |
||||
|
} |
||||
|
}, |
||||
|
startDate: {//开始日期 |
||||
|
type: [String, Object, Date] |
||||
|
}, |
||||
|
endDate: {//结束日期 |
||||
|
type: [String, Object, Date] |
||||
|
}, |
||||
|
betweenStart: {//日历可选范围开始 |
||||
|
type: [String, Object, Date], |
||||
|
default() { |
||||
|
return ""; |
||||
|
} |
||||
|
}, |
||||
|
betweenEnd: { //日历可选结束日期 |
||||
|
type: [String, Object, Date], |
||||
|
default() { |
||||
|
return ""; |
||||
|
} |
||||
|
}, |
||||
|
initMonth: {//初始化的月数 |
||||
|
type: [String, Number], |
||||
|
default() { |
||||
|
return 6; |
||||
|
} |
||||
|
}, |
||||
|
themeColor: {//主题色 |
||||
|
type: [String], |
||||
|
default: "#1C75FF" |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
startDates: "", |
||||
|
endDates: "", |
||||
|
betweenStarts: "", |
||||
|
betweenEnds: "", |
||||
|
calendar: [], |
||||
|
weekList: ["日", "一", "二", "三", "四", "五", "六"] |
||||
|
}; |
||||
|
}, |
||||
|
watch: { |
||||
|
isShow() { |
||||
|
this.init(); |
||||
|
}, |
||||
|
betweenStart() { |
||||
|
this.init(); |
||||
|
}, |
||||
|
betweenEnd() { |
||||
|
this.init(); |
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.init(); |
||||
|
}, |
||||
|
computed: { |
||||
|
//设置主题色入住离开之间的背景色 |
||||
|
getBetweenColor() { |
||||
|
if (!this.themeColor) return; |
||||
|
var hex = this.themeColor; |
||||
|
if (hex.length == 4) { |
||||
|
hex = `#${hex[1]}${hex[1]}${hex[2]}${hex[2]}${hex[3]}${hex[3]}`; |
||||
|
} |
||||
|
var str = "rgba(" + parseInt("0x" + hex.slice(1, 3)) + "," + parseInt("0x" + hex.slice(3, 5)) + "," + parseInt("0x" + hex.slice(5, 7)) + ",0.1)"; |
||||
|
return str; |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
init() { |
||||
|
var date = new Date(); |
||||
|
this.year = date.getFullYear(); |
||||
|
this.month = date.getMonth() + 1; |
||||
|
this.day = date.getDate(); |
||||
|
this.today = new Date(this.year + "/" + this.month + "/" + this.day) * 1; |
||||
|
if (!this.startDate) { |
||||
|
const year = date.getFullYear(), |
||||
|
month = date.getMonth() + 1, |
||||
|
day = date.getDate(); |
||||
|
this.startDates = this.resetTime(year + "/" + month + "/" + day); |
||||
|
this.startYear = year; |
||||
|
this.startMonth = month; |
||||
|
} else { |
||||
|
this.startDates = this.resetTime(this.startDate); |
||||
|
var dd = this.startDate.replace(/-/g, "/").split("/"); |
||||
|
this.startYear = dd[0]; |
||||
|
this.startMonth = dd[1]; |
||||
|
} |
||||
|
if (!this.endDate) { |
||||
|
// var temp = this.startDates + 24 * 60 * 60 * 1000; |
||||
|
// var dateTemp = new Date(temp); |
||||
|
// const year = dateTemp.getFullYear(), |
||||
|
// month = dateTemp.getMonth() + 1, |
||||
|
// day = dateTemp.getDate(); |
||||
|
// this.endDates = this.resetTime(year + "/" + month + "/" + day); |
||||
|
// this.endYear = year; |
||||
|
// this.endMonth = month; |
||||
|
} else { |
||||
|
this.endDates = this.resetTime(this.endDate); |
||||
|
var dd = this.endDate.replace(/-/g, "/").split("/"); |
||||
|
this.endYear = dd[0]; |
||||
|
this.endMonth = dd[1]; |
||||
|
} |
||||
|
this.betweenStarts = this.resetTime(this.betweenStart); |
||||
|
this.betweenEnds = this.resetTime(this.betweenEnd); |
||||
|
this.createClendar(); //创建日历数据 |
||||
|
}, |
||||
|
//创建每个月日历数据,传入月份1号前面用null填充 |
||||
|
createDayList(month, year) { |
||||
|
const count = this.getDayNum(month, year), |
||||
|
_week = new Date(year + "/" + month + "/1").getDay(); |
||||
|
let list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28]; |
||||
|
for (let i = 29; i <= count; i++) { |
||||
|
list.push(i); |
||||
|
} |
||||
|
for (let i = 0; i < _week; i++) { |
||||
|
list.unshift(null); |
||||
|
} |
||||
|
return list; |
||||
|
}, |
||||
|
//计算传入月份有多少天 |
||||
|
getDayNum(month, year) { |
||||
|
let dayNum = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; |
||||
|
if ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) { |
||||
|
dayNum[1] = 29; |
||||
|
} |
||||
|
return dayNum[month - 1]; |
||||
|
}, |
||||
|
//根据当天和结束日期创建日历数据 |
||||
|
createClendar() { |
||||
|
var yearTemp = this.year; |
||||
|
var monthTemp = this.month; |
||||
|
if (!!this.betweenStarts) { |
||||
|
//如果有范围起始日期,可选范围从betweenStart开始 |
||||
|
yearTemp = new Date(this.betweenStarts).getFullYear(); |
||||
|
monthTemp = new Date(this.betweenStarts).getMonth() + 1; |
||||
|
} |
||||
|
this.calendar = []; |
||||
|
for (let i = 0; i < this.initMonth; i++) { |
||||
|
let year = yearTemp; |
||||
|
let month = monthTemp + i; |
||||
|
let _monthData = { |
||||
|
dayList: [], |
||||
|
month: "", |
||||
|
year: "" |
||||
|
}; |
||||
|
var m = Math.ceil(month / 12); |
||||
|
if (m > 0) { |
||||
|
year += m - 1; |
||||
|
} else { |
||||
|
year += m - 1; |
||||
|
} |
||||
|
if (month > 12) { |
||||
|
month = month % 12 == 0 ? 12 : month % 12; |
||||
|
} |
||||
|
if (month <= 0) { |
||||
|
month = 12 + month % 12; |
||||
|
} |
||||
|
_monthData.year = year; |
||||
|
_monthData.month = month; |
||||
|
_monthData.dayList = this.createDayList(month, year); |
||||
|
this.calendar.push(_monthData); |
||||
|
} |
||||
|
//h5默认页面加载到当前日期start-date的位置 |
||||
|
if (document) { |
||||
|
this.scrollTop(this.startYear, this.startMonth); |
||||
|
} |
||||
|
}, |
||||
|
scrollTop(year, month) { |
||||
|
var id = year + "" + parseInt(month) |
||||
|
setTimeout(() => { |
||||
|
var obj = document.getElementById(id) |
||||
|
if(!obj) return |
||||
|
var wrap = document.getElementById("scrollWrap"); |
||||
|
wrap.scrollTop = obj.offsetTop - 40; |
||||
|
}, 0); |
||||
|
}, |
||||
|
//添加日历样式 |
||||
|
addClassName(day, month, year) { |
||||
|
if (!day) return; |
||||
|
const _date = new Date(year + "/" + month + "/" + day); |
||||
|
let className = []; |
||||
|
// if (_date.getDay() == 0 || _date.getDay() == 6) { //周末或周六样式 |
||||
|
// className.push('weekend') |
||||
|
// } |
||||
|
if (_date * 1 == this.today) { |
||||
|
className.push("today"); |
||||
|
} |
||||
|
if (this.mode == 1) { |
||||
|
if (_date * 1 == this.startDates) { |
||||
|
className.push("trip-time"); |
||||
|
} |
||||
|
} else { |
||||
|
if (_date * 1 == this.startDates || _date * 1 == this.endDates) { |
||||
|
className.push("trip-time"); |
||||
|
} |
||||
|
} |
||||
|
if (this.betweenStarts) { |
||||
|
_date * 1 < this.betweenStarts && className.push("disabled"); |
||||
|
} else { |
||||
|
_date * 1 < this.today && className.push("disabled"); //当天和结束日期之外不可选 |
||||
|
} |
||||
|
_date * 1 > this.betweenEnds && className.push("disabled"); |
||||
|
return className.join(" "); |
||||
|
}, |
||||
|
//入住离开的区间背景色 |
||||
|
addClassBg(day, month, year) { |
||||
|
if (!day) return; |
||||
|
const _date = this.resetTime(year + "/" + month + "/" + day); |
||||
|
let className = []; |
||||
|
if (_date >= this.startDates && _date <= this.endDates && this.mode > 1) { |
||||
|
className.push("between"); |
||||
|
} |
||||
|
return className.join(" "); |
||||
|
}, |
||||
|
//theme入住离开的区间背景色 |
||||
|
themeOpacityBg(day, month, year) { |
||||
|
if (!this.themeColor) return; |
||||
|
if (!day) return; |
||||
|
const _date = this.resetTime(year + "/" + month + "/" + day); |
||||
|
if (_date >= this.startDates && _date <= this.endDates && this.mode > 1) { |
||||
|
return this.getBetweenColor; |
||||
|
} |
||||
|
}, |
||||
|
//theme获取普通日期选中样式背景 |
||||
|
themeBg(day, month, year) { |
||||
|
if (!this.themeColor) return; |
||||
|
const _date = this.resetTime(year + "/" + month + "/" + day); |
||||
|
//正常模式 |
||||
|
if (this.mode == 1) { |
||||
|
if (_date == this.startDates) { |
||||
|
return this.themeColor; |
||||
|
} |
||||
|
} else { |
||||
|
//酒店和往返模式 |
||||
|
if (_date == this.startDates || _date == this.endDates) { |
||||
|
return this.themeColor; |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
//清除时间 时 分 秒 毫秒 |
||||
|
resetTime(dateStr) { |
||||
|
var date = new Date(dateStr.replace(/-/g, "/")); |
||||
|
date.setHours(0); |
||||
|
date.setMinutes(0); |
||||
|
date.setSeconds(0); |
||||
|
date.setMilliseconds(0); |
||||
|
return date * 1; |
||||
|
}, |
||||
|
//flag==1(返回今天,明天,后天),flag==2(返回入住,离开,去返) |
||||
|
setTip(day, month, year,flag) { |
||||
|
if (!day) return |
||||
|
var tip = "" |
||||
|
var _date = this.resetTime(year + "/" + month + "/" + day); |
||||
|
if(flag==1){ |
||||
|
if (_date == this.today) { |
||||
|
tip = "今天"; |
||||
|
} else if (_date - this.today == 24 * 3600 * 1000) { |
||||
|
tip = "明天"; |
||||
|
} else if (_date - this.today == 2 * 24 * 3600 * 1000) { |
||||
|
tip = "后天"; |
||||
|
} |
||||
|
return tip |
||||
|
}else{ |
||||
|
if (this.mode == 2) { |
||||
|
if (_date == this.endDates) { |
||||
|
tip = "结束"; |
||||
|
} else if (_date == this.startDates) { |
||||
|
tip = "开始"; |
||||
|
} |
||||
|
} else if (this.mode == 3) { |
||||
|
if (_date == this.startDates && !this.endDates) { |
||||
|
tip = "去/返"; |
||||
|
} else { |
||||
|
if (_date == this.endDates) { |
||||
|
tip = "返程"; |
||||
|
} else if (_date == this.startDates) { |
||||
|
tip = "去程"; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return tip; |
||||
|
} |
||||
|
}, |
||||
|
//是否是选中当天,或者入住离开当天 |
||||
|
isCurrent(day, month, year) { |
||||
|
if (!day) { |
||||
|
return false; |
||||
|
} |
||||
|
const _date = this.resetTime(year + "/" + month + "/" + day); |
||||
|
//正常模式 |
||||
|
if (this.mode == 1) { |
||||
|
if (_date == this.startDates) { |
||||
|
return true; |
||||
|
} |
||||
|
} else { |
||||
|
//酒店和往返模式 |
||||
|
if (_date == this.startDates || _date == this.endDates) { |
||||
|
return true; |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
dateFormat(times) { |
||||
|
let date = new Date(times); |
||||
|
let recent = ""; |
||||
|
if (times == this.today) { |
||||
|
recent = "今天"; |
||||
|
} else if (times - this.today === 24 * 3600 * 1000) { |
||||
|
recent = "明天"; |
||||
|
} else if (times - this.today === 2 * 24 * 3600 * 1000) { |
||||
|
recent = "后天"; |
||||
|
} |
||||
|
var year = date.getFullYear() |
||||
|
var month = parseInt(date.getMonth() + 1) > 9 ? parseInt(date.getMonth() + 1) : '0' + parseInt(date.getMonth() + 1) |
||||
|
var day = date.getDate() > 9 ? date.getDate() : '0' + date.getDate() |
||||
|
return { |
||||
|
dateStr: year + "-" + month + "-" + day, |
||||
|
week: "周" + this.weekList[date.getDay()], |
||||
|
recent |
||||
|
}; |
||||
|
}, |
||||
|
chooseDate(day, month, year) { |
||||
|
const _date = this.resetTime(year + "/" + month + "/" + day); |
||||
|
const week = this.weekList[new Date(_date).getDay()]; |
||||
|
//判断日期区域是否可点击 |
||||
|
if (!day) return; |
||||
|
if (this.betweenStarts) { |
||||
|
if (_date * 1 < this.betweenStarts) return; |
||||
|
} else { |
||||
|
if (_date < this.today) return; |
||||
|
} |
||||
|
if (_date > this.betweenEnds) return; |
||||
|
//判断酒店或者往返模式的选择逻辑 |
||||
|
if (this.startDates && this.endDates && _date > this.endDates) { |
||||
|
this.startDates = _date; |
||||
|
this.endDates = ""; |
||||
|
} else if (this.endDates && _date > this.endDates) { |
||||
|
this.endDates = _date; |
||||
|
} else if (_date >= this.startDates && _date <= this.endDates) { |
||||
|
this.startDates = _date; |
||||
|
this.endDates = ""; |
||||
|
} else if (_date < this.startDates) { |
||||
|
this.startDates = _date; |
||||
|
this.endDates = ""; |
||||
|
} else if (_date > this.startDates) { |
||||
|
if (this.mode == 1) { |
||||
|
this.startDates = _date; |
||||
|
} else { |
||||
|
this.endDates = _date; |
||||
|
} |
||||
|
} |
||||
|
const choose = { |
||||
|
startStr: this.dateFormat(this.startDates) |
||||
|
}; |
||||
|
if (this.mode == 1) { |
||||
|
this.$emit("callback", choose); |
||||
|
} else if (this.mode == 2 && this.startDates && this.endDates) { |
||||
|
choose.dayCount = (this.endDates - this.startDates) / 24 / 3600 / 1000; |
||||
|
choose.endStr = this.dateFormat(this.endDates); |
||||
|
this.$emit("callback", choose); |
||||
|
} else if (this.mode == 3) { |
||||
|
if (this.startDates && this.endDates) { |
||||
|
choose.dayCount = (this.endDates - this.startDates) / 24 / 3600 / 1000; |
||||
|
choose.endStr = this.dateFormat(this.endDates); |
||||
|
} else if (this.startDates && !this.endDates) { |
||||
|
choose.dayCount = 0; |
||||
|
choose.endStr = this.dateFormat(this.startDates); |
||||
|
} |
||||
|
this.$emit("callback", choose); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style lang="less" scoped> |
||||
|
@color: #1C75FF; |
||||
|
.calendar-tz { |
||||
|
width: 100%; |
||||
|
height: 100vh; |
||||
|
background: #fff; |
||||
|
display: -webkit-box; |
||||
|
display: flex; |
||||
|
-webkit-flex-direction: column; |
||||
|
flex-direction: column; |
||||
|
&.fixed{ |
||||
|
position: fixed; |
||||
|
width:100%; |
||||
|
height:100%; |
||||
|
left:0; |
||||
|
top:0; |
||||
|
z-index: 900; |
||||
|
} |
||||
|
.week-number { |
||||
|
background: #fff; |
||||
|
padding: 0 1%; |
||||
|
box-shadow: 0 2px 15px rgba(100, 100, 100, 0.1); |
||||
|
span { |
||||
|
display: inline-block; |
||||
|
text-align: center; |
||||
|
padding: 12px 0; |
||||
|
font-size: 14px; |
||||
|
width: 14.28%; |
||||
|
&:first-child, |
||||
|
&:last-child { |
||||
|
color: @color; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
.tips { |
||||
|
padding: 6px 10px; |
||||
|
background: #fff7dc; |
||||
|
font-size: 12px; |
||||
|
color: #9e8052; |
||||
|
overflow: hidden; |
||||
|
text-overflow: ellipsis; |
||||
|
white-space: nowrap; |
||||
|
} |
||||
|
.content{ |
||||
|
-webkit-box-flex: 1; |
||||
|
flex:1; |
||||
|
overflow-y: scroll; |
||||
|
-webkit-overflow-scrolling: touch; |
||||
|
.con { |
||||
|
color: #333; |
||||
|
padding-top: 10px; |
||||
|
position: relative; |
||||
|
h3 { |
||||
|
width: 100%; |
||||
|
font-weight: normal; |
||||
|
text-align: center; |
||||
|
font-size: 16px; |
||||
|
padding: 10px 0; |
||||
|
} |
||||
|
.month-bg{ |
||||
|
position: absolute; |
||||
|
text-align: center; |
||||
|
opacity: 0.4; |
||||
|
left:0; |
||||
|
right:0; |
||||
|
bottom:0; |
||||
|
top:20%; |
||||
|
font-size:220px; |
||||
|
font-weight: bold; |
||||
|
color:#f8f8f8; |
||||
|
} |
||||
|
.each-month { |
||||
|
display: block; |
||||
|
width: 98%; |
||||
|
font-size: 0; |
||||
|
margin: 0 auto; |
||||
|
padding-left: 0; |
||||
|
padding-bottom: 10px; |
||||
|
border-bottom: 1px solid #eee; |
||||
|
.each-day { |
||||
|
position: relative; |
||||
|
display: inline-block; |
||||
|
text-align: center; |
||||
|
vertical-align: middle; |
||||
|
width: 14.28%; |
||||
|
font-size: 16px; |
||||
|
height: 50px; |
||||
|
margin:2px auto; |
||||
|
div { |
||||
|
display: inline-block; |
||||
|
font-size: 14px; |
||||
|
width:98%; |
||||
|
height:100%; |
||||
|
justify-content: space-around; |
||||
|
display: -webkit-box; |
||||
|
display: flex; |
||||
|
-webkit-flex-direction: column; |
||||
|
flex-direction: column; |
||||
|
border-radius: 4px; |
||||
|
} |
||||
|
&.between { |
||||
|
background: rgba(75, 217, 173, 0.1); |
||||
|
} |
||||
|
.day{ |
||||
|
font-size: 16px; |
||||
|
} |
||||
|
.day-tip,.recent{ |
||||
|
font-size:10px; |
||||
|
height:14px; |
||||
|
i{ |
||||
|
font-size:10px; |
||||
|
} |
||||
|
} |
||||
|
.recent { |
||||
|
color: #ccc; |
||||
|
} |
||||
|
.disabled { |
||||
|
color: #ccc !important; |
||||
|
.day-tip{ |
||||
|
color: #ccc !important; |
||||
|
} |
||||
|
} |
||||
|
.today { |
||||
|
background: rgba(100,100,100,0.1); |
||||
|
} |
||||
|
.trip-time { |
||||
|
background: @color; |
||||
|
color: #fff !important; |
||||
|
.recent,.day-tip{ |
||||
|
color: #fff!important; |
||||
|
} |
||||
|
} |
||||
|
.weekend { |
||||
|
color: @color; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
/***右侧进入动画***/ |
||||
|
.slide-enter-active, |
||||
|
.slide-leave-active { |
||||
|
-webkit-transition: all 0.2s ease; |
||||
|
transition: all 0.2s ease; |
||||
|
} |
||||
|
.slide-enter, |
||||
|
.slide-leave-to { |
||||
|
-webkit-transform: translateX(100%); |
||||
|
transform: translateX(100%); |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,87 @@ |
|||||
|
同程艺龙-多种模式日历插件,支持标准选择模式、酒店入住离开模式、飞机往返模式,可自定义主题色 |
||||
|
* Calendar.vue 可以传参设置主题色,如theme-color="#ff6600 或 #f60"(依赖less),如用sass可在源代码style标签内修改 |
||||
|
|
||||
|
 |
||||
|
 |
||||
|
 |
||||
|
|
||||
|
|
||||
|
|
||||
|
```diff |
||||
|
+ 为了及时响应大家的各种功能需求,可谓不遗余力 |
||||
|
+ 所以希望能在上面github链接里点个star,也算是鼓励一下了! |
||||
|
+ 同时有什么新的需求和建议可以继续联系我,我及时更新... |
||||
|
``` |
||||
|
|
||||
|
github链接 |
||||
|
[链接名称](https://github.com/tanagang/mobile-calendar-simple) |
||||
|
|
||||
|
|
||||
|
### 使用方法 |
||||
|
若在vue-cli项目中安装:npm install mobile-calendar-simple -S (若使用uniapp的工具HBuilderX导入,可以忽略此步骤) |
||||
|
```javascript |
||||
|
<template> |
||||
|
<div> |
||||
|
<!--用法一:start-date省略即默认当天 --> |
||||
|
<calendar :is-show="true" :start-date='startDate' @callback="getDate" /> |
||||
|
<!--用法二:当mode=2、3的模式下分别为(酒店\往返)的离开日期--> |
||||
|
<calendar :is-show="true" :start-date="startDate" :end-date="endDate" mode="2" @callback="getDate" /> |
||||
|
<!--用法三:可以操作的日期范围--> |
||||
|
<calendar :is-show="true" :between-start="startDate" :between-end="endDate" @callback="getDate" /> |
||||
|
<!--设置动画transition="'slide'"且目前仅支持slide --> |
||||
|
<calendar :is-show="true" :transition="'slide'" @callback="getDate" /> |
||||
|
<!--设置主题色--> |
||||
|
<calendar :is-show="true" :theme-color="'#FF6600'" @callback="getDate" /> |
||||
|
<!--如果需要solt--> |
||||
|
<calendar :is-show="true"> |
||||
|
...此处也支持slot注入(不需要可以忽略) |
||||
|
<template v-slot:header> |
||||
|
<div>我是头部</div> |
||||
|
</template> |
||||
|
<template v-slot:footer> |
||||
|
<div>我是脚部</div> |
||||
|
</template> |
||||
|
</calendar> |
||||
|
</div> |
||||
|
</template> |
||||
|
<script> |
||||
|
import Calendar from 'mobile-calendar-simple' |
||||
|
export default { |
||||
|
data(){ |
||||
|
return {//日期均为yyyy-mm-dd或者yyyy/mm/dd格式 |
||||
|
startDate:'', |
||||
|
endDate:'', |
||||
|
betweenStart:'', |
||||
|
betweenEnd:'', |
||||
|
} |
||||
|
}, |
||||
|
methods:{ |
||||
|
//获取回调的日期数据 |
||||
|
getDate(date){ |
||||
|
console.log(date) |
||||
|
} |
||||
|
}, |
||||
|
components:{ |
||||
|
Calendar |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
``` |
||||
|
### 参数如下 |
||||
|
* is-show 控制控件的显示隐藏,模式false |
||||
|
* start-date 默认当天,当mode=2、3的模式下分别为(酒店\往返)的出发日期 |
||||
|
* end-date 当mode=2、3的模式下分别为(酒店\往返)的离开日期 |
||||
|
* between-start 和 between-end 可以操作的日期范围 |
||||
|
* theme-color 日历的主题色,例 '#FF6600'或者简写'#f60'(默认#1C75FF) |
||||
|
* mode 模式选择(默认1标准模式),2酒店模式,3往返模式 |
||||
|
* transition 支持动画,属性为slide |
||||
|
* init-month 初始月份数(默认6个月)最小1个月 |
||||
|
* title 日历顶部的一段文本 |
||||
|
* is-fixed 日历是否定位全屏显示,默认true |
||||
|
|
||||
|
|
||||
|
### 回调函数 |
||||
|
* @callback:日期选择后获取到的数据(所有你想要的都有) |
||||
|
*** |
||||
|
|
||||
|
|
@ -0,0 +1,60 @@ |
|||||
|
{ |
||||
|
"_from": "mobile-calendar-simple", |
||||
|
"_id": "mobile-calendar-simple@2.4.0", |
||||
|
"_inBundle": false, |
||||
|
"_integrity": "sha512-67Dg/pxQ7EK2uxGrjv4tLOBx+upIErxdtTC27o+luGFmhBtZ3+k1C2DGIzzJYhAF/YsMG9zkSl9XZY0TEt/HOg==", |
||||
|
"_location": "/mobile-calendar-simple", |
||||
|
"_phantomChildren": {}, |
||||
|
"_requested": { |
||||
|
"type": "tag", |
||||
|
"registry": true, |
||||
|
"raw": "mobile-calendar-simple", |
||||
|
"name": "mobile-calendar-simple", |
||||
|
"escapedName": "mobile-calendar-simple", |
||||
|
"rawSpec": "", |
||||
|
"saveSpec": null, |
||||
|
"fetchSpec": "latest" |
||||
|
}, |
||||
|
"_requiredBy": [ |
||||
|
"#USER", |
||||
|
"/" |
||||
|
], |
||||
|
"_resolved": "https://registry.npmmirror.com/mobile-calendar-simple/-/mobile-calendar-simple-2.4.0.tgz", |
||||
|
"_shasum": "1fa196cfd8f10d95042f78599ddfd1d14100c847", |
||||
|
"_spec": "mobile-calendar-simple", |
||||
|
"_where": "D:\\work\\tourist", |
||||
|
"author": { |
||||
|
"name": "tanzheng" |
||||
|
}, |
||||
|
"bugs": { |
||||
|
"url": "https://github.com/tanagang/vue-calendar/issues" |
||||
|
}, |
||||
|
"bundleDependencies": false, |
||||
|
"deprecated": false, |
||||
|
"description": "同程艺龙-多种模式日历插件,支持标准选择模式、酒店入住离开模式、飞机往返模式,可自定义主题色", |
||||
|
"homepage": "https://github.com/tanagang/vue-calendar#readme", |
||||
|
"keywords": [ |
||||
|
"mobile", |
||||
|
"calendar", |
||||
|
"datepicker", |
||||
|
"vue日期范围选择", |
||||
|
"日历", |
||||
|
"日历范围", |
||||
|
"价格日历", |
||||
|
"日历价格", |
||||
|
"酒店日历", |
||||
|
"日历酒店", |
||||
|
"往返" |
||||
|
], |
||||
|
"license": "ISC", |
||||
|
"main": "Calendar.vue", |
||||
|
"name": "mobile-calendar-simple", |
||||
|
"repository": { |
||||
|
"type": "git", |
||||
|
"url": "git+https://github.com/tanagang/mobile-calendar-simple.git" |
||||
|
}, |
||||
|
"scripts": { |
||||
|
"test": "echo \"Error: no test specified\" && exit 1" |
||||
|
}, |
||||
|
"version": "2.4.0" |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
MIT License |
||||
|
|
||||
|
Copyright (c) 2023 Yanxi |
||||
|
|
||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
|
of this software and associated documentation files (the "Software"), to deal |
||||
|
in the Software without restriction, including without limitation the rights |
||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||
|
copies of the Software, and to permit persons to whom the Software is |
||||
|
furnished to do so, subject to the following conditions: |
||||
|
|
||||
|
The above copyright notice and this permission notice shall be included in all |
||||
|
copies or substantial portions of the Software. |
||||
|
|
||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
||||
|
SOFTWARE. |
@ -0,0 +1,36 @@ |
|||||
|
微信官方 js-sdk |
||||
|
---- |
||||
|
|
||||
|
说明: 仅将官方 js-sdk 发布到 npm,支持 CommonJS,便于 browserify, webpack 等直接使用,支持 TypeScript。 |
||||
|
|
||||
|
|
||||
|
官方 JS 源码: https://res.wx.qq.com/open/js/jweixin-1.6.0.js |
||||
|
|
||||
|
官方使用说明: https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html |
||||
|
|
||||
|
安装: |
||||
|
```shell |
||||
|
npm install weixin-js-sdk |
||||
|
``` |
||||
|
|
||||
|
使用: |
||||
|
```javascript |
||||
|
// commonjs |
||||
|
var wx = require('weixin-js-sdk'); |
||||
|
|
||||
|
// es module |
||||
|
import wx from 'weixin-js-sdk' |
||||
|
``` |
||||
|
|
||||
|
### Old versions |
||||
|
|
||||
|
* [1.0.0](https://github.com/yanxi123-com/weixin-js-sdk/tree/1.0.0) |
||||
|
* [1.2.0](https://github.com/yanxi123-com/weixin-js-sdk/tree/1.2.0) |
||||
|
|
||||
|
### 个人主页 |
||||
|
|
||||
|
* [https://yanxi123.com/](https://yanxi123.com/) |
||||
|
|
||||
|
### 感谢 |
||||
|
|
||||
|
TypeScript 定义文件来自 [wx-jssdk-ts](https://github.com/zhaoky/wx-jssdk-ts/blob/master/index.d.ts) |
@ -0,0 +1,601 @@ |
|||||
|
// Type definitions for weixin jssdk 1.6.0
|
||||
|
// Project: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115
|
||||
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
|
||||
|
declare namespace wx { |
||||
|
type ImageSizeType = "original" | "compressed"; |
||||
|
type ImageSourceType = "album" | "camera"; |
||||
|
type VideoSourceType = "album" | "camera"; |
||||
|
type ApiMethod = |
||||
|
| "onMenuShareTimeline" |
||||
|
| "onMenuShareAppMessage" |
||||
|
| "onMenuShareQQ" |
||||
|
| "onMenuShareWeibo" |
||||
|
| "onMenuShareQZone" |
||||
|
| "updateAppMessageShareData" |
||||
|
| "updateTimelineShareData" |
||||
|
| "startRecord" |
||||
|
| "stopRecord" |
||||
|
| "onVoiceRecordEnd" |
||||
|
| "playVoice" |
||||
|
| "pauseVoice" |
||||
|
| "stopVoice" |
||||
|
| "onVoicePlayEnd" |
||||
|
| "uploadVoice" |
||||
|
| "downloadVoice" |
||||
|
| "chooseImage" |
||||
|
| "previewImage" |
||||
|
| "uploadImage" |
||||
|
| "downloadImage" |
||||
|
| "translateVoice" |
||||
|
| "getNetworkType" |
||||
|
| "openLocation" |
||||
|
| "getLocation" |
||||
|
| "hideOptionMenu" |
||||
|
| "showOptionMenu" |
||||
|
| "hideMenuItems" |
||||
|
| "showMenuItems" |
||||
|
| "hideAllNonBaseMenuItem" |
||||
|
| "showAllNonBaseMenuItem" |
||||
|
| "closeWindow" |
||||
|
| "scanQRCode" |
||||
|
| "chooseWXPay" |
||||
|
| "openProductSpecificView" |
||||
|
| "addCard" |
||||
|
| "chooseCard" |
||||
|
| "openCard"; |
||||
|
// 所有JS接口列表
|
||||
|
type jsApiList = ApiMethod[]; |
||||
|
|
||||
|
// 开放标签列表
|
||||
|
// https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_Open_Tag.html
|
||||
|
type openTag = "wx-open-launch-weapp" | "wx-open-launch-app" | "wx-open-subscribe" | "wx-open-audio" |
||||
|
type openTagList = openTag[]; |
||||
|
|
||||
|
// 所有菜单项列表
|
||||
|
// 基本类
|
||||
|
type menuBase = |
||||
|
| "menuItem:exposeArticle" // 举报
|
||||
|
| "menuItem:setFont" // 调整字体
|
||||
|
| "menuItem:dayMode" // 日间模式
|
||||
|
| "menuItem:nightMode" // 夜间模式
|
||||
|
| "menuItem:refresh" // 刷新
|
||||
|
| "menuItem:profile" // 查看公众号(已添加)
|
||||
|
| "menuItem:addContact"; // 查看公众号(未添加)
|
||||
|
// 传播类
|
||||
|
type menuShare = |
||||
|
| "menuItem:share:appMessage" // 发送给朋友
|
||||
|
| "menuItem:share:timeline" // 分享到朋友圈
|
||||
|
| "menuItem:share:qq" // 分享到QQ
|
||||
|
| "menuItem:share:weiboApp" // 分享到Weibo
|
||||
|
| "menuItem:favorite" // 收藏
|
||||
|
| "menuItem:share:facebook" // 分享到FB
|
||||
|
| "menuItem:share:QZone"; // 分享到 QQ 空间
|
||||
|
|
||||
|
// 保护类
|
||||
|
type menuProtected = |
||||
|
| "menuItem:editTag" // 编辑标签
|
||||
|
| "menuItem:delete" // 删除
|
||||
|
| "menuItem:copyUrl" // 复制链接
|
||||
|
| "menuItem:originPage" // 原网页
|
||||
|
| "menuItem:readMode" // 阅读模式
|
||||
|
| "menuItem:openWithQQBrowser" // 在QQ浏览器中打开
|
||||
|
| "menuItem:openWithSafari" // 在Safari中打开
|
||||
|
| "menuItem:share:email" // 邮件
|
||||
|
| "menuItem:share:brand"; // 一些特殊公众号
|
||||
|
|
||||
|
type menuList = Array<menuBase | menuProtected | menuShare>; |
||||
|
|
||||
|
function config(conf: { |
||||
|
debug?: boolean; // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
||||
|
appId: string; // 必填,公众号的唯一标识
|
||||
|
timestamp: number; // 必填,生成签名的时间戳
|
||||
|
nonceStr: string; // 必填,生成签名的随机串
|
||||
|
signature: string; // 必填,签名,见附录1
|
||||
|
jsApiList?: jsApiList; // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
|
||||
|
openTagList?: openTagList; |
||||
|
}): void; |
||||
|
|
||||
|
interface Resouce { |
||||
|
localId: string; |
||||
|
} |
||||
|
interface BaseParams { |
||||
|
success?(...args: any[]): void; |
||||
|
/** 接口调用失败的回调函数 */ |
||||
|
fail?(...args: any[]): void; |
||||
|
/** 接口取消调用的回调函数 */ |
||||
|
cancel?(...args: any[]): void; |
||||
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */ |
||||
|
complete?(...args: any[]): void; |
||||
|
} |
||||
|
function ready(fn: () => void): void; |
||||
|
function error(fn: (err: { errMsg: string }) => void): void; |
||||
|
|
||||
|
interface IcheckJsApi extends BaseParams { |
||||
|
jsApiList: jsApiList; // 需要检测的JS接口列表,所有JS接口列表见附录2,
|
||||
|
// 以键值对的形式返回,可用的api值true,不可用为false
|
||||
|
// 如:{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"}
|
||||
|
success(res: { |
||||
|
checkResult: { [api: string]: boolean }; |
||||
|
errMsg: string; |
||||
|
}): void; |
||||
|
} |
||||
|
/** |
||||
|
* 判断当前客户端版本是否支持指定JS接口 |
||||
|
* 备注:checkJsApi接口是客户端6.0.2新引入的一个预留接口,第一期开放的接口均可不使用checkJsApi来检测。 |
||||
|
*/ |
||||
|
function checkJsApi(params: IcheckJsApi): void; |
||||
|
|
||||
|
interface IonMenuShareTimeline extends BaseParams { |
||||
|
title: string; // 分享标题
|
||||
|
link: string; // 分享链接
|
||||
|
imgUrl: string; // 分享图标
|
||||
|
// 用户确认分享后执行的回调函数
|
||||
|
success(): void; |
||||
|
// 用户取消分享后执行的回调函数
|
||||
|
cancel(): void; |
||||
|
} |
||||
|
/*=============================基础接口================================*/ |
||||
|
/** |
||||
|
* 获取“分享到朋友圈”按钮点击状态及自定义分享内容接口 |
||||
|
*/ |
||||
|
function onMenuShareTimeline(params: IonMenuShareTimeline): void; |
||||
|
|
||||
|
interface IonMenuShareAppMessage extends BaseParams { |
||||
|
title: string; // 分享标题
|
||||
|
desc: string; // 分享描述
|
||||
|
link: string; // 分享链接
|
||||
|
imgUrl: string; // 分享图标
|
||||
|
type?: "music" | "video或link" | "link"; // 分享类型,music、video或link,不填默认为link
|
||||
|
dataUrl?: string; // 如果type是music或video,则要提供数据链接,默认为空
|
||||
|
// 用户确认分享后执行的回调函数
|
||||
|
success(): void; |
||||
|
// 用户取消分享后执行的回调函数
|
||||
|
cancel(): void; |
||||
|
} |
||||
|
/** |
||||
|
* 获取“分享给朋友”按钮点击状态及自定义分享内容接口 |
||||
|
*/ |
||||
|
function onMenuShareAppMessage(params: IonMenuShareAppMessage): void; |
||||
|
|
||||
|
interface IonMenuShareQQ extends BaseParams { |
||||
|
title: string; // 分享标题
|
||||
|
desc: string; // 分享描述
|
||||
|
link: string; // 分享链接
|
||||
|
imgUrl: string; // 分享图标
|
||||
|
// 用户确认分享后执行的回调函数
|
||||
|
success(): void; |
||||
|
// 用户取消分享后执行的回调函数
|
||||
|
cancel(): void; |
||||
|
} |
||||
|
/** |
||||
|
* 获取“分享到QQ”按钮点击状态及自定义分享内容接口 |
||||
|
*/ |
||||
|
function onMenuShareQQ(params: IonMenuShareQQ): void; |
||||
|
|
||||
|
interface IonMenuShareWeibo extends BaseParams { |
||||
|
title: string; // 分享标题
|
||||
|
desc: string; // 分享描述
|
||||
|
link: string; // 分享链接
|
||||
|
imgUrl: string; // 分享图标
|
||||
|
// 用户确认分享后执行的回调函数
|
||||
|
success(): void; |
||||
|
// 用户取消分享后执行的回调函数
|
||||
|
cancel(): void; |
||||
|
} |
||||
|
/** |
||||
|
* 获取“分享到腾讯微博”按钮点击状态及自定义分享内容接口 |
||||
|
*/ |
||||
|
function onMenuShareWeibo(params: IonMenuShareWeibo): void; |
||||
|
|
||||
|
interface IonMenuShareQZone extends BaseParams { |
||||
|
title: string; // 分享标题
|
||||
|
desc: string; // 分享描述
|
||||
|
link: string; // 分享链接
|
||||
|
imgUrl: string; // 分享图标
|
||||
|
// 用户确认分享后执行的回调函数
|
||||
|
success(): void; |
||||
|
// 用户取消分享后执行的回调函数
|
||||
|
cancel(): void; |
||||
|
} |
||||
|
/** |
||||
|
* 获取“分享到QQ空间”按钮点击状态及自定义分享内容接口 |
||||
|
*/ |
||||
|
function onMenuShareQZone(params: IonMenuShareQZone): void; |
||||
|
|
||||
|
interface IupdateAppMessageShareData extends BaseParams { |
||||
|
title: string; // 分享标题
|
||||
|
desc: string; // 分享描述
|
||||
|
link: string; // 分享链接
|
||||
|
imgUrl: string; // 分享图标
|
||||
|
// 用户确认分享后执行的回调函数
|
||||
|
success(): void; |
||||
|
} |
||||
|
/** |
||||
|
* 获取“分享给朋友”及“分享到QQ”按钮点击状态及自定义分享内容接口(新) |
||||
|
*/ |
||||
|
function updateAppMessageShareData(params: IupdateAppMessageShareData): void; |
||||
|
|
||||
|
interface IupdateTimelineShareData extends BaseParams { |
||||
|
title: string; // 分享标题
|
||||
|
link: string; // 分享链接
|
||||
|
imgUrl: string; // 分享图标
|
||||
|
// 用户确认分享后执行的回调函数
|
||||
|
success(): void; |
||||
|
} |
||||
|
/** |
||||
|
* 获取“分享到朋友圈”及“分享到QQ空间”按钮点击状态及自定义分享内容接口 |
||||
|
*/ |
||||
|
function updateTimelineShareData(params: IupdateTimelineShareData): void; |
||||
|
/*=============================基础接口================================*/ |
||||
|
|
||||
|
/*=============================图像接口================================*/ |
||||
|
interface IchooseImage extends BaseParams { |
||||
|
/** 最多可以选择的图片张数,默认9 */ |
||||
|
count?: number; |
||||
|
/** original 原图,compressed 压缩图,默认二者都有 */ |
||||
|
sizeType?: ImageSizeType[]; |
||||
|
/** album 从相册选图,camera 使用相机,默认二者都有 */ |
||||
|
sourceType?: ImageSourceType[]; |
||||
|
/** 成功则返回图片的本地文件路径列表 tempFilePaths */ |
||||
|
success(res: { |
||||
|
sourceType: string; // weixin album camera
|
||||
|
localIds: string[]; |
||||
|
errMsg: string; |
||||
|
}): void; |
||||
|
cancel(): void; |
||||
|
} |
||||
|
/** |
||||
|
* 从本地相册选择图片或使用相机拍照。 |
||||
|
*/ |
||||
|
function chooseImage(params: IchooseImage): void; |
||||
|
|
||||
|
interface IpreviewImage extends BaseParams { |
||||
|
current: string; // 当前显示图片的http链接
|
||||
|
urls: string[]; // 需要预览的图片http链接列表
|
||||
|
} |
||||
|
/** |
||||
|
* 预览图片接口 |
||||
|
*/ |
||||
|
function previewImage(params: IpreviewImage): void; |
||||
|
|
||||
|
interface IuploadResource extends BaseParams { |
||||
|
localId: string; // 需要上传的图片的本地ID,由chooseImage接口获得
|
||||
|
isShowProgressTips: number; // 默认为1,显示进度提示
|
||||
|
// 返回图片的服务器端ID
|
||||
|
success(res: { serverId: string }): void; |
||||
|
} |
||||
|
/** |
||||
|
* 上传图片接口 |
||||
|
*/ |
||||
|
function uploadImage(params: IuploadResource): void; |
||||
|
|
||||
|
interface IdownloadResource extends BaseParams { |
||||
|
serverId: string; // 需要下载的图片的服务器端ID,由uploadImage接口获得
|
||||
|
isShowProgressTips: number; // 默认为1,显示进度提示
|
||||
|
// 返回图片下载后的本地ID
|
||||
|
success(res: Resouce): void; |
||||
|
} |
||||
|
/** |
||||
|
* 下载图片接口 |
||||
|
*/ |
||||
|
function downloadImage(params: IdownloadResource): void; |
||||
|
|
||||
|
interface IgetLocalImgData extends BaseParams { |
||||
|
localId: string; // 图片的localID
|
||||
|
// localData是图片的base64数据,可以用img标签显示
|
||||
|
success(res: { localData: string }): void; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取本地图片接口 |
||||
|
*/ |
||||
|
function getLocalImgData(params: IgetLocalImgData): void; |
||||
|
/*=============================图像接口================================*/ |
||||
|
/*=============================音频接口================================*/ |
||||
|
/** |
||||
|
* 开始录音接口 |
||||
|
*/ |
||||
|
function startRecord(): void; |
||||
|
|
||||
|
interface IstopRecord extends BaseParams { |
||||
|
success(res: Resouce): void; |
||||
|
} |
||||
|
/** |
||||
|
* 停止录音接口 |
||||
|
*/ |
||||
|
function stopRecord(params: IstopRecord): void; |
||||
|
|
||||
|
interface IonVoiceRecordEnd extends BaseParams { |
||||
|
// 录音时间超过一分钟没有停止的时候会执行 complete 回调
|
||||
|
complete(res: Resouce): void; |
||||
|
} |
||||
|
/** |
||||
|
* 监听录音自动停止接口 |
||||
|
*/ |
||||
|
function onVoiceRecordEnd(params: IonVoiceRecordEnd): void; |
||||
|
|
||||
|
interface IplaypausestopVoice extends BaseParams { |
||||
|
localId: string; // 需要播放的音频的本地ID,由stopRecord接口获得
|
||||
|
} |
||||
|
/** |
||||
|
* 播放语音接口 |
||||
|
*/ |
||||
|
function playVoice(params: IplaypausestopVoice): void; |
||||
|
|
||||
|
/** |
||||
|
* 暂停播放接口 |
||||
|
*/ |
||||
|
function pauseVoice(params: IplaypausestopVoice): void; |
||||
|
/** |
||||
|
* 停止播放接口 |
||||
|
*/ |
||||
|
function stopVoice(params: IplaypausestopVoice): void; |
||||
|
|
||||
|
interface IonVoicePlayEnd extends BaseParams { |
||||
|
success(res: Resouce): void; |
||||
|
} |
||||
|
/** |
||||
|
* 监听语音播放完毕接口 |
||||
|
*/ |
||||
|
function onVoicePlayEnd(params: IonVoicePlayEnd): void; |
||||
|
/** |
||||
|
* 上传语音接口 |
||||
|
* 备注:上传语音有效期3天,可用微信多媒体接口下载语音到自己的服务器 |
||||
|
* ,此处获得的 serverId 即 media_id,参考文档 |
||||
|
* ../12 / 58bfcfabbd501c7cd77c19bd9cfa8354.html |
||||
|
* 目前多媒体文件下载接口的频率限制为10000次/ 天, |
||||
|
* 如需要调高频率,请邮件weixin - open@qq.com, |
||||
|
* 邮件主题为【申请多媒体接口调用量】,请对你的项目进行简单描述, |
||||
|
* 附上产品体验链接,并对用户量和使用量进行说明。 |
||||
|
*/ |
||||
|
function uploadVoice(params: IuploadResource): void; |
||||
|
/** |
||||
|
* 下载语音接口 |
||||
|
*/ |
||||
|
function downloadVoice(params: IdownloadResource): void; |
||||
|
/*=============================音频接口================================*/ |
||||
|
/*=============================智能接口================================*/ |
||||
|
|
||||
|
interface ItranslateVoice extends BaseParams { |
||||
|
localId: string; // 需要识别的音频的本地Id,由录音相关接口获得
|
||||
|
isShowProgressTips: number; // 默认为1,显示进度提示
|
||||
|
success(res: { translateResult: string }): void; |
||||
|
} |
||||
|
/** |
||||
|
* 识别音频并返回识别结果接口 |
||||
|
*/ |
||||
|
function translateVoice(params: ItranslateVoice): void; |
||||
|
|
||||
|
/*=============================智能接口================================*/ |
||||
|
|
||||
|
/*=============================设备信息================================*/ |
||||
|
type networkType = "2g" | "3g" | "4g" | "wifi"; |
||||
|
interface IgetNetworkType extends BaseParams { |
||||
|
success(res: { networkType: networkType }): void; |
||||
|
} |
||||
|
/** |
||||
|
* 获取网络状态接口 |
||||
|
*/ |
||||
|
function getNetworkType(params: IgetNetworkType): void; |
||||
|
/*=============================设备信息================================*/ |
||||
|
|
||||
|
/*=============================地理位置================================*/ |
||||
|
interface IopenLocation extends BaseParams { |
||||
|
latitude: number; // 纬度,浮点数,范围为90 ~ -90
|
||||
|
longitude: number; // 经度,浮点数,范围为180 ~ -180。
|
||||
|
name: string; // 位置名
|
||||
|
address: string; // 地址详情说明
|
||||
|
scale: number; // 地图缩放级别,整形值,范围从1~28。默认为最大
|
||||
|
infoUrl: string; // 在查看位置界面底部显示的超链接,可点击跳转
|
||||
|
} |
||||
|
/** |
||||
|
* 使用微信内置地图查看位置接口 |
||||
|
*/ |
||||
|
function openLocation(params: IopenLocation): void; |
||||
|
|
||||
|
interface IgetLocation extends BaseParams { |
||||
|
type: "wgs84" | "gcj02"; // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
|
||||
|
success(res: { |
||||
|
latitude: number; // 纬度,浮点数,范围为90 ~ -90
|
||||
|
longitude: number; // 经度,浮点数,范围为180 ~ -180。
|
||||
|
speed: number; // 速度,以米/每秒计
|
||||
|
accuracy: number; // 位置精度
|
||||
|
}): void; |
||||
|
} |
||||
|
/** |
||||
|
* 获取地理位置接口 |
||||
|
*/ |
||||
|
function getLocation(params: IgetLocation): void; |
||||
|
/*=============================地理位置================================*/ |
||||
|
/*=============================摇一摇周边================================*/ |
||||
|
interface IstartSearchBeacons extends BaseParams { |
||||
|
ticket: string; // 摇周边的业务ticket, 系统自动添加在摇出来的页面链接后面
|
||||
|
// 开启查找完成后的回调函数
|
||||
|
complete(argv: any): void; |
||||
|
} |
||||
|
/** |
||||
|
* 开启查找周边ibeacon设备接口 |
||||
|
* 备注:如需接入摇一摇周边功能,请参考:申请开通摇一摇周边 |
||||
|
*/ |
||||
|
function startSearchBeacons(params: IstartSearchBeacons): void; |
||||
|
|
||||
|
interface IstopSearchBeacons extends BaseParams { |
||||
|
// 关闭查找完成后的回调函数
|
||||
|
complete(res: any): void; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 关闭查找周边ibeacon设备接口 |
||||
|
*/ |
||||
|
function stopSearchBeacons(params: IstopSearchBeacons): void; |
||||
|
|
||||
|
interface IonSearchBeacons extends BaseParams { |
||||
|
// 回调函数,可以数组形式取得该商家注册的在周边的相关设备列表
|
||||
|
complete(argv: any): void; |
||||
|
} |
||||
|
/** |
||||
|
* 监听周边ibeacon设备接口 |
||||
|
*/ |
||||
|
function onSearchBeacons(params: IonSearchBeacons): void; |
||||
|
/*=============================摇一摇周边================================*/ |
||||
|
/*=============================界面操作================================*/ |
||||
|
|
||||
|
/** |
||||
|
* 隐藏右上角菜单接口 |
||||
|
*/ |
||||
|
function hideOptionMenu(): void; |
||||
|
|
||||
|
/** |
||||
|
* 显示右上角菜单接口 |
||||
|
*/ |
||||
|
function showOptionMenu(): void; |
||||
|
|
||||
|
/** |
||||
|
* 关闭当前网页窗口接口 |
||||
|
*/ |
||||
|
function closeWindow(): void; |
||||
|
|
||||
|
interface IhideMenuItems extends BaseParams { |
||||
|
menuList: Array<menuProtected | menuShare>; // 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮,所有menu项见附录3
|
||||
|
} |
||||
|
/** |
||||
|
* 批量隐藏功能按钮接口 |
||||
|
*/ |
||||
|
function hideMenuItems(params: IhideMenuItems): void; |
||||
|
|
||||
|
interface IshowMenuItems extends BaseParams { |
||||
|
menuList: menuList; // 要显示的菜单项,所有menu项见附录3
|
||||
|
} |
||||
|
/** |
||||
|
* 批量显示功能按钮接口 |
||||
|
*/ |
||||
|
function showMenuItems(params: IshowMenuItems): void; |
||||
|
|
||||
|
/** |
||||
|
* 隐藏所有非基础按钮接口 |
||||
|
* “基本类”按钮详见附录3 |
||||
|
*/ |
||||
|
function hideAllNonBaseMenuItem(): void; |
||||
|
|
||||
|
/** |
||||
|
* 显示所有功能按钮接口 |
||||
|
*/ |
||||
|
function showAllNonBaseMenuItem(): void; |
||||
|
/*=============================界面操作================================*/ |
||||
|
/*=============================微信扫一扫================================*/ |
||||
|
|
||||
|
type scanType = "qrCode" | "barCode"; |
||||
|
|
||||
|
interface IscanQRCode extends BaseParams { |
||||
|
needResult: 0 | 1; // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
|
||||
|
scanType: scanType[]; // 可以指定扫二维码还是一维码,默认二者都有
|
||||
|
// 当needResult 为 1 时,扫码返回的结果
|
||||
|
success(res: { resultStr: string }): void; |
||||
|
} |
||||
|
/** |
||||
|
* 调起微信扫一扫接口 |
||||
|
*/ |
||||
|
function scanQRCode(params: IscanQRCode): void; |
||||
|
/*=============================微信扫一扫================================*/ |
||||
|
/*=============================微信小店================================*/ |
||||
|
|
||||
|
interface IopenProductSpecificView extends BaseParams { |
||||
|
productId: string; // 商品id
|
||||
|
viewType: "0" | "1" | "2"; // 0.默认值,普通商品详情页1.扫一扫商品详情页2.小店商品详情页
|
||||
|
} |
||||
|
/** |
||||
|
* 跳转微信商品页接口 |
||||
|
*/ |
||||
|
function openProductSpecificView(params: IopenProductSpecificView): void; |
||||
|
/*=============================微信卡券================================*/ |
||||
|
|
||||
|
interface IchooseCard extends BaseParams { |
||||
|
shopId: string; // 门店Id
|
||||
|
cardType: string; // 卡券类型
|
||||
|
cardId: string; // 卡券Id
|
||||
|
timestamp: number; // 卡券签名时间戳
|
||||
|
nonceStr: string; // 卡券签名随机串
|
||||
|
signType: string; // 签名方式,默认'SHA1'
|
||||
|
cardSign: string; // 卡券签名
|
||||
|
success(res: { cardList: string[] }): void; |
||||
|
} |
||||
|
/** |
||||
|
* 拉取适用卡券列表并获取用户选择信息 |
||||
|
*/ |
||||
|
function chooseCard(params: IchooseCard): void; |
||||
|
|
||||
|
interface IaddCard extends BaseParams { |
||||
|
cardList: Array<{ |
||||
|
cardId: string; |
||||
|
cardExt: string; |
||||
|
}>; // 需要添加的卡券列表
|
||||
|
success(res: { cardList: string[] }): void; |
||||
|
} |
||||
|
/** |
||||
|
* 批量添加卡券接口 |
||||
|
*/ |
||||
|
function addCard(): void; |
||||
|
|
||||
|
interface IopenCard extends BaseParams { |
||||
|
cardList: Array<{ |
||||
|
cardId: string; |
||||
|
code: string; |
||||
|
}>; // 需要打开的卡券列表
|
||||
|
} |
||||
|
/** |
||||
|
* 查看微信卡包中的卡券接口 |
||||
|
*/ |
||||
|
function openCard(params: IopenCard): void; |
||||
|
|
||||
|
interface IconsumeAndShareCard extends BaseParams { |
||||
|
cardId: string; |
||||
|
code: string; |
||||
|
} |
||||
|
/** |
||||
|
* 核销后再次赠送卡券接口 |
||||
|
*/ |
||||
|
function consumeAndShareCard(params: IconsumeAndShareCard): void; |
||||
|
/*=============================微信卡券================================*/ |
||||
|
/*=============================微信支付================================*/ |
||||
|
|
||||
|
interface IchooseWXPay extends BaseParams { |
||||
|
timestamp: number; // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
|
||||
|
nonceStr: string; // 支付签名随机串,不长于 32 位
|
||||
|
package: string; // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=***)
|
||||
|
signType: string; // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
|
||||
|
paySign: string; // 支付签名
|
||||
|
// 支付成功后的回调函数
|
||||
|
success(res: any): void; |
||||
|
} |
||||
|
/** |
||||
|
* 发起一个微信支付请求 |
||||
|
*/ |
||||
|
function chooseWXPay(params: IchooseWXPay): void; |
||||
|
/*=============================微信支付================================*/ |
||||
|
/*=============================微信小程序==============================*/ |
||||
|
interface miniProgramMethodsParams extends BaseParams { |
||||
|
url: string; |
||||
|
} |
||||
|
interface miniProgramMethods { |
||||
|
navigateTo(params: miniProgramMethodsParams): void; |
||||
|
navigateBack(params: miniProgramMethodsParams): void; |
||||
|
switchTab(params: miniProgramMethodsParams): void; |
||||
|
reLaunch(params: miniProgramMethodsParams): void; |
||||
|
redirectTo(params: miniProgramMethodsParams): void; |
||||
|
postMessage(params: { data: any }): void; |
||||
|
getEnv(fn: (res: any) => void): void; |
||||
|
} |
||||
|
const miniProgram: miniProgramMethods; |
||||
|
/*=============================微信小程序==============================*/ |
||||
|
} |
||||
|
declare function wx(): void; |
||||
|
/*=============================微信内全局变量==============================*/ |
||||
|
declare global { |
||||
|
interface Window { |
||||
|
WeixinJSBridge: any; |
||||
|
__wxjs_environment: any; |
||||
|
} |
||||
|
const WeixinJSBridge: any; |
||||
|
} |
||||
|
export default wx; |
@ -0,0 +1,891 @@ |
|||||
|
!(function (e, n) { |
||||
|
module.exports = n(e); |
||||
|
})(typeof window === "object" && window, function (r, e) { |
||||
|
if (!r) { |
||||
|
console.warn("can't use weixin-js-sdk in server side"); |
||||
|
return; |
||||
|
} |
||||
|
var a, c, n, i, t, o, s, d, l, u, p, f, m, g, h, S, y, I, v, _, w, T; |
||||
|
if (!r.jWeixin) |
||||
|
return ( |
||||
|
(a = { |
||||
|
config: "preVerifyJSAPI", |
||||
|
onMenuShareTimeline: "menu:share:timeline", |
||||
|
onMenuShareAppMessage: "menu:share:appmessage", |
||||
|
onMenuShareQQ: "menu:share:qq", |
||||
|
onMenuShareWeibo: "menu:share:weiboApp", |
||||
|
onMenuShareQZone: "menu:share:QZone", |
||||
|
previewImage: "imagePreview", |
||||
|
getLocation: "geoLocation", |
||||
|
openProductSpecificView: "openProductViewWithPid", |
||||
|
addCard: "batchAddCard", |
||||
|
openCard: "batchViewCard", |
||||
|
chooseWXPay: "getBrandWCPayRequest", |
||||
|
openEnterpriseRedPacket: "getRecevieBizHongBaoRequest", |
||||
|
startSearchBeacons: "startMonitoringBeacons", |
||||
|
stopSearchBeacons: "stopMonitoringBeacons", |
||||
|
onSearchBeacons: "onBeaconsInRange", |
||||
|
consumeAndShareCard: "consumedShareCard", |
||||
|
openAddress: "editAddress", |
||||
|
}), |
||||
|
(c = (function () { |
||||
|
var e, |
||||
|
n = {}; |
||||
|
for (e in a) n[a[e]] = e; |
||||
|
return n; |
||||
|
})()), |
||||
|
(n = r.document), |
||||
|
(i = n.title), |
||||
|
(t = navigator.userAgent.toLowerCase()), |
||||
|
(f = navigator.platform.toLowerCase()), |
||||
|
(o = !(!f.match("mac") && !f.match("win"))), |
||||
|
(s = -1 != t.indexOf("wxdebugger")), |
||||
|
(d = -1 != t.indexOf("micromessenger")), |
||||
|
(l = -1 != t.indexOf("android")), |
||||
|
(u = -1 != t.indexOf("iphone") || -1 != t.indexOf("ipad")), |
||||
|
(p = (f = |
||||
|
t.match(/micromessenger\/(\d+\.\d+\.\d+)/) || |
||||
|
t.match(/micromessenger\/(\d+\.\d+)/)) |
||||
|
? f[1] |
||||
|
: ""), |
||||
|
(m = { |
||||
|
initStartTime: L(), |
||||
|
initEndTime: 0, |
||||
|
preVerifyStartTime: 0, |
||||
|
preVerifyEndTime: 0, |
||||
|
}), |
||||
|
(g = { |
||||
|
version: 1, |
||||
|
appId: "", |
||||
|
initTime: 0, |
||||
|
preVerifyTime: 0, |
||||
|
networkType: "", |
||||
|
isPreVerifyOk: 1, |
||||
|
systemType: u ? 1 : l ? 2 : -1, |
||||
|
clientVersion: p, |
||||
|
url: encodeURIComponent(location.href), |
||||
|
}), |
||||
|
(h = {}), |
||||
|
(S = { _completes: [] }), |
||||
|
(y = { state: 0, data: {} }), |
||||
|
O(function () { |
||||
|
m.initEndTime = L(); |
||||
|
}), |
||||
|
(I = !1), |
||||
|
(v = []), |
||||
|
(_ = { |
||||
|
config: function (e) { |
||||
|
C("config", (h = e)); |
||||
|
var o = !1 !== h.check; |
||||
|
O(function () { |
||||
|
if (o) |
||||
|
k( |
||||
|
a.config, |
||||
|
{ |
||||
|
verifyJsApiList: A(h.jsApiList), |
||||
|
verifyOpenTagList: A(h.openTagList), |
||||
|
}, |
||||
|
((S._complete = function (e) { |
||||
|
(m.preVerifyEndTime = L()), (y.state = 1), (y.data = e); |
||||
|
}), |
||||
|
(S.success = function (e) { |
||||
|
g.isPreVerifyOk = 0; |
||||
|
}), |
||||
|
(S.fail = function (e) { |
||||
|
S._fail ? S._fail(e) : (y.state = -1); |
||||
|
}), |
||||
|
(t = S._completes).push(function () { |
||||
|
B(); |
||||
|
}), |
||||
|
(S.complete = function (e) { |
||||
|
for (var n = 0, i = t.length; n < i; ++n) t[n](); |
||||
|
S._completes = []; |
||||
|
}), |
||||
|
S) |
||||
|
), |
||||
|
(m.preVerifyStartTime = L()); |
||||
|
else { |
||||
|
y.state = 1; |
||||
|
for (var e = S._completes, n = 0, i = e.length; n < i; ++n) |
||||
|
e[n](); |
||||
|
S._completes = []; |
||||
|
} |
||||
|
var t; |
||||
|
}), |
||||
|
_.invoke || |
||||
|
((_.invoke = function (e, n, i) { |
||||
|
r.WeixinJSBridge && WeixinJSBridge.invoke(e, P(n), i); |
||||
|
}), |
||||
|
(_.on = function (e, n) { |
||||
|
r.WeixinJSBridge && WeixinJSBridge.on(e, n); |
||||
|
})); |
||||
|
}, |
||||
|
ready: function (e) { |
||||
|
(0 != y.state || (S._completes.push(e), !d && h.debug)) && e(); |
||||
|
}, |
||||
|
error: function (e) { |
||||
|
p < "6.0.2" || (-1 == y.state ? e(y.data) : (S._fail = e)); |
||||
|
}, |
||||
|
checkJsApi: function (e) { |
||||
|
k( |
||||
|
"checkJsApi", |
||||
|
{ jsApiList: A(e.jsApiList) }, |
||||
|
((e._complete = function (e) { |
||||
|
l && (i = e.checkResult) && (e.checkResult = JSON.parse(i)); |
||||
|
var n, |
||||
|
i = e, |
||||
|
t = i.checkResult; |
||||
|
for (n in t) { |
||||
|
var o = c[n]; |
||||
|
o && ((t[o] = t[n]), delete t[n]); |
||||
|
} |
||||
|
}), |
||||
|
e) |
||||
|
); |
||||
|
}, |
||||
|
onMenuShareTimeline: function (e) { |
||||
|
M( |
||||
|
a.onMenuShareTimeline, |
||||
|
{ |
||||
|
complete: function () { |
||||
|
k( |
||||
|
"shareTimeline", |
||||
|
{ |
||||
|
title: e.title || i, |
||||
|
desc: e.title || i, |
||||
|
img_url: e.imgUrl || "", |
||||
|
link: e.link || location.href, |
||||
|
type: e.type || "link", |
||||
|
data_url: e.dataUrl || "", |
||||
|
}, |
||||
|
e |
||||
|
); |
||||
|
}, |
||||
|
}, |
||||
|
e |
||||
|
); |
||||
|
}, |
||||
|
onMenuShareAppMessage: function (n) { |
||||
|
M( |
||||
|
a.onMenuShareAppMessage, |
||||
|
{ |
||||
|
complete: function (e) { |
||||
|
"favorite" === e.scene |
||||
|
? k("sendAppMessage", { |
||||
|
title: n.title || i, |
||||
|
desc: n.desc || "", |
||||
|
link: n.link || location.href, |
||||
|
img_url: n.imgUrl || "", |
||||
|
type: n.type || "link", |
||||
|
data_url: n.dataUrl || "", |
||||
|
}) |
||||
|
: k( |
||||
|
"sendAppMessage", |
||||
|
{ |
||||
|
title: n.title || i, |
||||
|
desc: n.desc || "", |
||||
|
link: n.link || location.href, |
||||
|
img_url: n.imgUrl || "", |
||||
|
type: n.type || "link", |
||||
|
data_url: n.dataUrl || "", |
||||
|
}, |
||||
|
n |
||||
|
); |
||||
|
}, |
||||
|
}, |
||||
|
n |
||||
|
); |
||||
|
}, |
||||
|
onMenuShareQQ: function (e) { |
||||
|
M( |
||||
|
a.onMenuShareQQ, |
||||
|
{ |
||||
|
complete: function () { |
||||
|
k( |
||||
|
"shareQQ", |
||||
|
{ |
||||
|
title: e.title || i, |
||||
|
desc: e.desc || "", |
||||
|
img_url: e.imgUrl || "", |
||||
|
link: e.link || location.href, |
||||
|
}, |
||||
|
e |
||||
|
); |
||||
|
}, |
||||
|
}, |
||||
|
e |
||||
|
); |
||||
|
}, |
||||
|
onMenuShareWeibo: function (e) { |
||||
|
M( |
||||
|
a.onMenuShareWeibo, |
||||
|
{ |
||||
|
complete: function () { |
||||
|
k( |
||||
|
"shareWeiboApp", |
||||
|
{ |
||||
|
title: e.title || i, |
||||
|
desc: e.desc || "", |
||||
|
img_url: e.imgUrl || "", |
||||
|
link: e.link || location.href, |
||||
|
}, |
||||
|
e |
||||
|
); |
||||
|
}, |
||||
|
}, |
||||
|
e |
||||
|
); |
||||
|
}, |
||||
|
onMenuShareQZone: function (e) { |
||||
|
M( |
||||
|
a.onMenuShareQZone, |
||||
|
{ |
||||
|
complete: function () { |
||||
|
k( |
||||
|
"shareQZone", |
||||
|
{ |
||||
|
title: e.title || i, |
||||
|
desc: e.desc || "", |
||||
|
img_url: e.imgUrl || "", |
||||
|
link: e.link || location.href, |
||||
|
}, |
||||
|
e |
||||
|
); |
||||
|
}, |
||||
|
}, |
||||
|
e |
||||
|
); |
||||
|
}, |
||||
|
updateTimelineShareData: function (e) { |
||||
|
k( |
||||
|
"updateTimelineShareData", |
||||
|
{ title: e.title, link: e.link, imgUrl: e.imgUrl }, |
||||
|
e |
||||
|
); |
||||
|
}, |
||||
|
updateAppMessageShareData: function (e) { |
||||
|
k( |
||||
|
"updateAppMessageShareData", |
||||
|
{ title: e.title, desc: e.desc, link: e.link, imgUrl: e.imgUrl }, |
||||
|
e |
||||
|
); |
||||
|
}, |
||||
|
startRecord: function (e) { |
||||
|
k("startRecord", {}, e); |
||||
|
}, |
||||
|
stopRecord: function (e) { |
||||
|
k("stopRecord", {}, e); |
||||
|
}, |
||||
|
onVoiceRecordEnd: function (e) { |
||||
|
M("onVoiceRecordEnd", e); |
||||
|
}, |
||||
|
playVoice: function (e) { |
||||
|
k("playVoice", { localId: e.localId }, e); |
||||
|
}, |
||||
|
pauseVoice: function (e) { |
||||
|
k("pauseVoice", { localId: e.localId }, e); |
||||
|
}, |
||||
|
stopVoice: function (e) { |
||||
|
k("stopVoice", { localId: e.localId }, e); |
||||
|
}, |
||||
|
onVoicePlayEnd: function (e) { |
||||
|
M("onVoicePlayEnd", e); |
||||
|
}, |
||||
|
uploadVoice: function (e) { |
||||
|
k( |
||||
|
"uploadVoice", |
||||
|
{ |
||||
|
localId: e.localId, |
||||
|
isShowProgressTips: 0 == e.isShowProgressTips ? 0 : 1, |
||||
|
}, |
||||
|
e |
||||
|
); |
||||
|
}, |
||||
|
downloadVoice: function (e) { |
||||
|
k( |
||||
|
"downloadVoice", |
||||
|
{ |
||||
|
serverId: e.serverId, |
||||
|
isShowProgressTips: 0 == e.isShowProgressTips ? 0 : 1, |
||||
|
}, |
||||
|
e |
||||
|
); |
||||
|
}, |
||||
|
translateVoice: function (e) { |
||||
|
k( |
||||
|
"translateVoice", |
||||
|
{ |
||||
|
localId: e.localId, |
||||
|
isShowProgressTips: 0 == e.isShowProgressTips ? 0 : 1, |
||||
|
}, |
||||
|
e |
||||
|
); |
||||
|
}, |
||||
|
chooseImage: function (e) { |
||||
|
k( |
||||
|
"chooseImage", |
||||
|
{ |
||||
|
scene: "1|2", |
||||
|
count: e.count || 9, |
||||
|
sizeType: e.sizeType || ["original", "compressed"], |
||||
|
sourceType: e.sourceType || ["album", "camera"], |
||||
|
}, |
||||
|
((e._complete = function (e) { |
||||
|
if (l) { |
||||
|
var n = e.localIds; |
||||
|
try { |
||||
|
n && (e.localIds = JSON.parse(n)); |
||||
|
} catch (e) {} |
||||
|
} |
||||
|
}), |
||||
|
e) |
||||
|
); |
||||
|
}, |
||||
|
getLocation: function (e) { |
||||
|
(e = e || {}), |
||||
|
k( |
||||
|
a.getLocation, |
||||
|
{ type: e.type || "wgs84" }, |
||||
|
((e._complete = function (e) { |
||||
|
delete e.type; |
||||
|
}), |
||||
|
e) |
||||
|
); |
||||
|
}, |
||||
|
previewImage: function (e) { |
||||
|
k(a.previewImage, { current: e.current, urls: e.urls }, e); |
||||
|
}, |
||||
|
uploadImage: function (e) { |
||||
|
k( |
||||
|
"uploadImage", |
||||
|
{ |
||||
|
localId: e.localId, |
||||
|
isShowProgressTips: 0 == e.isShowProgressTips ? 0 : 1, |
||||
|
}, |
||||
|
e |
||||
|
); |
||||
|
}, |
||||
|
downloadImage: function (e) { |
||||
|
k( |
||||
|
"downloadImage", |
||||
|
{ |
||||
|
serverId: e.serverId, |
||||
|
isShowProgressTips: 0 == e.isShowProgressTips ? 0 : 1, |
||||
|
}, |
||||
|
e |
||||
|
); |
||||
|
}, |
||||
|
getLocalImgData: function (e) { |
||||
|
!1 === I |
||||
|
? ((I = !0), |
||||
|
k( |
||||
|
"getLocalImgData", |
||||
|
{ localId: e.localId }, |
||||
|
((e._complete = function (e) { |
||||
|
var n; |
||||
|
(I = !1), |
||||
|
0 < v.length && ((n = v.shift()), wx.getLocalImgData(n)); |
||||
|
}), |
||||
|
e) |
||||
|
)) |
||||
|
: v.push(e); |
||||
|
}, |
||||
|
getNetworkType: function (e) { |
||||
|
k( |
||||
|
"getNetworkType", |
||||
|
{}, |
||||
|
((e._complete = function (e) { |
||||
|
var n = e, |
||||
|
e = n.errMsg, |
||||
|
i = ((n.errMsg = "getNetworkType:ok"), n.subtype); |
||||
|
if ((delete n.subtype, i)) n.networkType = i; |
||||
|
else { |
||||
|
var i = e.indexOf(":"), |
||||
|
t = e.substring(i + 1); |
||||
|
switch (t) { |
||||
|
case "wifi": |
||||
|
case "edge": |
||||
|
case "wwan": |
||||
|
n.networkType = t; |
||||
|
break; |
||||
|
default: |
||||
|
n.errMsg = "getNetworkType:fail"; |
||||
|
} |
||||
|
} |
||||
|
}), |
||||
|
e) |
||||
|
); |
||||
|
}, |
||||
|
openLocation: function (e) { |
||||
|
k( |
||||
|
"openLocation", |
||||
|
{ |
||||
|
latitude: e.latitude, |
||||
|
longitude: e.longitude, |
||||
|
name: e.name || "", |
||||
|
address: e.address || "", |
||||
|
scale: e.scale || 28, |
||||
|
infoUrl: e.infoUrl || "", |
||||
|
}, |
||||
|
e |
||||
|
); |
||||
|
}, |
||||
|
hideOptionMenu: function (e) { |
||||
|
k("hideOptionMenu", {}, e); |
||||
|
}, |
||||
|
showOptionMenu: function (e) { |
||||
|
k("showOptionMenu", {}, e); |
||||
|
}, |
||||
|
closeWindow: function (e) { |
||||
|
k("closeWindow", {}, (e = e || {})); |
||||
|
}, |
||||
|
hideMenuItems: function (e) { |
||||
|
k("hideMenuItems", { menuList: e.menuList }, e); |
||||
|
}, |
||||
|
showMenuItems: function (e) { |
||||
|
k("showMenuItems", { menuList: e.menuList }, e); |
||||
|
}, |
||||
|
hideAllNonBaseMenuItem: function (e) { |
||||
|
k("hideAllNonBaseMenuItem", {}, e); |
||||
|
}, |
||||
|
showAllNonBaseMenuItem: function (e) { |
||||
|
k("showAllNonBaseMenuItem", {}, e); |
||||
|
}, |
||||
|
scanQRCode: function (e) { |
||||
|
k( |
||||
|
"scanQRCode", |
||||
|
{ |
||||
|
needResult: (e = e || {}).needResult || 0, |
||||
|
scanType: e.scanType || ["qrCode", "barCode"], |
||||
|
}, |
||||
|
((e._complete = function (e) { |
||||
|
var n; |
||||
|
u && |
||||
|
(n = e.resultStr) && |
||||
|
((n = JSON.parse(n)), |
||||
|
(e.resultStr = n && n.scan_code && n.scan_code.scan_result)); |
||||
|
}), |
||||
|
e) |
||||
|
); |
||||
|
}, |
||||
|
openAddress: function (e) { |
||||
|
k( |
||||
|
a.openAddress, |
||||
|
{}, |
||||
|
((e._complete = function (e) { |
||||
|
((e = e).postalCode = e.addressPostalCode), |
||||
|
delete e.addressPostalCode, |
||||
|
(e.provinceName = e.proviceFirstStageName), |
||||
|
delete e.proviceFirstStageName, |
||||
|
(e.cityName = e.addressCitySecondStageName), |
||||
|
delete e.addressCitySecondStageName, |
||||
|
(e.countryName = e.addressCountiesThirdStageName), |
||||
|
delete e.addressCountiesThirdStageName, |
||||
|
(e.detailInfo = e.addressDetailInfo), |
||||
|
delete e.addressDetailInfo; |
||||
|
}), |
||||
|
e) |
||||
|
); |
||||
|
}, |
||||
|
openProductSpecificView: function (e) { |
||||
|
k( |
||||
|
a.openProductSpecificView, |
||||
|
{ |
||||
|
pid: e.productId, |
||||
|
view_type: e.viewType || 0, |
||||
|
ext_info: e.extInfo, |
||||
|
}, |
||||
|
e |
||||
|
); |
||||
|
}, |
||||
|
addCard: function (e) { |
||||
|
for (var n = e.cardList, i = [], t = 0, o = n.length; t < o; ++t) { |
||||
|
var r = n[t], |
||||
|
r = { card_id: r.cardId, card_ext: r.cardExt }; |
||||
|
i.push(r); |
||||
|
} |
||||
|
k( |
||||
|
a.addCard, |
||||
|
{ card_list: i }, |
||||
|
((e._complete = function (e) { |
||||
|
if ((n = e.card_list)) { |
||||
|
for (var n, i = 0, t = (n = JSON.parse(n)).length; i < t; ++i) { |
||||
|
var o = n[i]; |
||||
|
(o.cardId = o.card_id), |
||||
|
(o.cardExt = o.card_ext), |
||||
|
(o.isSuccess = !!o.is_succ), |
||||
|
delete o.card_id, |
||||
|
delete o.card_ext, |
||||
|
delete o.is_succ; |
||||
|
} |
||||
|
(e.cardList = n), delete e.card_list; |
||||
|
} |
||||
|
}), |
||||
|
e) |
||||
|
); |
||||
|
}, |
||||
|
chooseCard: function (e) { |
||||
|
k( |
||||
|
"chooseCard", |
||||
|
{ |
||||
|
app_id: h.appId, |
||||
|
location_id: e.shopId || "", |
||||
|
sign_type: e.signType || "SHA1", |
||||
|
card_id: e.cardId || "", |
||||
|
card_type: e.cardType || "", |
||||
|
card_sign: e.cardSign, |
||||
|
time_stamp: e.timestamp + "", |
||||
|
nonce_str: e.nonceStr, |
||||
|
}, |
||||
|
((e._complete = function (e) { |
||||
|
(e.cardList = e.choose_card_info), delete e.choose_card_info; |
||||
|
}), |
||||
|
e) |
||||
|
); |
||||
|
}, |
||||
|
openCard: function (e) { |
||||
|
for (var n = e.cardList, i = [], t = 0, o = n.length; t < o; ++t) { |
||||
|
var r = n[t], |
||||
|
r = { card_id: r.cardId, code: r.code }; |
||||
|
i.push(r); |
||||
|
} |
||||
|
k(a.openCard, { card_list: i }, e); |
||||
|
}, |
||||
|
consumeAndShareCard: function (e) { |
||||
|
k( |
||||
|
a.consumeAndShareCard, |
||||
|
{ consumedCardId: e.cardId, consumedCode: e.code }, |
||||
|
e |
||||
|
); |
||||
|
}, |
||||
|
chooseWXPay: function (e) { |
||||
|
k(a.chooseWXPay, x(e), e), B({ jsApiName: "chooseWXPay" }); |
||||
|
}, |
||||
|
openEnterpriseRedPacket: function (e) { |
||||
|
k(a.openEnterpriseRedPacket, x(e), e); |
||||
|
}, |
||||
|
startSearchBeacons: function (e) { |
||||
|
k(a.startSearchBeacons, { ticket: e.ticket }, e); |
||||
|
}, |
||||
|
stopSearchBeacons: function (e) { |
||||
|
k(a.stopSearchBeacons, {}, e); |
||||
|
}, |
||||
|
onSearchBeacons: function (e) { |
||||
|
M(a.onSearchBeacons, e); |
||||
|
}, |
||||
|
openEnterpriseChat: function (e) { |
||||
|
k( |
||||
|
"openEnterpriseChat", |
||||
|
{ useridlist: e.userIds, chatname: e.groupName }, |
||||
|
e |
||||
|
); |
||||
|
}, |
||||
|
launchMiniProgram: function (e) { |
||||
|
k( |
||||
|
"launchMiniProgram", |
||||
|
{ |
||||
|
targetAppId: e.targetAppId, |
||||
|
path: (function (e) { |
||||
|
var n; |
||||
|
if ("string" == typeof e && 0 < e.length) |
||||
|
return ( |
||||
|
(n = e.split("?")[0]), |
||||
|
(n += ".html"), |
||||
|
void 0 !== (e = e.split("?")[1]) ? n + "?" + e : n |
||||
|
); |
||||
|
})(e.path), |
||||
|
envVersion: e.envVersion, |
||||
|
}, |
||||
|
e |
||||
|
); |
||||
|
}, |
||||
|
openBusinessView: function (e) { |
||||
|
k( |
||||
|
"openBusinessView", |
||||
|
{ |
||||
|
businessType: e.businessType, |
||||
|
queryString: e.queryString || "", |
||||
|
envVersion: e.envVersion, |
||||
|
}, |
||||
|
((e._complete = function (n) { |
||||
|
if (l) { |
||||
|
var e = n.extraData; |
||||
|
if (e) |
||||
|
try { |
||||
|
n.extraData = JSON.parse(e); |
||||
|
} catch (e) { |
||||
|
n.extraData = {}; |
||||
|
} |
||||
|
} |
||||
|
}), |
||||
|
e) |
||||
|
); |
||||
|
}, |
||||
|
miniProgram: { |
||||
|
navigateBack: function (e) { |
||||
|
(e = e || {}), |
||||
|
O(function () { |
||||
|
k( |
||||
|
"invokeMiniProgramAPI", |
||||
|
{ name: "navigateBack", arg: { delta: e.delta || 1 } }, |
||||
|
e |
||||
|
); |
||||
|
}); |
||||
|
}, |
||||
|
navigateTo: function (e) { |
||||
|
O(function () { |
||||
|
k( |
||||
|
"invokeMiniProgramAPI", |
||||
|
{ name: "navigateTo", arg: { url: e.url } }, |
||||
|
e |
||||
|
); |
||||
|
}); |
||||
|
}, |
||||
|
redirectTo: function (e) { |
||||
|
O(function () { |
||||
|
k( |
||||
|
"invokeMiniProgramAPI", |
||||
|
{ name: "redirectTo", arg: { url: e.url } }, |
||||
|
e |
||||
|
); |
||||
|
}); |
||||
|
}, |
||||
|
switchTab: function (e) { |
||||
|
O(function () { |
||||
|
k( |
||||
|
"invokeMiniProgramAPI", |
||||
|
{ name: "switchTab", arg: { url: e.url } }, |
||||
|
e |
||||
|
); |
||||
|
}); |
||||
|
}, |
||||
|
reLaunch: function (e) { |
||||
|
O(function () { |
||||
|
k( |
||||
|
"invokeMiniProgramAPI", |
||||
|
{ name: "reLaunch", arg: { url: e.url } }, |
||||
|
e |
||||
|
); |
||||
|
}); |
||||
|
}, |
||||
|
postMessage: function (e) { |
||||
|
O(function () { |
||||
|
k( |
||||
|
"invokeMiniProgramAPI", |
||||
|
{ name: "postMessage", arg: e.data || {} }, |
||||
|
e |
||||
|
); |
||||
|
}); |
||||
|
}, |
||||
|
getEnv: function (e) { |
||||
|
O(function () { |
||||
|
e({ miniprogram: "miniprogram" === r.__wxjs_environment }); |
||||
|
}); |
||||
|
}, |
||||
|
}, |
||||
|
}), |
||||
|
(w = 1), |
||||
|
(T = {}), |
||||
|
n.addEventListener( |
||||
|
"error", |
||||
|
function (e) { |
||||
|
var n, i, t; |
||||
|
l || |
||||
|
((t = (n = e.target).tagName), |
||||
|
(i = n.src), |
||||
|
"IMG" != t && "VIDEO" != t && "AUDIO" != t && "SOURCE" != t) || |
||||
|
(-1 != i.indexOf("wxlocalresource://") && |
||||
|
(e.preventDefault(), |
||||
|
e.stopPropagation(), |
||||
|
(t = n["wx-id"]) || ((t = w++), (n["wx-id"] = t)), |
||||
|
T[t] || |
||||
|
((T[t] = !0), |
||||
|
wx.ready(function () { |
||||
|
wx.getLocalImgData({ |
||||
|
localId: i, |
||||
|
success: function (e) { |
||||
|
n.src = e.localData; |
||||
|
}, |
||||
|
}); |
||||
|
})))); |
||||
|
}, |
||||
|
!0 |
||||
|
), |
||||
|
n.addEventListener( |
||||
|
"load", |
||||
|
function (e) { |
||||
|
var n; |
||||
|
l || |
||||
|
((n = (e = e.target).tagName), |
||||
|
e.src, |
||||
|
"IMG" != n && "VIDEO" != n && "AUDIO" != n && "SOURCE" != n) || |
||||
|
((n = e["wx-id"]) && (T[n] = !1)); |
||||
|
}, |
||||
|
!0 |
||||
|
), |
||||
|
e && (r.wx = r.jWeixin = _), |
||||
|
_ |
||||
|
); |
||||
|
else return r.jWeixin; |
||||
|
function k(n, e, i) { |
||||
|
r.WeixinJSBridge |
||||
|
? WeixinJSBridge.invoke(n, P(e), function (e) { |
||||
|
V(n, e, i); |
||||
|
}) |
||||
|
: C(n, i); |
||||
|
} |
||||
|
function M(n, i, t) { |
||||
|
r.WeixinJSBridge |
||||
|
? WeixinJSBridge.on(n, function (e) { |
||||
|
t && t.trigger && t.trigger(e), V(n, e, i); |
||||
|
}) |
||||
|
: C(n, t || i); |
||||
|
} |
||||
|
function P(e) { |
||||
|
return ( |
||||
|
((e = e || {}).appId = h.appId), |
||||
|
(e.verifyAppId = h.appId), |
||||
|
(e.verifySignType = "sha1"), |
||||
|
(e.verifyTimestamp = h.timestamp + ""), |
||||
|
(e.verifyNonceStr = h.nonceStr), |
||||
|
(e.verifySignature = h.signature), |
||||
|
e |
||||
|
); |
||||
|
} |
||||
|
function x(e) { |
||||
|
return { |
||||
|
timeStamp: e.timestamp + "", |
||||
|
nonceStr: e.nonceStr, |
||||
|
package: e.package, |
||||
|
paySign: e.paySign, |
||||
|
signType: e.signType || "SHA1", |
||||
|
}; |
||||
|
} |
||||
|
function V(e, n, i) { |
||||
|
("openEnterpriseChat" != e && "openBusinessView" !== e) || |
||||
|
(n.errCode = n.err_code), |
||||
|
delete n.err_code, |
||||
|
delete n.err_desc, |
||||
|
delete n.err_detail; |
||||
|
var t = n.errMsg, |
||||
|
e = |
||||
|
(t || |
||||
|
((t = n.err_msg), |
||||
|
delete n.err_msg, |
||||
|
(t = (function (e, n) { |
||||
|
var i = c[e]; |
||||
|
i && (e = i); |
||||
|
i = "ok"; |
||||
|
{ |
||||
|
var t; |
||||
|
n && |
||||
|
((t = n.indexOf(":")), |
||||
|
("access denied" != |
||||
|
(i = (i = (i = |
||||
|
-1 != |
||||
|
(i = |
||||
|
-1 != |
||||
|
(i = |
||||
|
"failed" == |
||||
|
(i = "confirm" == (i = n.substring(t + 1)) ? "ok" : i) |
||||
|
? "fail" |
||||
|
: i).indexOf("failed_") |
||||
|
? i.substring(7) |
||||
|
: i).indexOf("fail_") |
||||
|
? i.substring(5) |
||||
|
: i).replace(/_/g, " ")).toLowerCase()) && |
||||
|
"no permission to execute" != i) || |
||||
|
(i = "permission denied"), |
||||
|
"" == |
||||
|
(i = |
||||
|
"config" == e && "function not exist" == i ? "ok" : i)) && |
||||
|
(i = "fail"); |
||||
|
} |
||||
|
return (n = e + ":" + i); |
||||
|
})(e, t)), |
||||
|
(n.errMsg = t)), |
||||
|
(i = i || {})._complete && (i._complete(n), delete i._complete), |
||||
|
(t = n.errMsg || ""), |
||||
|
h.debug && !i.isInnerInvoke && alert(JSON.stringify(n)), |
||||
|
t.indexOf(":")); |
||||
|
switch (t.substring(e + 1)) { |
||||
|
case "ok": |
||||
|
i.success && i.success(n); |
||||
|
break; |
||||
|
case "cancel": |
||||
|
i.cancel && i.cancel(n); |
||||
|
break; |
||||
|
default: |
||||
|
i.fail && i.fail(n); |
||||
|
} |
||||
|
i.complete && i.complete(n); |
||||
|
} |
||||
|
function A(e) { |
||||
|
if (e) { |
||||
|
for (var n = 0, i = e.length; n < i; ++n) { |
||||
|
var t = e[n], |
||||
|
t = a[t]; |
||||
|
t && (e[n] = t); |
||||
|
} |
||||
|
return e; |
||||
|
} |
||||
|
} |
||||
|
function C(e, n) { |
||||
|
var i; |
||||
|
!h.debug || |
||||
|
(n && n.isInnerInvoke) || |
||||
|
((i = c[e]) && (e = i), |
||||
|
n && n._complete && delete n._complete, |
||||
|
console.log('"' + e + '",', n || "")); |
||||
|
} |
||||
|
function B(n) { |
||||
|
var i; |
||||
|
o || |
||||
|
s || |
||||
|
h.debug || |
||||
|
p < "6.0.2" || |
||||
|
g.systemType < 0 || |
||||
|
((i = new Image()), |
||||
|
(g.appId = h.appId), |
||||
|
(g.initTime = m.initEndTime - m.initStartTime), |
||||
|
(g.preVerifyTime = m.preVerifyEndTime - m.preVerifyStartTime), |
||||
|
_.getNetworkType({ |
||||
|
isInnerInvoke: !0, |
||||
|
success: function (e) { |
||||
|
g.networkType = e.networkType; |
||||
|
e = |
||||
|
"https://open.weixin.qq.com/sdk/report?v=" + |
||||
|
g.version + |
||||
|
"&o=" + |
||||
|
g.isPreVerifyOk + |
||||
|
"&s=" + |
||||
|
g.systemType + |
||||
|
"&c=" + |
||||
|
g.clientVersion + |
||||
|
"&a=" + |
||||
|
g.appId + |
||||
|
"&n=" + |
||||
|
g.networkType + |
||||
|
"&i=" + |
||||
|
g.initTime + |
||||
|
"&p=" + |
||||
|
g.preVerifyTime + |
||||
|
"&u=" + |
||||
|
g.url + |
||||
|
"&jsapi_name=" + |
||||
|
(n ? n.jsApiName : ""); |
||||
|
i.src = e; |
||||
|
}, |
||||
|
})); |
||||
|
} |
||||
|
function L() { |
||||
|
return new Date().getTime(); |
||||
|
} |
||||
|
function O(e) { |
||||
|
d && |
||||
|
(r.WeixinJSBridge |
||||
|
? e() |
||||
|
: n.addEventListener && |
||||
|
n.addEventListener("WeixinJSBridgeReady", e, !1)); |
||||
|
} |
||||
|
}); |
@ -0,0 +1,41 @@ |
|||||
|
{ |
||||
|
"_from": "weixin-js-sdk", |
||||
|
"_id": "weixin-js-sdk@1.6.5", |
||||
|
"_inBundle": false, |
||||
|
"_integrity": "sha512-Gph1WAWB2YN/lMOFB/ymb+hbU/wYazzJgu6PMMktCy9cSCeW5wA6Zwt0dpahJbJ+RJEwtTv2x9iIu0U4enuVSQ==", |
||||
|
"_location": "/weixin-js-sdk", |
||||
|
"_phantomChildren": {}, |
||||
|
"_requested": { |
||||
|
"type": "tag", |
||||
|
"registry": true, |
||||
|
"raw": "weixin-js-sdk", |
||||
|
"name": "weixin-js-sdk", |
||||
|
"escapedName": "weixin-js-sdk", |
||||
|
"rawSpec": "", |
||||
|
"saveSpec": null, |
||||
|
"fetchSpec": "latest" |
||||
|
}, |
||||
|
"_requiredBy": [ |
||||
|
"#USER", |
||||
|
"/" |
||||
|
], |
||||
|
"_resolved": "https://registry.npmmirror.com/weixin-js-sdk/-/weixin-js-sdk-1.6.5.tgz", |
||||
|
"_shasum": "01fe5220b91dbfe089fc0730d061be0e68271e6a", |
||||
|
"_spec": "weixin-js-sdk", |
||||
|
"_where": "D:\\work\\tourGuide", |
||||
|
"bugs": { |
||||
|
"url": "https://github.com/yanxi123-com/weixin-js-sdk/issues" |
||||
|
}, |
||||
|
"bundleDependencies": false, |
||||
|
"deprecated": false, |
||||
|
"description": "微信官方 js-sdk npm 安装版,支持 typescript", |
||||
|
"homepage": "https://yanxi123.com/", |
||||
|
"license": "MIT", |
||||
|
"main": "index.js", |
||||
|
"name": "weixin-js-sdk", |
||||
|
"repository": { |
||||
|
"type": "git", |
||||
|
"url": "git+https://github.com/yanxi123-com/weixin-js-sdk.git" |
||||
|
}, |
||||
|
"version": "1.6.5" |
||||
|
} |
@ -0,0 +1,541 @@ |
|||||
|
<template> |
||||
|
<view class="bg"> |
||||
|
<view class="top-box"> |
||||
|
<view class="search"> |
||||
|
<image src="https://static.ticket.sz-trip.com/tourist/index/search.png" class="search-img"></image> |
||||
|
<input type="text" v-model="keywords" placeholder="请输入导游姓名/产品名称" /> |
||||
|
</view> |
||||
|
|
||||
|
<view class="type-box flex-between"> |
||||
|
<view :class="['type-item', {'type-active': item.isSelect}]" v-for="(item,index) in typeList" :key="index" @click="selectConditions(item,index)"> |
||||
|
{{item.title}} |
||||
|
<view class="type-num flex-center" v-if="item.num > 0">{{item.num}}</view> |
||||
|
<image src="https://static.ticket.sz-trip.com/tourist/daoyou/bottomIcon.png" class="type-icon" v-if="index > 1"></image> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<!-- 列表 --> |
||||
|
<view v-for="(item,index) in list" :key="index" class="item" @click="goDetail(item)"> |
||||
|
<view class="item-img"> |
||||
|
<image :src="showImg(item.img)" mode="aspectFill"></image> |
||||
|
</view> |
||||
|
|
||||
|
<view class="item-content flex-column"> |
||||
|
<view class="item-title text-overflow"> |
||||
|
{{item.name}} |
||||
|
<view>{{item.level}}</view> |
||||
|
</view> |
||||
|
<view class="item-tags text-overflow"> |
||||
|
<view>{{item.year}}</view> |
||||
|
<view>{{item.language}}</view> |
||||
|
</view> |
||||
|
<view class="item-subtitle text-overflow">{{item.scenic}}</view> |
||||
|
<view class="item-subtitle text-overflow">{{item.title}}</view> |
||||
|
<view class="item-subtitle text-overflow">{{item.subtitle}}</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<!-- 性别弹框 --> |
||||
|
<uni-popup type="bottom" ref="sexPopup" @change="changeTabBar"> |
||||
|
<view class="sex-box"> |
||||
|
<view v-for="(item,index) in typeList[2].list" :key="index" class="flex-center" @click="changeSex(item)">{{item.title}}</view> |
||||
|
</view> |
||||
|
</uni-popup> |
||||
|
|
||||
|
<!-- 擅长景区弹框 --> |
||||
|
<uni-popup type="bottom" ref="scenicPopup" @change="changeTabBar" @maskClick="scenicConfirm(0)"> |
||||
|
<view class="scenic-box"> |
||||
|
<view class="scenic-top"> |
||||
|
<image src="https://static.ticket.sz-trip.com/tourist/daoyou/cha.png" class="cha-img" @click="scenicConfirm(0)"></image> |
||||
|
</view> |
||||
|
|
||||
|
<view class="scenic-center"> |
||||
|
<view class="scenic-types"> |
||||
|
<view v-for="(item,index) in typeList[3].list" :key="index" @click="typeList[3].typeIndex = index" |
||||
|
:class="['scenic-type', {'scenic-typeActive': index == typeList[3].typeIndex}]"> |
||||
|
{{item.name}} |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<view class="scenic-items"> |
||||
|
<view v-for="(item,index) in typeList[3].list[typeList[3].typeIndex].arr" :key="index" |
||||
|
:class="['scenic-item', {'scenic-active': item.isSelect}]" @click="item.isSelect = !item.isSelect"> |
||||
|
{{item.name}} |
||||
|
<image src="https://static.ticket.sz-trip.com/tourist/daoyou/selectImg.png" mode="" class="scenic-selectImg" v-if="item.isSelect"></image> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<view class="scenic-btn flex-center"> |
||||
|
<view class="flex-center" @click="scenicConfirm(1)">确定</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</uni-popup> |
||||
|
|
||||
|
<!-- 时间段弹框 --> |
||||
|
<uni-popup ref="calendarPopup" type="bottom" @change="changeTabBar"> |
||||
|
<view style="width: 100vw;height: 60vh;"> |
||||
|
<SelectCalendar :startDate="new Date(selectDate.startDay).Format('yyyy-MM-dd')" :endDate="new Date(selectDate.endDay).Format('yyyy-MM-dd')"></SelectCalendar> |
||||
|
</view> |
||||
|
</uni-popup> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import SelectCalendar from '../../components/selectCalendar.vue'; |
||||
|
export default { |
||||
|
components: {SelectCalendar}, |
||||
|
data() { |
||||
|
return { |
||||
|
keywords: '', |
||||
|
typeList: [ |
||||
|
{ |
||||
|
title: '推荐', |
||||
|
isSelect: false |
||||
|
}, |
||||
|
{ |
||||
|
title: '只看有时间', |
||||
|
isSelect: false |
||||
|
}, |
||||
|
{ |
||||
|
title: '性别', |
||||
|
isSelect: false, |
||||
|
list: [ |
||||
|
{ |
||||
|
title: '全部', |
||||
|
id: '' |
||||
|
}, |
||||
|
{ |
||||
|
title: '男', |
||||
|
id: '1' |
||||
|
}, |
||||
|
{ |
||||
|
title: '女', |
||||
|
id: '2' |
||||
|
} |
||||
|
] |
||||
|
}, |
||||
|
{ |
||||
|
title: '擅长景区', |
||||
|
isSelect: false, |
||||
|
num: 0, |
||||
|
list: [], |
||||
|
typeIndex: 0 |
||||
|
}, |
||||
|
{ |
||||
|
title: '时间段', |
||||
|
isSelect: false, |
||||
|
num: 0 |
||||
|
} |
||||
|
], |
||||
|
list: [ |
||||
|
{ |
||||
|
img: 'https://static.ticket.sz-trip.com/uploads/20241126/50d406ead15c861f76b8df7dab401802.png', |
||||
|
name: '导游姓名', |
||||
|
level: '大师级', |
||||
|
year: '从业10年', |
||||
|
language: '英语专八、俄语二级', |
||||
|
scenic: '擅长拙政园、寒山寺、西门町等景区', |
||||
|
title: '主卖点主卖点', |
||||
|
subtitle: '个性签名个性签名个性签名个性签名' |
||||
|
}, |
||||
|
{ |
||||
|
img: 'https://static.ticket.sz-trip.com/uploads/20241126/50d406ead15c861f76b8df7dab401802.png', |
||||
|
name: '导游姓名', |
||||
|
level: '大师级', |
||||
|
year: '从业10年', |
||||
|
language: '英语专八、俄语二级', |
||||
|
scenic: '擅长拙政园、寒山寺、西门町等景区', |
||||
|
title: '主卖点主卖点', |
||||
|
subtitle: '个性签名个性签名个性签名个性签名' |
||||
|
}, |
||||
|
{ |
||||
|
img: 'https://static.ticket.sz-trip.com/uploads/20241126/50d406ead15c861f76b8df7dab401802.png', |
||||
|
name: '导游姓名', |
||||
|
level: '大师级', |
||||
|
year: '从业10年', |
||||
|
language: '英语专八、俄语二级', |
||||
|
scenic: '擅长拙政园、寒山寺、西门町等景区', |
||||
|
title: '主卖点主卖点', |
||||
|
subtitle: '个性签名个性签名个性签名个性签名' |
||||
|
} |
||||
|
], |
||||
|
selectDate: { |
||||
|
startDay:new Date().Format('yyyy-MM-dd'), |
||||
|
endDay:new Date((new Date()).getFullYear(), (new Date()).getMonth(), new Date().getDate()+1).Format('yyyy-MM-dd'), |
||||
|
differDays: 1 |
||||
|
}, |
||||
|
} |
||||
|
}, |
||||
|
onLoad() { |
||||
|
uni.$on('changeScenicDate', data => { |
||||
|
if(data) { |
||||
|
this.selectDate = data |
||||
|
this.typeList[4].num = this.selectDate.differDays |
||||
|
} |
||||
|
this.$refs.calendarPopup.close(); |
||||
|
}) |
||||
|
}, |
||||
|
onUnload() { |
||||
|
uni.$off('changeScenicDate') |
||||
|
}, |
||||
|
onShow() { |
||||
|
// 获取导游景区列表 |
||||
|
this.getScenicList() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 去详情 |
||||
|
goDetail(item) { |
||||
|
uni.navigateTo({ |
||||
|
url: '/subPackages/daoyou/detail' |
||||
|
}) |
||||
|
}, |
||||
|
// 获取导游景区列表 |
||||
|
getScenicList() { |
||||
|
this.Post({ |
||||
|
|
||||
|
},'/api/guide/getGuideScenicList').then(res => { |
||||
|
res.data.forEach(item => { |
||||
|
item.arr.forEach(items => { |
||||
|
items.isSelect = false |
||||
|
}) |
||||
|
}) |
||||
|
this.typeList[3].list = res.data |
||||
|
}) |
||||
|
}, |
||||
|
// 选择条件 |
||||
|
selectConditions(item, index) { |
||||
|
// 0推荐 1是否有时间 2性别 3擅长景区 4时间段 |
||||
|
if(index == 0 || index == 1) { |
||||
|
item.isSelect = !item.isSelect |
||||
|
} |
||||
|
|
||||
|
if(index == 2) { |
||||
|
this.$refs.sexPopup.open() |
||||
|
} |
||||
|
|
||||
|
if(index == 3) { |
||||
|
this.$refs.scenicPopup.open() |
||||
|
} |
||||
|
|
||||
|
if(index == 4) { |
||||
|
this.$refs.calendarPopup.open() |
||||
|
} |
||||
|
}, |
||||
|
// 弹出层被底部栏挡到 |
||||
|
changeTabBar(e) { |
||||
|
if(e.show) { |
||||
|
uni.hideTabBar() |
||||
|
}else { |
||||
|
uni.showTabBar() |
||||
|
} |
||||
|
}, |
||||
|
// 性别选择 |
||||
|
changeSex(item) { |
||||
|
if(!item.id) { |
||||
|
this.typeList[2].title = '性别' |
||||
|
this.typeList[2].isSelect = false |
||||
|
}else { |
||||
|
this.typeList[2].title = item.title |
||||
|
this.typeList[2].isSelect = true |
||||
|
} |
||||
|
this.$refs.sexPopup.close() |
||||
|
}, |
||||
|
// 擅长景区选择 |
||||
|
scenicConfirm(type) { |
||||
|
if(type) { |
||||
|
let num = 0 |
||||
|
this.typeList[3].list.forEach(item => { |
||||
|
item.arr.forEach(items => { |
||||
|
if(items.isSelect) num += 1 |
||||
|
}) |
||||
|
}) |
||||
|
this.typeList[3].num = num |
||||
|
}else { |
||||
|
this.typeList[3].list.forEach(item => { |
||||
|
item.arr.forEach(items => { |
||||
|
items.isSelect = false |
||||
|
}) |
||||
|
}) |
||||
|
} |
||||
|
this.$refs.scenicPopup.close() |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.bg { |
||||
|
min-height: 100vh; |
||||
|
background: #F9F5F0; |
||||
|
padding: 200rpx 0 100rpx; |
||||
|
} |
||||
|
|
||||
|
.top-box { |
||||
|
position: fixed; |
||||
|
top: calc(44px + env(safe-area-inset-top)); |
||||
|
width: 750rpx; |
||||
|
height: 180rpx; |
||||
|
background: #FFFFFF; |
||||
|
padding: 20rpx 26.67rpx 0; |
||||
|
z-index: 999; |
||||
|
|
||||
|
.search { |
||||
|
width: 697rpx; |
||||
|
height: 60rpx; |
||||
|
background: rgba(255, 255, 255, .7); |
||||
|
border: 1rpx solid #96684F; |
||||
|
padding: 0 29rpx; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
|
||||
|
.search-img { |
||||
|
width: 29rpx; |
||||
|
height: 29rpx; |
||||
|
margin-right: 21rpx; |
||||
|
} |
||||
|
|
||||
|
input { |
||||
|
flex: 1; |
||||
|
font-weight: 500; |
||||
|
font-size: 28rpx; |
||||
|
color: #666666; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.type-box { |
||||
|
height: 40rpx; |
||||
|
margin-top: 35rpx; |
||||
|
|
||||
|
.type-item { |
||||
|
font-weight: 500; |
||||
|
font-size: 27rpx; |
||||
|
color: #333333; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
|
||||
|
.type-num { |
||||
|
width: 27rpx; |
||||
|
height: 27rpx; |
||||
|
background: #DC2525; |
||||
|
border-radius: 50%; |
||||
|
font-size: 20rpx; |
||||
|
color: #FFFFFF; |
||||
|
margin-left: 3rpx; |
||||
|
} |
||||
|
|
||||
|
.type-icon { |
||||
|
width: 15.33rpx; |
||||
|
height: 8.67rpx; |
||||
|
margin-left: 8rpx; |
||||
|
} |
||||
|
} |
||||
|
.type-item:nth-child(2) { |
||||
|
padding-right: 15rpx; |
||||
|
border-right: 1rpx solid #D8D8D8; |
||||
|
} |
||||
|
|
||||
|
.type-active { |
||||
|
font-weight: bold; |
||||
|
color: #96684F; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.item { |
||||
|
margin: 26rpx auto; |
||||
|
width: 697rpx; |
||||
|
height: 273rpx; |
||||
|
background: #FFFFFF; |
||||
|
border-radius: 7rpx; |
||||
|
border: 1rpx solid #96684F; |
||||
|
background-image: url('https://static.ticket.sz-trip.com/tourist/daoyou/itemBg.png'); |
||||
|
background-size: 100% 100%; |
||||
|
padding: 14rpx; |
||||
|
display: flex; |
||||
|
|
||||
|
.item-img { |
||||
|
width: 204rpx; |
||||
|
height: 244rpx; |
||||
|
border: 1rpx solid #96684F; |
||||
|
background-image: url('https://static.ticket.sz-trip.com/tourist/daoyou/imgBg.png'); |
||||
|
background-size: 100% 100%; |
||||
|
|
||||
|
image { |
||||
|
width: 204rpx; |
||||
|
height: 244rpx; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.item-content { |
||||
|
margin-left: 20rpx; |
||||
|
padding: 5rpx 0 15rpx; |
||||
|
justify-content: space-between; |
||||
|
|
||||
|
.item-title { |
||||
|
font-weight: bold; |
||||
|
font-size: 31rpx; |
||||
|
color: #010101; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
|
||||
|
view { |
||||
|
line-height: 30.67rpx; |
||||
|
margin-left: 5rpx; |
||||
|
background-image: url('https://static.ticket.sz-trip.com/tourist/daoyou/rankBg.png'); |
||||
|
background-size: 100% 100%; |
||||
|
padding: 0 8rpx; |
||||
|
font-weight: 500; |
||||
|
font-size: 23rpx; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.item-tags { |
||||
|
display: flex; |
||||
|
font-weight: 500; |
||||
|
font-size: 24rpx; |
||||
|
color: #96684F; |
||||
|
|
||||
|
&>view:first-child::after { |
||||
|
content: '丨'; |
||||
|
display: inline-block; |
||||
|
margin: 0 5rpx; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.item-subtitle { |
||||
|
font-weight: 500; |
||||
|
font-size: 24rpx; |
||||
|
color: #888888; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 性别弹框 |
||||
|
.sex-box { |
||||
|
width: 750rpx; |
||||
|
height: 333rpx; |
||||
|
background: #FFFFFF; |
||||
|
padding: 0 30rpx; |
||||
|
font-weight: 500; |
||||
|
font-size: 31rpx; |
||||
|
color: #000000; |
||||
|
|
||||
|
view { |
||||
|
height: 33.3%; |
||||
|
} |
||||
|
view:nth-child(2) { |
||||
|
border-top: 1rpx solid #D8D8D8; |
||||
|
border-bottom: 1rpx solid #D8D8D8; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// 擅长景区弹框 |
||||
|
.scenic-box { |
||||
|
width: 750rpx; |
||||
|
height: 937rpx; |
||||
|
background: #FFFFFF; |
||||
|
padding-bottom: 155rpx; |
||||
|
position: relative; |
||||
|
|
||||
|
.scenic-top { |
||||
|
height: 100rpx; |
||||
|
border-bottom: 1rpx solid #D8D8D8; |
||||
|
padding: 26rpx 26rpx 0 0; |
||||
|
|
||||
|
.cha-img { |
||||
|
display: block; |
||||
|
width: 31.33rpx; |
||||
|
height: 31.33rpx; |
||||
|
margin-left: auto; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.scenic-center { |
||||
|
display: flex; |
||||
|
|
||||
|
.scenic-types { |
||||
|
width: 147rpx; |
||||
|
height: 680rpx; |
||||
|
background: #F7F7F7; |
||||
|
overflow-y: auto; |
||||
|
|
||||
|
.scenic-type { |
||||
|
line-height: 107rpx; |
||||
|
font-weight: 500; |
||||
|
font-size: 25rpx; |
||||
|
color: #111111; |
||||
|
text-align: center; |
||||
|
} |
||||
|
.scenic-typeActive { |
||||
|
background: #FFFFFF; |
||||
|
color: #96684F; |
||||
|
} |
||||
|
} |
||||
|
.scenic-type::-webkit-scrollbar { |
||||
|
display: none; |
||||
|
} |
||||
|
|
||||
|
.scenic-items { |
||||
|
width: 603rpx; |
||||
|
height: 680rpx; |
||||
|
padding: 26rpx 0 0 20rpx; |
||||
|
background: #FFFFFF; |
||||
|
overflow-y: auto; |
||||
|
|
||||
|
.scenic-item { |
||||
|
display: inline-block; |
||||
|
// width: 173rpx; |
||||
|
padding: 0 30rpx; |
||||
|
line-height: 67rpx; |
||||
|
text-align: center; |
||||
|
border-radius: 7rpx; |
||||
|
border: 1rpx solid #111111; |
||||
|
margin-bottom: 26rpx; |
||||
|
font-weight: 500; |
||||
|
font-size: 25rpx; |
||||
|
color: #111111; |
||||
|
margin-right: 20rpx; |
||||
|
} |
||||
|
.scenic-active { |
||||
|
position: relative; |
||||
|
background: #F9F5F0; |
||||
|
border: 1rpx solid #96684F; |
||||
|
color: #96684F; |
||||
|
|
||||
|
.scenic-selectImg { |
||||
|
position: absolute; |
||||
|
bottom: 0; |
||||
|
right: 0; |
||||
|
width: 28rpx; |
||||
|
height: 28rpx; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
.scenic-items::-webkit-scrollbar { |
||||
|
display: none; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.scenic-btn { |
||||
|
width: 750rpx; |
||||
|
height: 153rpx; |
||||
|
background: #FFFFFF; |
||||
|
box-shadow: 0rpx 0rpx 13rpx 0rpx rgba(82,82,82,0.25); |
||||
|
position: absolute; |
||||
|
bottom: 0; |
||||
|
|
||||
|
view { |
||||
|
width: 697rpx; |
||||
|
height: 73rpx; |
||||
|
background: #DC2525; |
||||
|
border-radius: 11rpx; |
||||
|
font-weight: bold; |
||||
|
font-size: 32rpx; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</style> |
@ -1,155 +0,0 @@ |
|||||
<template> |
|
||||
<view class="content"> |
|
||||
|
|
||||
<view class="common-types"> |
|
||||
<uni-badge class="uni-badge-left-margin" :text="6" absolute="rightTop" :offset="[5, 5]" size="small" |
|
||||
:custom-style="{background:'#E5131B',color:'#FFFFFF',border:'none'}"> |
|
||||
<view @click="setType(0)" :class="['common-type',type==0?'active':'']">会话中</view> |
|
||||
</uni-badge> |
|
||||
|
|
||||
<view @click="setType(1)" :class="['common-type',type==1?'active':'']">会话结束</view> |
|
||||
<view @click="setType(2)" :class="['common-type',type==2?'active':'']">用户离线</view> |
|
||||
</view> |
|
||||
|
|
||||
|
|
||||
<view class="content-area flex-1 h-1rpx"> |
|
||||
|
|
||||
<view class="dialogue-item"> |
|
||||
<image src="https://static.ticket.sz-trip.com/uploads/20241107/3480f83dd4b5346e04ad184f61cc848a.png"> |
|
||||
<view class="dialogue-info"> |
|
||||
<view class="name">游客1505</view> |
|
||||
<view class="message text-overflow">游客您好,导游,我想去寒山寺和拙政园路线,你您好,导游,我想去寒山寺和拙政园路线,你...</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
</view> |
|
||||
|
|
||||
|
|
||||
</view> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
|
|
||||
export default { |
|
||||
data() { |
|
||||
return { |
|
||||
type: 0, |
|
||||
|
|
||||
}; |
|
||||
}, |
|
||||
onShow() { |
|
||||
}, |
|
||||
onLoad() {}, |
|
||||
methods: { |
|
||||
setType (type) { |
|
||||
this.type = type |
|
||||
}, |
|
||||
|
|
||||
getInfo() { |
|
||||
this.Post({ |
|
||||
scenic_id: this.scenicId, |
|
||||
goods_id: this.goodsId, |
|
||||
offset: this.list.length, |
|
||||
limit: 10 |
|
||||
}, '/api/scenic/getGoodsCommentByScenicId').then(res => { |
|
||||
if (res) { |
|
||||
this.list = [...this.list, ...res.data] |
|
||||
this.list.forEach(item => { |
|
||||
item.close = false |
|
||||
item.needShowExpande = false |
|
||||
}) |
|
||||
console.log('添加close的list',this.list); |
|
||||
if (res.data.length < 10) { |
|
||||
this.finished = true |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
|
|
||||
}, |
|
||||
|
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style lang="scss" scoped> |
|
||||
*{ |
|
||||
box-sizing: border-box; |
|
||||
} |
|
||||
.content { |
|
||||
height: calc(100vh - 44px - 50px); |
|
||||
overflow-x: hidden; |
|
||||
position: relative; |
|
||||
display: flex; |
|
||||
flex-direction: column; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
.common-types { |
|
||||
padding: 34rpx 26rpx; |
|
||||
width: 100%; |
|
||||
overflow: hidden; |
|
||||
display: flex; |
|
||||
justify-content: space-between; |
|
||||
.common-type { |
|
||||
width: 201rpx; |
|
||||
height: 66rpx; |
|
||||
border-radius: 33rpx; |
|
||||
flex-shrink: 0; |
|
||||
line-height: 66rpx; |
|
||||
text-align: center; |
|
||||
color: #000000; |
|
||||
font-weight: 500; |
|
||||
font-size: 32rpx; |
|
||||
border: 1px solid #000000; |
|
||||
} |
|
||||
|
|
||||
.common-type.active { |
|
||||
background: #96684F; |
|
||||
border: none; |
|
||||
color: white; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
.content-area{ |
|
||||
overflow-y: auto; |
|
||||
overflow-x: hidden; |
|
||||
padding: 26rpx |
|
||||
} |
|
||||
|
|
||||
.dialogue-item{ |
|
||||
height: 90rpx; |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
margin-bottom:28rpx; |
|
||||
|
|
||||
image{ |
|
||||
width: 80rpx; |
|
||||
height: 80rpx; |
|
||||
border-radius: 50%; |
|
||||
flex-shrink: 0; |
|
||||
margin-right: 8rpx; |
|
||||
} |
|
||||
.dialogue-info{ |
|
||||
height: 90rpx; |
|
||||
padding: 0 50rpx 5rpx 5rpx; |
|
||||
width: 1px; |
|
||||
flex: 1; |
|
||||
border-bottom: 1px solid #BDBDBD;; |
|
||||
|
|
||||
.name{ |
|
||||
font-weight: 500; |
|
||||
font-size: 24rpx; |
|
||||
color: #4F4F4F; |
|
||||
} |
|
||||
.message{ |
|
||||
font-weight: 400; |
|
||||
font-size: 27rpx; |
|
||||
color: #000000; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
</style> |
|
@ -1,257 +1,383 @@ |
|||||
<template> |
<template> |
||||
<view class="content"> |
<view class="bg"> |
||||
<image src="https://static.ticket.sz-trip.com/tourGuide/images/index/topImg.png" class="topImg"></image> |
<view class="search-box flex-between"> |
||||
|
<view class="search"> |
||||
<view class="title" style="margin-top: 40rpx;">·快捷入口</view> |
<image src="https://static.ticket.sz-trip.com/tourist/index/search.png" class="search-img"></image> |
||||
|
请输入导游姓名/产品名称 |
||||
<view class="flex-between"> |
|
||||
<view class="nav-item flex-around"> |
|
||||
立即核销 |
|
||||
<image src="https://static.ticket.sz-trip.com/tourGuide/images/index/hexiao.png" mode=""></image> |
|
||||
</view> |
</view> |
||||
<view class="nav-item flex-around" @click="gotoPath('/subPackages/order/orderList')"> |
<view class="kefu"> |
||||
查看订单 |
<image src="https://static.ticket.sz-trip.com/tourist/index/kefu.png" class="kefu-img"></image> |
||||
<image src="https://static.ticket.sz-trip.com/tourGuide/images/index/dingdan.png" mode=""></image> |
客服 |
||||
</view> |
</view> |
||||
</view> |
</view> |
||||
|
|
||||
<view class="title">·我的排班</view> |
<swiper class="top-banner" :circular="true" :interval="6000" :current="current" indicator-active-color="#fff" |
||||
|
:duration="800" :indicator-dots="true" :autoplay="true" v-if="topBanner"> |
||||
|
<swiper-item v-for="(item, index) in topBanner" :key="index" @click.stop="gotoUrlNew(item)"> |
||||
|
<image class="top-banner" :src="showImg(item.head_img)" mode="aspectFill"></image> |
||||
|
</swiper-item> |
||||
|
</swiper> |
||||
|
|
||||
|
<!-- 发现宝藏导游 --> |
||||
|
<view class="title-box flex-between"> |
||||
|
<image src="https://static.ticket.sz-trip.com/tourist/index/title1.png" class="title-img"></image> |
||||
|
<view class="title-btn flex-around"> |
||||
|
探索更多 |
||||
|
<image src="https://static.ticket.sz-trip.com/tourist/index/rightIcon.png" class="rightIcon"></image> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
<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> |
</view> |
||||
</view> |
</view> |
||||
|
|
||||
<!-- 日历 --> |
<view class="tour-box"> |
||||
<calendarVue :isShowLunar="true" @changeDate="getDate"></calendarVue> |
<view v-for="(item,index) in tourList" :key="index" class="tour-item"> |
||||
|
<image :src="showImg(item.img)" mode="aspectFill" class="tour-img"></image> |
||||
|
<image src="https://static.ticket.sz-trip.com/tourist/index/play.png" class="playImg"></image> |
||||
|
<view class="time">{{item.time}}</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<!-- 精选线路 --> |
||||
|
<view class="title-box flex-between"> |
||||
|
<image src="https://static.ticket.sz-trip.com/tourist/index/title2.png" class="title-img"></image> |
||||
|
<view class="title-btn flex-around"> |
||||
|
探索更多 |
||||
|
<image src="https://static.ticket.sz-trip.com/tourist/index/rightIcon.png" class="rightIcon"></image> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
<!-- 选择场次 --> |
<view class="line-box"> |
||||
<view v-for="(item,index) in typeIndex ? sessionLists : sessionList" :key="index" class="session-item flex-between"> |
<view v-for="(item,index) in lineList" :key="index" class="line-item"> |
||||
{{item.title}} |
<image :src="showImg(item.img)" mode="aspectFill" class="line-img"></image> |
||||
<switch :checked="item.isChecked" color="#96684F" @change="switchChange(item,index)"/> |
<view class="line-content"> |
||||
|
<view class="line-title text-overflowRows">{{item.title}}</view> |
||||
|
<view class="line-price">{{item.price}}</view> |
||||
|
</view> |
||||
|
</view> |
||||
</view> |
</view> |
||||
</view> |
</view> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import calendarVue from '../../components/calendar.vue'; |
|
||||
export default { |
export default { |
||||
components: {calendarVue}, |
|
||||
data() { |
data() { |
||||
return { |
return { |
||||
typeList: [{ |
topBanner: [ |
||||
title: '导游服务', |
{ |
||||
|
head_img: 'https://static.ticket.sz-trip.com/uploads/20241126/50d406ead15c861f76b8df7dab401802.png' |
||||
|
}, |
||||
|
{ |
||||
|
head_img: 'https://static.ticket.sz-trip.com/uploads/20241126/50d406ead15c861f76b8df7dab401802.png' |
||||
|
} |
||||
|
], |
||||
|
typeList: [ |
||||
|
{ |
||||
|
title: '品牌导游', |
||||
id: '' |
id: '' |
||||
}, |
}, |
||||
// { |
|
||||
// title: '线上咨询', |
|
||||
// id: '' |
|
||||
// }, |
|
||||
// { |
|
||||
// title: '拼团产品', |
|
||||
// id: '' |
|
||||
// }, |
|
||||
{ |
{ |
||||
title: '线路产品', |
title: '选项2', |
||||
id: '' |
id: '' |
||||
} |
} |
||||
], |
], |
||||
typeIndex: 0, |
typeIndex: 0, |
||||
selectDay: '', |
tourList: [ |
||||
sessionList: [ |
|
||||
{ |
{ |
||||
title: '上午场', |
img: 'https://static.ticket.sz-trip.com/uploads/20241126/50d406ead15c861f76b8df7dab401802.png', |
||||
isChecked: false |
time: '0:30' |
||||
}, |
}, |
||||
{ |
{ |
||||
title: '下午场', |
img: 'https://static.ticket.sz-trip.com/uploads/20241126/50d406ead15c861f76b8df7dab401802.png', |
||||
isChecked: false |
time: '0:30' |
||||
}, |
}, |
||||
{ |
{ |
||||
title: '全天场', |
img: 'https://static.ticket.sz-trip.com/uploads/20241126/50d406ead15c861f76b8df7dab401802.png', |
||||
isChecked: false |
time: '0:30' |
||||
} |
} |
||||
], |
], |
||||
sessionLists: [ |
lineList: [ |
||||
|
{ |
||||
|
img: 'https://static.ticket.sz-trip.com/uploads/20241126/50d406ead15c861f76b8df7dab401802.png', |
||||
|
title: '1“水陆游太湖”', |
||||
|
price: '210' |
||||
|
}, |
||||
|
{ |
||||
|
img: 'https://static.ticket.sz-trip.com/uploads/20241126/50d406ead15c861f76b8df7dab401802.png', |
||||
|
title: '2“水陆游太湖”+导游讲解导游讲解 导游讲解导游讲解导游讲解', |
||||
|
price: '210' |
||||
|
}, |
||||
|
{ |
||||
|
img: 'https://static.ticket.sz-trip.com/uploads/20241126/50d406ead15c861f76b8df7dab401802.png', |
||||
|
title: '3“水陆游太湖”+导游讲解导游讲解 导游讲解导游讲解导游讲解', |
||||
|
price: '210' |
||||
|
}, |
||||
{ |
{ |
||||
title: '当天状态', |
img: 'https://static.ticket.sz-trip.com/uploads/20241126/50d406ead15c861f76b8df7dab401802.png', |
||||
isChecked: false |
title: '4“水陆游太湖”+导游讲解导游讲解 导游讲解导游讲解导游讲解', |
||||
|
price: '210' |
||||
|
}, |
||||
|
{ |
||||
|
img: 'https://static.ticket.sz-trip.com/uploads/20241126/50d406ead15c861f76b8df7dab401802.png', |
||||
|
title: '5“水陆游太湖”+导游讲解导游讲解 导游讲解导游讲解导游讲解', |
||||
|
price: '210' |
||||
|
}, |
||||
|
{ |
||||
|
img: 'https://static.ticket.sz-trip.com/uploads/20241126/50d406ead15c861f76b8df7dab401802.png', |
||||
|
title: '6“水陆游太湖”+导游讲解导游讲解 导游讲解导游讲解导游讲解', |
||||
|
price: '210' |
||||
|
}, |
||||
|
{ |
||||
|
img: 'https://static.ticket.sz-trip.com/uploads/20241126/50d406ead15c861f76b8df7dab401802.png', |
||||
|
title: '6“水陆游太湖”+导游讲解导游讲解 导游讲解导游讲解导游讲解', |
||||
|
price: '210' |
||||
} |
} |
||||
], |
] |
||||
isAllChecked: false, |
|
||||
} |
} |
||||
}, |
}, |
||||
onLoad() { |
onReady() { |
||||
this.selectDay = this.getNowTime(new Date()) |
|
||||
this.getList() |
|
||||
}, |
}, |
||||
methods: { |
methods: { |
||||
// 选择场次 |
// 2是各种详情页,3是列表专题页面,4是小程序 |
||||
switchChange(item, index) { |
gotoUrlNew(item) { |
||||
item.isChecked = !item.isChecked |
let url = ''; |
||||
|
switch (item.jump_type) { |
||||
// if(index == 2) { |
case 0: |
||||
// for (let i = 0; i < 2; i++) { |
break; |
||||
// this.sessionList[i].isChecked = this.sessionList[2].isChecked |
case 2: |
||||
// } |
uni.navigateTo({ |
||||
// }else { |
url: item.tdata |
||||
// if(this.sessionList[0].isChecked && this.sessionList[1].isChecked) { |
}); |
||||
// this.sessionList[2].isChecked = true |
break; |
||||
// }else { |
case 3: |
||||
// this.sessionList[2].isChecked = false |
uni.navigateTo({ |
||||
// } |
url: '/subPackages/webPage/webPage?url=' + item.tdata |
||||
// } |
}); |
||||
|
break; |
||||
let url = this.typeIndex ? '/api/Merchants/updateGuideSched' : '/api/Merchants/updateGuideSchedService' |
case 4: |
||||
|
uni.navigateToMiniProgram({ |
||||
this.Post({ |
appId: item.tdata.appid, // 此为appid |
||||
date: this.selectDay, |
path: item.tdata.page, // 此为首页路径 |
||||
online_type: item.isChecked ? 1 : 0, // 开关 |
envVersion: 'release', |
||||
date_half: this.typeIndex ? '' : index + 1, // 导游服务 1上午 2下午 3全天 |
success: res => { |
||||
classify: this.typeIndex ? 2 : '' // 1拼团,2线路 |
// 打开成功 |
||||
}, url).then(res => { |
console.log('打开成功', res); |
||||
|
}, |
||||
}) |
fail: err => { |
||||
}, |
console.log(err); |
||||
getDate(date) { |
} |
||||
console.log('传递过来的日期',date) |
}); |
||||
this.selectDay = date |
break; |
||||
|
default: |
||||
this.sessionList.forEach(item => item.isChecked = false) |
break; |
||||
this.sessionLists[0].isChecked = false |
|
||||
|
|
||||
this.getList() |
|
||||
}, |
|
||||
changeWork(date) { |
|
||||
// // 导游服务值班状态 date_half:分类(1上午,2下午,3全天) |
|
||||
// this.Post({ |
|
||||
// date: date, |
|
||||
// date_half |
|
||||
// },'/api/Merchants/updateGuideSchedService').then(res => { |
|
||||
|
|
||||
// }) |
|
||||
}, |
|
||||
getList() { |
|
||||
// 获取排班列表 classify:分类(1拼团,2线路,3导游服务) |
|
||||
this.Post({ |
|
||||
start_date: this.selectDay, |
|
||||
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 { |
|
||||
// 导游 |
|
||||
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 |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
// 获取当前日期 |
|
||||
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; |
|
||||
}, |
}, |
||||
} |
} |
||||
} |
} |
||||
</script> |
</script> |
||||
|
|
||||
<style lang="scss" scoped> |
<style lang="scss" scoped> |
||||
.content { |
.bg { |
||||
background: #FFFFFF; |
|
||||
min-height: 100vh; |
min-height: 100vh; |
||||
padding: 40rpx 26rpx 200rpx; |
background: url('https://static.ticket.sz-trip.com/tourist/index/topBg.png') no-repeat; |
||||
|
background-size: 100% auto; |
||||
|
background-color: #F9F5F0; |
||||
|
padding-bottom: 150rpx; |
||||
} |
} |
||||
|
|
||||
.topImg { |
.search-box { |
||||
width: 299.33rpx; |
padding: 20rpx 26.67rpx; |
||||
height: 70rpx; |
|
||||
display: flex; |
.search { |
||||
margin: auto; |
width: 573rpx; |
||||
|
height: 60rpx; |
||||
|
background: rgba(255, 255, 255, .7); |
||||
|
border: 1px solid #96684F; |
||||
|
padding: 0 29rpx; |
||||
|
font-weight: 500; |
||||
|
font-size: 28rpx; |
||||
|
color: #666666; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
|
||||
|
.search-img { |
||||
|
width: 29.33rpx; |
||||
|
height: 29.33rpx; |
||||
|
margin-right: 20rpx; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.kefu { |
||||
|
font-weight: 500; |
||||
|
font-size: 27rpx; |
||||
|
color: #96684F; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
|
||||
|
.kefu-img { |
||||
|
width: 33.33rpx; |
||||
|
height: 33.33rpx; |
||||
|
margin-right: 7rpx; |
||||
|
} |
||||
|
} |
||||
} |
} |
||||
|
|
||||
.title { |
.top-banner { |
||||
font-weight: bold; |
width: 697rpx; |
||||
font-size: 35rpx; |
height: 341rpx; |
||||
color: #000000; |
margin: auto; |
||||
margin: 68rpx 0 34rpx; |
|
||||
} |
} |
||||
|
|
||||
.nav-item { |
.title-box { |
||||
font-weight: 500; |
margin: 47rpx 26.67rpx 0; |
||||
font-size: 32rpx; |
|
||||
color: #000000; |
.title-img { |
||||
width: 338rpx; |
width: 248rpx; |
||||
height: 118rpx; |
height: 77.33rpx; |
||||
background: #F5F5F5; |
} |
||||
border-radius: 20rpx; |
|
||||
padding: 0 15rpx; |
.title-btn { |
||||
|
width: 140rpx; |
||||
image { |
height: 47rpx; |
||||
width: 80.67rpx; |
border-radius: 7rpx; |
||||
height: 80.67rpx; |
border: 1px solid #BFBFBF; |
||||
|
font-weight: 500; |
||||
|
font-size: 24rpx; |
||||
|
color: #333333; |
||||
|
|
||||
|
.rightIcon { |
||||
|
width: 11.33rpx; |
||||
|
height: 20rpx; |
||||
|
} |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
.type-box { |
.type-box { |
||||
display: flex; |
display: flex; |
||||
|
padding: 34rpx 26.67rpx 29rpx; |
||||
|
overflow-x: auto; |
||||
|
|
||||
.type-item { |
.type-item { |
||||
margin-right: 44rpx; |
width: 166.67rpx; |
||||
|
line-height: 53.33rpx; |
||||
|
text-align: center; |
||||
|
background-image: url('https://static.ticket.sz-trip.com/tourist/index/typeBg.png'); |
||||
|
background-size: 100% 100%; |
||||
font-weight: 500; |
font-weight: 500; |
||||
font-size: 32rpx; |
font-size: 29rpx; |
||||
color: #000000; |
color: #96684F; |
||||
|
margin-right: 10rpx; |
||||
} |
} |
||||
|
|
||||
.type-active { |
.type-active { |
||||
color: #96684F; |
background-image: url('https://static.ticket.sz-trip.com/tourist/index/typeBgs.png'); |
||||
|
background-size: 100% 100%; |
||||
|
color: #F9F5F0; |
||||
} |
} |
||||
|
} |
||||
|
.type-box::-webkit-scrollbar { |
||||
|
display: none; |
||||
|
} |
||||
|
|
||||
|
.tour-box { |
||||
|
overflow-x: auto; |
||||
|
padding-left: 26.67rpx; |
||||
|
display: flex; |
||||
|
|
||||
.type-line { |
.tour-item { |
||||
width: 117rpx; |
background-image: url('https://static.ticket.sz-trip.com/tourist/index/tourBg.png'); |
||||
height: 6rpx; |
background-size: 100% 100%; |
||||
background: #96684F; |
margin-right: 20rpx; |
||||
border-radius: 3rpx; |
position: relative; |
||||
margin: 4rpx auto 0; |
width: 266.73rpx; |
||||
|
height: 333.4rpx; |
||||
|
padding: 6rpx; |
||||
|
|
||||
|
.tour-img { |
||||
|
width: 253rpx; |
||||
|
height: 320rpx; |
||||
|
} |
||||
|
|
||||
|
.playImg { |
||||
|
width: 40rpx; |
||||
|
height: 40rpx; |
||||
|
position: absolute; |
||||
|
top: 0; |
||||
|
bottom: 0; |
||||
|
left: 0; |
||||
|
right: 0; |
||||
|
margin: auto; |
||||
|
} |
||||
|
|
||||
|
.time { |
||||
|
position: absolute; |
||||
|
font-weight: 500; |
||||
|
font-size: 28rpx; |
||||
|
color: #FFFFFF; |
||||
|
right: 19rpx; |
||||
|
bottom: 30rpx; |
||||
|
} |
||||
} |
} |
||||
} |
} |
||||
|
.tour-box::-webkit-scrollbar { |
||||
|
display: none; |
||||
|
} |
||||
|
|
||||
.session-item { |
.line-box { |
||||
width: 697rpx; |
display: flex; |
||||
height: 93rpx; |
flex-direction: column; |
||||
background: #F5F5F5; |
justify-content: space-between; |
||||
border-radius: 47rpx; |
flex-wrap: wrap; |
||||
margin: 28rpx auto 0; |
overflow-x: auto; |
||||
font-family: PingFang SC; |
height: 820rpx; |
||||
font-weight: 500; |
margin: 26rpx 0 0 26.67rpx; |
||||
font-size: 32rpx; |
|
||||
color: #000000; |
.line-item { |
||||
padding: 0 28rpx; |
width: 467rpx; |
||||
|
height: 400rpx; |
||||
|
border: 1rpx solid #96684F; |
||||
|
margin-right: 13rpx; |
||||
|
padding: 22rpx; |
||||
|
|
||||
|
.line-img { |
||||
|
width: 423rpx; |
||||
|
height: 233rpx; |
||||
|
} |
||||
|
|
||||
|
.line-content { |
||||
|
height: 120rpx; |
||||
|
display: flex; |
||||
|
flex-direction: column; |
||||
|
justify-content: space-between; |
||||
|
|
||||
|
.line-title { |
||||
|
font-weight: bold; |
||||
|
font-size: 28rpx; |
||||
|
color: #333333; |
||||
|
line-height: 36rpx; |
||||
|
} |
||||
|
|
||||
|
.line-price { |
||||
|
font-weight: bold; |
||||
|
font-size: 29rpx; |
||||
|
color: #DC2525; |
||||
|
} |
||||
|
.line-price::before { |
||||
|
font-size: 23rpx; |
||||
|
content: '¥'; |
||||
|
} |
||||
|
.line-price::after { |
||||
|
font-size: 23rpx; |
||||
|
content: '起'; |
||||
|
color: rgba(153, 153, 153, 1); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
.line-box::-webkit-scrollbar { |
||||
|
display: none; |
||||
} |
} |
||||
</style> |
</style> |
@ -1,462 +0,0 @@ |
|||||
<template> |
|
||||
<view class="content"> |
|
||||
<view class="common-box"> |
|
||||
<view class="common-types"> |
|
||||
<view @click="setType(0)" :class="['common-type',type==0?'active':'']">扫码核销</view> |
|
||||
<view @click="setType(1)" :class="['common-type',type==1?'active':'']">核销码核销</view> |
|
||||
<view @click="setType(2)" :class="['common-type',type==2?'active':'']">手机号核销</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
<view class="content-area flex-1 h-1rpx"> |
|
||||
<view class="type0-container" v-show="type==0"> |
|
||||
<image src="https://static.ticket.sz-trip.com/uploads/20241107/3480f83dd4b5346e04ad184f61cc848a.png"></image> |
|
||||
<view @click="scanCode">点击扫码核销</view> |
|
||||
</view> |
|
||||
<view class="type1-container" v-show="type==1"> |
|
||||
<view class="flex flex-items-center"> |
|
||||
<view class="hexiao-text">输入核销码</view> |
|
||||
<input v-model="HXCode" class="hexiao-code" placeholder="请输入内容" /> |
|
||||
</view> |
|
||||
<view class="hexiao-btn" @click="verifyByCode">立即核销</view> |
|
||||
</view> |
|
||||
<view class="type1-container" v-show="type==2"> |
|
||||
<view v-if="orderList.length<=0"> |
|
||||
<view class="flex flex-items-center"> |
|
||||
<view class="hexiao-text">输入手机号</view> |
|
||||
<input v-model="HXPhone" class="hexiao-code" placeholder="请输入内容" /> |
|
||||
</view> |
|
||||
<view class="tips"> |
|
||||
<view>注:仅支持查询当日订单 </view> |
|
||||
<view>支持手机号模糊搜索(不少于4位)</view> |
|
||||
</view> |
|
||||
<view class="hexiao-btn" style="margin-top: 100rpx;" @click="searchByPhone">查询</view> |
|
||||
</view> |
|
||||
|
|
||||
<view class="order-list" v-else> |
|
||||
<view class="order-item"> |
|
||||
<view class="title">订单详情</view> |
|
||||
<view class="flex"> |
|
||||
<view class="label">下单日期:</view> |
|
||||
<view class="text">2024-11-21</view> |
|
||||
</view> |
|
||||
<view class="flex"> |
|
||||
<view class="label">订单号:</view> |
|
||||
<view class="text">2024-11-21</view> |
|
||||
</view> |
|
||||
<view class="flex"> |
|
||||
<view class="label">订单名称:</view> |
|
||||
<view class="text">订单名称订单名称订单名称订单名称 订单名称订单名称订单名称订单名称</view> |
|
||||
</view> |
|
||||
<view class="flex"> |
|
||||
<view class="label">数量:</view> |
|
||||
<view class="text">2024-11-21</view> |
|
||||
</view> |
|
||||
<view class="flex"> |
|
||||
<view class="label">订单状态:</view> |
|
||||
<view class="text">2024-11-21</view> |
|
||||
</view> |
|
||||
<view class="flex"> |
|
||||
<view class="label">时段:</view> |
|
||||
<view class="text">2024-11-21</view> |
|
||||
</view> |
|
||||
<view class="flex"> |
|
||||
<view class="label">出行人:</view> |
|
||||
<view class="text">2024-11-21</view> |
|
||||
</view> |
|
||||
<view class="flex"> |
|
||||
<view class="label">出行人手机号:</view> |
|
||||
<view class="text">2024-11-21</view> |
|
||||
</view> |
|
||||
<view class="flex"> |
|
||||
<view class="label">出行人身份证:</view> |
|
||||
<view class="text">2024-11-21</view> |
|
||||
</view> |
|
||||
|
|
||||
<view class="hexiao-btn" @click="verifyByPhone">核销</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
<!-- 核销弹窗 --> |
|
||||
<uni-popup ref="popup" type="center" style="width: 100%;"> |
|
||||
<view class="pop-order-detail order-item"> |
|
||||
<view class="title flex-shrink-0">确认是否核销</view> |
|
||||
<view class="pop-order-content flex-1 h-1rpx"> |
|
||||
<view class="flex"> |
|
||||
<view class="label">下单日期:</view> |
|
||||
<view class="text">2024-11-21</view> |
|
||||
</view> |
|
||||
<view class="flex"> |
|
||||
<view class="label">订单号:</view> |
|
||||
<view class="text">2024-11-21</view> |
|
||||
</view> |
|
||||
<view class="flex"> |
|
||||
<view class="label">订单名称:</view> |
|
||||
<view class="text"> 订单名称</view> |
|
||||
</view> |
|
||||
<view class="flex"> |
|
||||
<view class="label">数量:</view> |
|
||||
<view class="text">2024-11-21</view> |
|
||||
</view> |
|
||||
<view class="flex"> |
|
||||
<view class="label">订单状态:</view> |
|
||||
<view class="text">2024-11-21</view> |
|
||||
</view> |
|
||||
<view class="flex"> |
|
||||
<view class="label">时段:</view> |
|
||||
<view class="text">2024-11-21</view> |
|
||||
</view> |
|
||||
<view class="flex"> |
|
||||
<view class="label">出行人:</view> |
|
||||
<view class="text">2024-11-21</view> |
|
||||
</view> |
|
||||
<view class="flex"> |
|
||||
<view class="label">出行人手机号:</view> |
|
||||
<view class="text">2024-11-21</view> |
|
||||
</view> |
|
||||
<view class="flex"> |
|
||||
<view class="label">出行人身份证:</view> |
|
||||
<view class="text">2024-11-21</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
<view class="bottom-btn"> |
|
||||
<view class="hexiao-btn" @click="confirmVerify">核销</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</uni-popup> |
|
||||
|
|
||||
</view> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
// import wxsdk from 'weixin-js-sdk' |
|
||||
// todo扫码 微信内H5扫码 |
|
||||
// https://ask.dcloud.net.cn/article/35380 |
|
||||
export default { |
|
||||
data() { |
|
||||
return { |
|
||||
type: 0, |
|
||||
HXCode: '', // 核销码 |
|
||||
HXPhone:"", |
|
||||
orderList: [], |
|
||||
}; |
|
||||
}, |
|
||||
onShow() { |
|
||||
}, |
|
||||
async onLoad() { |
|
||||
await this.initWXSKD() |
|
||||
}, |
|
||||
methods: { |
|
||||
async initWXSKD () { |
|
||||
try { |
|
||||
if (window.navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == "micromessenger") { |
|
||||
let that = this |
|
||||
let res = await this.Post({ |
|
||||
web_url: encodeURIComponent(window.location.href.split('#')[0]), |
|
||||
apis: 'scanQRCode' |
|
||||
}, '/api/wx/jsSdk') |
|
||||
|
|
||||
if (res) { |
|
||||
let data = res.jssdk |
|
||||
//初始化微信功能 |
|
||||
wxsdk.config({ |
|
||||
debug: false, |
|
||||
appId: data.appId, |
|
||||
timestamp: data.timestamp, |
|
||||
nonceStr: data.nonceStr, |
|
||||
signature: data.signature,// + "asdfasdf",//测试获取地理位置失败 |
|
||||
jsApiList: ['scanQRCode'] |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
} catch (e) {} |
|
||||
}, |
|
||||
// 调起微信扫码 |
|
||||
scanCode () { |
|
||||
let _this = this |
|
||||
uni.showLoading() |
|
||||
wxsdk.scanQRCode({ |
|
||||
needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果, |
|
||||
scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码,默认二者都有 |
|
||||
success: function (res) { |
|
||||
uni.hideLoading() |
|
||||
alert(res.resultStr.split('?')[1].split('=')[1]) |
|
||||
// _this.getOrderByCode(res.resultStr.split('?')[1].split('=')[1]) |
|
||||
}, |
|
||||
fail: function (error) { |
|
||||
uni.hideLoading() |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
|
|
||||
|
|
||||
setType (type) { |
|
||||
this.type = type |
|
||||
}, |
|
||||
// 微信扫码获取订单详情 |
|
||||
getOrderByCode (code) { |
|
||||
this.Post({ |
|
||||
|
|
||||
}, '/api/wx/jsSdk') |
|
||||
}, |
|
||||
// 核销码核销 |
|
||||
verifyByCode () { |
|
||||
this.$refs.popup.open() |
|
||||
}, |
|
||||
confirmVerify () { |
|
||||
|
|
||||
}, |
|
||||
|
|
||||
// 手机搜索核销单 |
|
||||
searchByPhone () { |
|
||||
if (this.HXPhone == '') { |
|
||||
this.$toast('请输入手机号') |
|
||||
return |
|
||||
} else if (this.HXPhone.length < 4) { |
|
||||
this.$toast('查询手机号最低4位') |
|
||||
return |
|
||||
} |
|
||||
// this.Post({ |
|
||||
// mobile: this.HXPhone |
|
||||
// }, '/api/wx/jsSdk').then(res=>{ |
|
||||
|
|
||||
// }) |
|
||||
this.orderList = [{}] |
|
||||
}, |
|
||||
// 手机号核销 |
|
||||
verifyByPhone () { |
|
||||
let _this = this |
|
||||
uni.showModal({ |
|
||||
title: '', |
|
||||
content: '确认是否核销此订单', |
|
||||
confirmColor: '#96684F', |
|
||||
success: function (res) { |
|
||||
if (res.confirm) { |
|
||||
|
|
||||
// todo |
|
||||
uni.showToast({title:'核销成功'}) |
|
||||
_this.orderList = [] |
|
||||
} |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
}, |
|
||||
|
|
||||
getInfo() { |
|
||||
this.Post({ |
|
||||
scenic_id: this.scenicId, |
|
||||
goods_id: this.goodsId, |
|
||||
offset: this.list.length, |
|
||||
limit: 10 |
|
||||
}, '/api/scenic/getGoodsCommentByScenicId').then(res => { |
|
||||
if (res) { |
|
||||
this.list = [...this.list, ...res.data] |
|
||||
this.list.forEach(item => { |
|
||||
item.close = false |
|
||||
item.needShowExpande = false |
|
||||
}) |
|
||||
console.log('添加close的list',this.list); |
|
||||
if (res.data.length < 10) { |
|
||||
this.finished = true |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
|
|
||||
}, |
|
||||
|
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style lang="scss" scoped> |
|
||||
*{ |
|
||||
box-sizing: border-box; |
|
||||
} |
|
||||
.content { |
|
||||
height: calc(100vh - 44px - 50px); |
|
||||
overflow-x: hidden; |
|
||||
position: relative; |
|
||||
display: flex; |
|
||||
flex-direction: column; |
|
||||
} |
|
||||
|
|
||||
.common-box { |
|
||||
height: 106rpx; |
|
||||
width: 100%; |
|
||||
flex-shrink: 0; |
|
||||
|
|
||||
.common-types { |
|
||||
width: 100%; |
|
||||
background: white; |
|
||||
height: 106rpx; |
|
||||
font-size: 31rpx; |
|
||||
z-index: 10; |
|
||||
color: #010101; |
|
||||
font-weight: bold; |
|
||||
overflow: hidden; |
|
||||
padding: 0 88rpx; |
|
||||
display: flex; |
|
||||
justify-content: space-between; |
|
||||
} |
|
||||
|
|
||||
.common-type { |
|
||||
flex-shrink: 0; |
|
||||
line-height: 106rpx; |
|
||||
height: 106rpx; |
|
||||
position: relative; |
|
||||
width: 150rpx; |
|
||||
text-align: center; |
|
||||
} |
|
||||
|
|
||||
.common-type.active:after { |
|
||||
display: block; |
|
||||
width: 50%; |
|
||||
font-size: 0; |
|
||||
content: '1'; |
|
||||
margin: auto; |
|
||||
position: absolute; |
|
||||
left: 0; |
|
||||
right: 0; |
|
||||
bottom: 1rpx; |
|
||||
height: 6rpx; |
|
||||
background: #96684F; |
|
||||
border-radius: 6rpx; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.content-area{ |
|
||||
overflow-y: auto; |
|
||||
overflow-x: hidden; |
|
||||
} |
|
||||
|
|
||||
.type0-container{ |
|
||||
padding: 185rpx 0 0 0; |
|
||||
display: flex; |
|
||||
flex-direction: column; |
|
||||
align-items: center; |
|
||||
justify-content: center; |
|
||||
font-weight: 500; |
|
||||
font-size: 32rpx; |
|
||||
color: #707070; |
|
||||
image{ |
|
||||
width: 176.67rpx; |
|
||||
height: 176.67rpx; |
|
||||
display: block; |
|
||||
margin-bottom: 25rpx; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.type1-container{ |
|
||||
padding: 39rpx 26rpx; |
|
||||
.hexiao-text{ |
|
||||
font-weight: 500; |
|
||||
font-size: 28rpx; |
|
||||
color: #000000; |
|
||||
} |
|
||||
.hexiao-code{ |
|
||||
margin-left: 22rpx; |
|
||||
width: 537rpx; |
|
||||
height: 107rpx; |
|
||||
border-radius: 7rpx; |
|
||||
border: 1px solid #666666; |
|
||||
font-size: 28rpx; |
|
||||
line-height: 107rpx; |
|
||||
padding: 0 27rpx; |
|
||||
} |
|
||||
.hexiao-btn{ |
|
||||
width: 307rpx; |
|
||||
height: 80rpx; |
|
||||
background: #96684F; |
|
||||
border-radius: 40rpx; |
|
||||
font-weight: 500; |
|
||||
font-size: 36rpx; |
|
||||
color: #FFFFFF; |
|
||||
line-height: 80rpx; |
|
||||
text-align: center; |
|
||||
display: block; |
|
||||
margin: 174rpx auto 0; |
|
||||
} |
|
||||
|
|
||||
.tips{ |
|
||||
padding: 20rpx 0 0 180rpx; |
|
||||
font-family: PingFang SC; |
|
||||
font-weight: 500; |
|
||||
font-size: 24rpx; |
|
||||
color: #999999; |
|
||||
line-height: 40rpx; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.order-item{ |
|
||||
width: 100%; |
|
||||
background: #FFFFFF; |
|
||||
border-radius: 13rpx; |
|
||||
padding: 30rpx; |
|
||||
font-weight: 500; |
|
||||
font-size: 28rpx; |
|
||||
color: #000000; |
|
||||
&>view{ |
|
||||
margin-bottom: 26rpx; |
|
||||
} |
|
||||
.title{ |
|
||||
font-size: 32rpx; |
|
||||
text-align: center; |
|
||||
} |
|
||||
|
|
||||
.label{ |
|
||||
width: 200rpx; |
|
||||
flex-shrink: 0; |
|
||||
} |
|
||||
.text{ |
|
||||
flex: 1; |
|
||||
width: 1rpx; |
|
||||
color: #646464;; |
|
||||
} |
|
||||
|
|
||||
.hexiao-btn{ |
|
||||
margin: 0; |
|
||||
margin-left: auto; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.pop-order-detail{ |
|
||||
width: 640rpx; |
|
||||
height: 800rpx; |
|
||||
background: #FFFFFF; |
|
||||
border-radius: 13rpx; |
|
||||
display: flex; |
|
||||
flex-direction: column; |
|
||||
overflow: hidden; |
|
||||
.pop-order-content{ |
|
||||
overflow-x: hidden; |
|
||||
overflow-y: auto; |
|
||||
&>view{ |
|
||||
margin-bottom: 12rpx; |
|
||||
} |
|
||||
} |
|
||||
.bottom-btn{ |
|
||||
display: flex; |
|
||||
width: 100%; |
|
||||
padding: 20rpx 0 0; |
|
||||
align-items: center; |
|
||||
justify-content: space-between; |
|
||||
margin: 0; |
|
||||
} |
|
||||
.hexiao-btn{ |
|
||||
width: 160rpx; |
|
||||
height: 60rpx; |
|
||||
background: #96684F; |
|
||||
border-radius: 30rpx; |
|
||||
font-weight: 500; |
|
||||
font-size: 24rpx; |
|
||||
color: #FFFFFF; |
|
||||
line-height: 60rpx; |
|
||||
text-align: center; |
|
||||
display: block; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
</style> |
|
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 11 KiB |
@ -0,0 +1,493 @@ |
|||||
|
<template> |
||||
|
<view class="bg"> |
||||
|
<view class="kefu-box"> |
||||
|
<image src="https://static.ticket.sz-trip.com/tourist/daoyou/kefu.png" class="kefu-img"></image> |
||||
|
客服 |
||||
|
</view> |
||||
|
|
||||
|
<view class="top-box"> |
||||
|
<view class="daoyou-detail"> |
||||
|
<swiper class="daoyou-imgs" :circular="true" :interval="6000" :current="current" @change="swiperChange" |
||||
|
:duration="800" :indicator-dots="false" :autoplay="true" v-if="dyImgs"> |
||||
|
<swiper-item v-for="(item, index) in dyImgs" :key="index"> |
||||
|
<image class="daoyou-img" :src="showImg(item.head_img)" mode="aspectFill"></image> |
||||
|
|
||||
|
<image src="https://static.ticket.sz-trip.com/tourist/daoyou/play.png" class="daoyou-play"></image> |
||||
|
</swiper-item> |
||||
|
</swiper> |
||||
|
|
||||
|
<view class="swiper-nums"> |
||||
|
<view :class="['swiper-num', {'swiper-active': item == current + 1}]" v-for="item in dyImgs.length" :key="item"></view> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<view class="top-content flex-column"> |
||||
|
<view class="top-title text-overflow"> |
||||
|
{{detail.name}} |
||||
|
<view>{{detail.level}}</view> |
||||
|
</view> |
||||
|
<view class="top-tags text-overflow"> |
||||
|
<view>{{detail.year}}</view> |
||||
|
<view>{{detail.language}}</view> |
||||
|
</view> |
||||
|
<view class="top-subtitle text-overflow">{{detail.scenic}}</view> |
||||
|
<view class="top-subtitle text-overflow">{{detail.title}}</view> |
||||
|
<view class="top-subtitle text-overflow">{{detail.subtitle}}</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<!-- 日历 --> |
||||
|
<view class="calendar"> |
||||
|
<view class="calendar-top"> |
||||
|
<view @click="preNextDate(0)"> |
||||
|
<img src="https://static.ticket.sz-trip.com/tourist/daoyou/left.png" class="iconfont"/> |
||||
|
</view> |
||||
|
<view>{{year}}年{{month}}月</view> |
||||
|
<view @click="preNextDate(1)"> |
||||
|
<img src="https://static.ticket.sz-trip.com/tourist/daoyou/right.png" class="iconfont"/> |
||||
|
</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' : ''"> |
||||
|
<view :class="['day-item', selectDay == item.date ? 'daySelect' : '']" |
||||
|
@click="changeDate(item.date)"> |
||||
|
{{ nowDay== item.date ? '今日' : item.day }} |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
|
||||
|
<!-- 规格 --> |
||||
|
<view class="sku-box"> |
||||
|
<view class="sku-item flex-between" v-for="(item,index) in sku" :key="index"> |
||||
|
<view> |
||||
|
<view class="sku-title">{{item.title}}</view> |
||||
|
<view class="sku-subtitle">提前沟通讲解内容</view> |
||||
|
</view> |
||||
|
<view class="sku-price">{{item.price}}</view> |
||||
|
<view class="sku-btn">预订</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
current: 0, |
||||
|
dyImgs: [ |
||||
|
{ |
||||
|
head_img: 'https://static.ticket.sz-trip.com/uploads/20241126/50d406ead15c861f76b8df7dab401802.png' |
||||
|
}, |
||||
|
{ |
||||
|
head_img: 'https://static.ticket.sz-trip.com/uploads/20241126/50d406ead15c861f76b8df7dab401802.png' |
||||
|
} |
||||
|
], |
||||
|
detail: { |
||||
|
name: '导游姓名', |
||||
|
level: '大师级', |
||||
|
year: '从业10年', |
||||
|
language: '英语专八、俄语二级', |
||||
|
scenic: '擅长拙政园、寒山寺、西门町等景区', |
||||
|
title: '主卖点主卖点', |
||||
|
subtitle: '个性签名个性签名个性签名个性签名' |
||||
|
}, |
||||
|
|
||||
|
// 日历 |
||||
|
weekList: ['日', '一', '二', '三', '四', '五', '六'], |
||||
|
year: 0, |
||||
|
month: 0, |
||||
|
day: 0, |
||||
|
week: '', |
||||
|
nowDay: '', |
||||
|
selectDay: '', |
||||
|
everyDay: [], |
||||
|
|
||||
|
sku: [ |
||||
|
{ |
||||
|
title: '上午场 09:30-12:00', |
||||
|
price: '200' |
||||
|
}, |
||||
|
{ |
||||
|
title: '下午场 09:30-12:00', |
||||
|
price: '200' |
||||
|
}, |
||||
|
{ |
||||
|
title: '全天', |
||||
|
price: '200' |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
}, |
||||
|
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.getEveryDay(this.year + '/' + this.month + '/' + 1) |
||||
|
}, |
||||
|
methods: { |
||||
|
//轮播图左右滑动 |
||||
|
swiperChange(e) { |
||||
|
this.current = e.detail.current; |
||||
|
}, |
||||
|
// 获取当前日期 |
||||
|
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); |
||||
|
//设置一个月的某一天-这里设置为零则取到的日期中的天就会是当月的最后一天(比如,二月份就是28或29,其他月份就是30或31),方便下边的循环 |
||||
|
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: '' |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
// 切换上一周月、下一周月 |
||||
|
preNextDate(e) { |
||||
|
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); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.bg { |
||||
|
padding: 30rpx 26.67rpx 100rpx; |
||||
|
min-height: 100vh; |
||||
|
background: #F9F5F0; |
||||
|
} |
||||
|
|
||||
|
.kefu-box { |
||||
|
font-weight: 500; |
||||
|
font-size: 27rpx; |
||||
|
color: #96684F; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
display: flex; |
||||
|
justify-content: flex-end; |
||||
|
|
||||
|
.kefu-img { |
||||
|
width: 33.33rpx; |
||||
|
height: 33.33rpx; |
||||
|
margin-right: 7rpx; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.top-box { |
||||
|
height: 313rpx; |
||||
|
background: #FFFFFF; |
||||
|
border-radius: 7rpx; |
||||
|
position: relative; |
||||
|
margin-top: 18rpx; |
||||
|
padding-left: 300rpx; |
||||
|
|
||||
|
.daoyou-detail { |
||||
|
width: 265rpx; |
||||
|
position: absolute; |
||||
|
top: -53rpx; |
||||
|
left: 13rpx; |
||||
|
|
||||
|
.daoyou-imgs { |
||||
|
width: 265rpx; |
||||
|
height: 332rpx; |
||||
|
background-image: url('https://static.ticket.sz-trip.com/tourist/daoyou/dyImgBg.png'); |
||||
|
background-size: 100% 100%; |
||||
|
padding: 6rpx; |
||||
|
box-sizing: border-box; |
||||
|
position: relative; |
||||
|
|
||||
|
.daoyou-img { |
||||
|
width: 253rpx; |
||||
|
height: 320rpx; |
||||
|
} |
||||
|
|
||||
|
.daoyou-play { |
||||
|
width: 49.33rpx; |
||||
|
height: 49.33rpx; |
||||
|
position: absolute; |
||||
|
top: 0; |
||||
|
bottom: 0; |
||||
|
left: 0; |
||||
|
right: 0; |
||||
|
margin: auto; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.swiper-nums { |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
margin-top: 10rpx; |
||||
|
|
||||
|
.swiper-num { |
||||
|
width: 9rpx; |
||||
|
height: 9rpx; |
||||
|
background: rgba(150, 104, 79, .3); |
||||
|
border-radius: 50%; |
||||
|
margin: 0 3rpx; |
||||
|
} |
||||
|
|
||||
|
.swiper-active { |
||||
|
background: #96684F; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.top-content { |
||||
|
width: 380rpx; |
||||
|
height: 313rpx; |
||||
|
padding: 25rpx 0 60rpx; |
||||
|
justify-content: space-between; |
||||
|
|
||||
|
.top-title { |
||||
|
font-weight: bold; |
||||
|
font-size: 31rpx; |
||||
|
color: #010101; |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
|
||||
|
view { |
||||
|
line-height: 30.67rpx; |
||||
|
margin-left: 5rpx; |
||||
|
background-image: url('https://static.ticket.sz-trip.com/tourist/daoyou/rankBg.png'); |
||||
|
background-size: 100% 100%; |
||||
|
padding: 0 8rpx; |
||||
|
font-weight: 500; |
||||
|
font-size: 23rpx; |
||||
|
color: #FFFFFF; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.top-tags { |
||||
|
display: flex; |
||||
|
font-weight: 500; |
||||
|
font-size: 24rpx; |
||||
|
color: #96684F; |
||||
|
|
||||
|
&>view:first-child::after { |
||||
|
content: '丨'; |
||||
|
display: inline-block; |
||||
|
margin: 0 5rpx; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.top-subtitle { |
||||
|
font-weight: 500; |
||||
|
font-size: 24rpx; |
||||
|
color: #888888; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.calendar { |
||||
|
height: 668rpx; |
||||
|
background: #FFFFFF; |
||||
|
border-radius: 13rpx; |
||||
|
margin-top: 28rpx; |
||||
|
|
||||
|
.calendar-top { |
||||
|
padding: 32rpx 0 60rpx; |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
|
align-items: center; |
||||
|
|
||||
|
view:nth-child(2) { |
||||
|
font-weight: bold; |
||||
|
font-size: 36rpx; |
||||
|
color: #010101; |
||||
|
margin: 0 50rpx; |
||||
|
} |
||||
|
|
||||
|
.iconfont { |
||||
|
width: 24rpx; |
||||
|
height: 24rpx; |
||||
|
display: block; |
||||
|
margin-top: 3rpx; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.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; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.sku-box { |
||||
|
border-radius: 13rpx; |
||||
|
background-color: #fff; |
||||
|
margin-top: 28rpx; |
||||
|
|
||||
|
.sku-item { |
||||
|
height: 132rpx; |
||||
|
} |
||||
|
.sku-item:nth-child(n+2) { |
||||
|
border-top: 1rpx solid #D8D8D8; |
||||
|
} |
||||
|
} |
||||
|
</style> |
@ -1,135 +0,0 @@ |
|||||
<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> |
|
@ -1,163 +0,0 @@ |
|||||
<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> |
|
@ -1,50 +0,0 @@ |
|||||
<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> |
|
@ -1,400 +0,0 @@ |
|||||
<template> |
|
||||
<view class="bg"> |
|
||||
|
|
||||
<view class="user-other-info"> |
|
||||
<!-- // 景区 --> |
|
||||
<view class="scenic-container" v-if="valueType=='scenic_ids'"> |
|
||||
<view class="userinfo-item" v-for="(item,i) in scenicIds" :key="i" @click="changeSelection(item)"> |
|
||||
<span>{{item.name}}</span> |
|
||||
<view v-if="item.value.length>0" class="text-overflow" >{{item.valueStr}}</view> |
|
||||
<view v-else class="empty-value" >请选择</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
<view class="lingo-container" v-else-if="valueType=='lingo_ids'"> |
|
||||
<view class="userinfo-item"> |
|
||||
<span>语言能力</span> |
|
||||
<view v-if="inputValueStr" class="text-overflow" >{{inputValueStr}}</view> |
|
||||
<view v-else class="empty-value" >请选择</view> |
|
||||
</view> |
|
||||
<view class="language-doc-container"> |
|
||||
<span>证明材料</span> |
|
||||
<view class="img-container"> |
|
||||
<image :src="file.img" class="doc-image" v-for="(file,i) in fileList" :key="i"></image> |
|
||||
|
|
||||
<view class="doc-image" @click="uploadImg"> |
|
||||
<!-- <image class="upload-image" src=""></image> --> |
|
||||
111 |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
<view class="nickname-box" v-else> |
|
||||
<input v-model="inputValue" type="text" placeholder="请输入内容" /> |
|
||||
</view> |
|
||||
|
|
||||
|
|
||||
<view class="btn-tao" @click="submit">保存</view> |
|
||||
</view> |
|
||||
|
|
||||
|
|
||||
<!-- 弹框 --> |
|
||||
<uni-popup ref="popup" type="bottom"> |
|
||||
<view class="popup-box"> |
|
||||
<view class="btn-top flex flex-between w-full"> |
|
||||
<view @click="$refs.popup.close()">取消</view> |
|
||||
<view @click="selectAll">全选</view> |
|
||||
</view> |
|
||||
<view class="popup-content"> |
|
||||
<view :class="['popup-item','flex-center',selection.value.includes(item.id)?'active':'']" |
|
||||
v-for="(item,index) in selection.arr" :key="index" @click="changeItemSelect(item)"> |
|
||||
{{item.name}} |
|
||||
|
|
||||
<uni-icons v-show="selection.value.includes(item.id)" class="active-img" type="checkmarkempty" size="23" color="#96684F"></uni-icons> |
|
||||
|
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
|
|
||||
<view class="popup-btns flex-center" @click="popSubmit"> |
|
||||
<view>确定</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</uni-popup> |
|
||||
</view> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import { mapState } from 'vuex' |
|
||||
import {pathToBase64} from "@/static/js/mmmm-image-tools/index.js" |
|
||||
export default { |
|
||||
data() { |
|
||||
return { |
|
||||
valueType: '', |
|
||||
inputValue: '', |
|
||||
inputValueStr: '', |
|
||||
keyNames: [ |
|
||||
{key: 'nickname', value:'姓名'},{key: 'mobile', value:'手机号'}, |
|
||||
{key: 'certificate_number', value: '导游证号码'}, |
|
||||
{key: 'duration',value: '工作年限'}, |
|
||||
{key: 'bio',value: '个性签名'}, |
|
||||
{key: 'scenic_ids',value: '擅长景区'}, |
|
||||
{key: 'lingo_ids',value: '语言能力'}, |
|
||||
], |
|
||||
lingoIds: [], |
|
||||
scenicIds: [], |
|
||||
|
|
||||
selectionItem: null, // 景点选中更改的值 |
|
||||
selection: {arr: [], value: [], valueStr: ''}, //弹窗值 |
|
||||
|
|
||||
fileList: [] |
|
||||
} |
|
||||
}, |
|
||||
onLoad(options) { |
|
||||
this.initData(options) |
|
||||
}, |
|
||||
|
|
||||
|
|
||||
methods: { |
|
||||
initData (options) { |
|
||||
uni.setNavigationBarTitle({title: ''}); |
|
||||
this.valueType = '' |
|
||||
this.inputValue = '' |
|
||||
this.inputValueStr = '' |
|
||||
if (options.valueType) { |
|
||||
this.valueType = options.valueType |
|
||||
let titleData = this.keyNames.find(v=>v.key == this.valueType) |
|
||||
if (titleData) { |
|
||||
uni.setNavigationBarTitle({title: titleData.value}); |
|
||||
} |
|
||||
if (this.valueType == 'lingo_ids') { |
|
||||
this.initLingoList() |
|
||||
} |
|
||||
if (this.valueType == 'scenic_ids') { |
|
||||
this.initScenicList() |
|
||||
} |
|
||||
|
|
||||
} else { |
|
||||
this.goBack() |
|
||||
return |
|
||||
} |
|
||||
if (options.inputValue && options.inputValue!='null' && options.inputValue!='undefined') { |
|
||||
this.inputValue = options.inputValue |
|
||||
} |
|
||||
|
|
||||
|
|
||||
}, |
|
||||
|
|
||||
async initLingoList() { |
|
||||
// 获取导游语言列表 |
|
||||
let res = await this.Post({},'/api/guide/getGuideLingoList').then(res =>{ |
|
||||
this.lingoIds = res.data |
|
||||
}) |
|
||||
this.lingoIds = (this.$store.state.user.lingoIds || []).map(v=>{ |
|
||||
return {...v, value: [], valueStr: ""} |
|
||||
}) |
|
||||
|
|
||||
}, |
|
||||
|
|
||||
async initScenicList() { |
|
||||
// 获取景区列表 |
|
||||
let res = await this.Post({},'/api/guide/getGuideScenicList') |
|
||||
let valueArr = [] |
|
||||
try { |
|
||||
valueArr = (this.inputValue || '').split(',').map(v=>{return Number(v)}) |
|
||||
} catch(e) {} |
|
||||
console.log(valueArr) |
|
||||
this.scenicIds = (res.data || []).map(v=>{ |
|
||||
let valueHave = v.arr.filter(x=>valueArr.includes(x.id)) |
|
||||
return {...v, value: valueHave.map(x=>x.id), valueStr: valueHave.map(x=>x.name).join(',')} |
|
||||
}) |
|
||||
}, |
|
||||
|
|
||||
changeSelection (item) { |
|
||||
this.selectionItem = item |
|
||||
this.selection = {arr: item.arr, value: JSON.parse(JSON.stringify(item.value)), valueStr: ''} |
|
||||
this.$refs.popup.open() |
|
||||
}, |
|
||||
// 单个选中 |
|
||||
changeItemSelect (item) { |
|
||||
let index = this.selection.value.findIndex(x=>x==item.id) |
|
||||
if (index>=0) { |
|
||||
this.selection.value.splice(index,1) |
|
||||
} else { |
|
||||
this.selection.value.push(item.id) |
|
||||
} |
|
||||
}, |
|
||||
selectAll() { |
|
||||
this.selection.value = this.selection.arr.map(x=>x.id) |
|
||||
}, |
|
||||
|
|
||||
popSubmit () { |
|
||||
let tempSelect = JSON.parse(JSON.stringify(this.selection)) |
|
||||
let valueHave = tempSelect.arr.filter(x=>tempSelect.value.includes(x.id)) |
|
||||
this.selectionItem.value = tempSelect.value |
|
||||
this.selectionItem.valueStr = valueHave.map(x=>x.name).join(',') |
|
||||
this.$refs.popup.close() |
|
||||
}, |
|
||||
|
|
||||
uploadImg() { |
|
||||
uni.chooseImage({ |
|
||||
success: (res) => { |
|
||||
for(let i =0 ;i<res.tempFilePaths.length;i++) { |
|
||||
let param = {img:res.tempFilePaths[i], tempFile:res.tempFiles[i] } |
|
||||
this.fileList.push(param) |
|
||||
} |
|
||||
console.log(this.fileList) |
|
||||
|
|
||||
}, |
|
||||
fail:()=> { |
|
||||
uni.showToast({ |
|
||||
title:'上传失败', |
|
||||
icon:'none' |
|
||||
}) |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
// 选择数据时的数据处理 |
|
||||
handleSubmitData() { |
|
||||
let data = [] |
|
||||
if (this.valueType == 'lingo_ids') { |
|
||||
data = this.lingoIds |
|
||||
} |
|
||||
if (this.valueType == 'scenic_ids') { |
|
||||
data = this.scenicIds |
|
||||
} |
|
||||
|
|
||||
let value = [] |
|
||||
data.forEach(v=>{ |
|
||||
if(Array.isArray(v.value) && v.value.length>0) { |
|
||||
value.push(v) |
|
||||
} |
|
||||
}) |
|
||||
|
|
||||
this.inputValue = value.map(v=>v.value.join(',')).join(',') |
|
||||
|
|
||||
this.inputValueStr = value.map(v=>v.valueStr).join(',') |
|
||||
console.log(this.inputValue,this.inputValueStr) |
|
||||
}, |
|
||||
|
|
||||
submit() { |
|
||||
this.handleSubmitData() |
|
||||
|
|
||||
uni.$emit("updateInfo", { |
|
||||
msgType: 'registerInfo', |
|
||||
data: { |
|
||||
valueType: this.valueType, |
|
||||
inputValue: this.inputValue, |
|
||||
inputValueStr: this.inputValueStr |
|
||||
} |
|
||||
}) |
|
||||
this.goBack() |
|
||||
}, |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style scoped lang="scss"> |
|
||||
view { |
|
||||
box-sizing: content-box; |
|
||||
} |
|
||||
.bg{ |
|
||||
min-height: 100vh; |
|
||||
overflow-x: hidden; |
|
||||
background: white; |
|
||||
padding-bottom: 50rpx; |
|
||||
} |
|
||||
|
|
||||
.empty-value{ |
|
||||
font-weight: 500; |
|
||||
font-size: 28rpx; |
|
||||
color: #999999; |
|
||||
} |
|
||||
|
|
||||
.nickname-box { |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
background: white; |
|
||||
margin-bottom: 100rpx; |
|
||||
font-size: 30rpx; |
|
||||
height: 70rpx; |
|
||||
border-bottom: 1rpx solid #D8D8D8; |
|
||||
span { |
|
||||
flex-shrink: 0; |
|
||||
} |
|
||||
input { |
|
||||
flex: 1; |
|
||||
font-size: 30rpx; |
|
||||
display: block; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
.user-other-info { |
|
||||
padding:30rpx; |
|
||||
} |
|
||||
|
|
||||
.userinfo-item { |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
font-size: 28rpx; |
|
||||
color: #333; |
|
||||
position: relative; |
|
||||
span{ |
|
||||
flex-shrink: 0; |
|
||||
width: 120rpx; |
|
||||
} |
|
||||
&>view{ |
|
||||
flex: 1; |
|
||||
padding: 40rpx 10rpx 40rpx 0; |
|
||||
margin-left: 30rpx; |
|
||||
border-bottom: 1px solid #D8D8D8; |
|
||||
} |
|
||||
} |
|
||||
.btn-tao { |
|
||||
width: 333rpx; |
|
||||
height: 80rpx; |
|
||||
background: #96684F; |
|
||||
border-radius: 40rpx; |
|
||||
text-align: center; |
|
||||
font-size: 30rpx; |
|
||||
line-height: 80rpx; |
|
||||
color: #FFFFFF; |
|
||||
margin: 68rpx auto 0; |
|
||||
} |
|
||||
|
|
||||
.popup-box { |
|
||||
border-radius: 0rpx; |
|
||||
background: #fff; |
|
||||
overflow: hidden; |
|
||||
.btn-top{ |
|
||||
padding: 26rpx 26rpx 0 26rpx; |
|
||||
color: #999999; |
|
||||
font-size: 31rpx; |
|
||||
box-sizing: border-box; |
|
||||
} |
|
||||
.popup-content{ |
|
||||
max-height: 900rpx; |
|
||||
width: 100%; |
|
||||
overflow-x: hidden; |
|
||||
overflow-y: auto; |
|
||||
} |
|
||||
|
|
||||
.popup-item { |
|
||||
width: 697rpx; |
|
||||
height: 99rpx; |
|
||||
font-weight: 500; |
|
||||
font-size: 31rpx; |
|
||||
color: #12293C; |
|
||||
margin: auto; |
|
||||
border-bottom: 1rpx solid #D8D8D8; |
|
||||
position: relative; |
|
||||
} |
|
||||
.popup-item.active{ |
|
||||
color: #96684F; |
|
||||
} |
|
||||
.popup-item:last-of-type { |
|
||||
border: none; |
|
||||
} |
|
||||
.active-img{ |
|
||||
position: absolute; |
|
||||
right: 10rpx; |
|
||||
|
|
||||
} |
|
||||
|
|
||||
.popup-btns { |
|
||||
width: 100%; |
|
||||
height: 153rpx; |
|
||||
background: #FFFFFF; |
|
||||
color: #12293C; |
|
||||
border-top: 13rpx solid #F2F2F2; |
|
||||
box-shadow: 0rpx 0rpx 13rpx 0rpx rgba(82,82,82,0.25); |
|
||||
padding: 40rpx 26rpx; |
|
||||
box-sizing: border-box; |
|
||||
view{ |
|
||||
box-sizing: border-box; |
|
||||
width: 100%; |
|
||||
height: 73.33rpx; |
|
||||
line-height: 73.33rpx; |
|
||||
background: #DC2525; |
|
||||
border-radius: 11rpx; |
|
||||
font-weight: bold; |
|
||||
font-size: 32rpx; |
|
||||
color: #FFFFFF; |
|
||||
text-align: center; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.language-doc-container{ |
|
||||
display: flex; |
|
||||
align-items: flex-start; |
|
||||
padding-top: 40rpx; |
|
||||
span{ |
|
||||
flex-shrink: 0; |
|
||||
width: 120rpx; |
|
||||
} |
|
||||
.img-container{ |
|
||||
flex:1; |
|
||||
flex-shrink: 0; |
|
||||
display: flex; |
|
||||
flex-wrap: wrap; |
|
||||
padding-left: 20rpx; |
|
||||
|
|
||||
.doc-image{ |
|
||||
width: 141rpx; |
|
||||
height: 151rpx; |
|
||||
border-radius: 13rpx; |
|
||||
margin: 0 20rpx 20rpx 0; |
|
||||
background: #F1F1F1; |
|
||||
} |
|
||||
|
|
||||
.upload-image{ |
|
||||
width: 43rpx; |
|
||||
height: 41rpx; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</style> |
|
@ -1,47 +0,0 @@ |
|||||
<template> |
|
||||
<view class="bg"> |
|
||||
<view class="box"> |
|
||||
<view class="title">导游信息审核通知</view> |
|
||||
<view class="subtitle">你的信息审核未通过,请修改后重新提交。</view> |
|
||||
<view class="subtitle">原因:你的信息审核未通过,请修改后重新提交你的信息审 核未通过,请修改后重新提交你的信息审核未通过,请修改 后重新提交你的信息</view> |
|
||||
<view class="time">2024-11-23</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
</script> |
|
||||
|
|
||||
<style lang="scss" scoped> |
|
||||
.bg { |
|
||||
background: #F5F5F5; |
|
||||
min-height: 100vh; |
|
||||
padding: 50rpx 26rpx; |
|
||||
} |
|
||||
|
|
||||
.box { |
|
||||
padding: 26rpx 20rpx; |
|
||||
background: #FFFFFF; |
|
||||
border-radius: 13rpx; |
|
||||
|
|
||||
.title { |
|
||||
font-weight: bold; |
|
||||
font-size: 32rpx; |
|
||||
color: #000000; |
|
||||
} |
|
||||
|
|
||||
.subtitle { |
|
||||
font-weight: 500; |
|
||||
font-size: 27rpx; |
|
||||
color: #000000; |
|
||||
margin-top: 20rpx; |
|
||||
} |
|
||||
|
|
||||
.time { |
|
||||
font-weight: 500; |
|
||||
font-size: 25rpx; |
|
||||
color: #717171; |
|
||||
margin-top: 20rpx; |
|
||||
} |
|
||||
} |
|
||||
</style> |
|
@ -1,67 +0,0 @@ |
|||||
<template> |
|
||||
<view class="bg"> |
|
||||
<view class="item" v-for="(item,index) in list" :key="index"> |
|
||||
<view class="title"> |
|
||||
{{item.title}} <span v-if="!item.isRead"></span> |
|
||||
</view> |
|
||||
<view class="time">{{item.time}}</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
export default { |
|
||||
data() { |
|
||||
return { |
|
||||
list: [ |
|
||||
{ |
|
||||
title: '导游信息审核通知', |
|
||||
time: '2024-11-23', |
|
||||
isRead: false |
|
||||
}, |
|
||||
{ |
|
||||
title: '导游信息审核通知', |
|
||||
time: '2024-11-23', |
|
||||
isRead: true |
|
||||
} |
|
||||
] |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style lang="scss" scoped> |
|
||||
.bg { |
|
||||
min-height: 100vh; |
|
||||
background: #F5F5F5; |
|
||||
padding-top: 50rpx; |
|
||||
} |
|
||||
|
|
||||
.item { |
|
||||
padding: 26rpx 20rpx 20rpx; |
|
||||
background: #FFFFFF; |
|
||||
border-radius: 13rpx; |
|
||||
width: 697rpx; |
|
||||
margin: 0 auto 21rpx; |
|
||||
|
|
||||
.title { |
|
||||
font-weight: 500; |
|
||||
font-size: 32rpx; |
|
||||
color: #000000; |
|
||||
|
|
||||
span { |
|
||||
width: 11rpx; |
|
||||
height: 11rpx; |
|
||||
background: #E5131B; |
|
||||
border-radius: 50%; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.time { |
|
||||
font-weight: 500; |
|
||||
font-size: 25rpx; |
|
||||
color: #717171; |
|
||||
margin-top: 22rpx; |
|
||||
} |
|
||||
} |
|
||||
</style> |
|
@ -1,490 +0,0 @@ |
|||||
<template> |
|
||||
<view class="bg"> |
|
||||
<view class="header-tip">请填写您的信息,稍后平台工作人员会电话联系您~</view> |
|
||||
|
|
||||
<view class="user-other-info"> |
|
||||
<view class="info-title">·基础信息</view> |
|
||||
<div class="info-avatar-top"> |
|
||||
<span>头像</span> |
|
||||
<view @click="uploadAvator()"> |
|
||||
<image v-if="info.avatar" :src="info.avatar" mode="aspectFill" |
|
||||
style="width: 80rpx;height: 80rpx;border-radius: 50%;"></image> |
|
||||
<div v-else style="width: 80rpx;height: 80rpx;border-radius: 50%;background: #0B898E;"></div> |
|
||||
</view> |
|
||||
</div> |
|
||||
<view class="userinfo-item" @click="changeValue('nickname')"> |
|
||||
<span>姓名</span> |
|
||||
<view class="text-overflow" v-if="info.nickname">{{info.nickname}}</view> |
|
||||
<view v-else class="empty-value" >请填写</view> |
|
||||
</view> |
|
||||
<view class="userinfo-item" @click="selectSex"> |
|
||||
<span>性别</span> |
|
||||
<view class="text-overflow" v-if="info.genderStr">{{info.genderStr}}</view> |
|
||||
<view v-else class="empty-value" >请选择</view> |
|
||||
</view> |
|
||||
<view class="userinfo-item" @click="changeValue('mobile')"> |
|
||||
<span>手机号</span> |
|
||||
<view v-if="info.mobile">{{info.mobile}}</view> |
|
||||
<view v-else class="empty-value" >请填写</view> |
|
||||
</view> |
|
||||
|
|
||||
<view class="info-title" style="margin-top: 46rpx;">·工作相关</view> |
|
||||
<view class="userinfo-item" @click="selectRank"> |
|
||||
<span>导游等级</span> |
|
||||
<view v-if="info.group_idStr">{{info.group_idStr}}</view> |
|
||||
<view v-else class="empty-value">请选择</view> |
|
||||
</view> |
|
||||
<view class="userinfo-item" @click="changeValue('certificate_number')"> |
|
||||
<span>导游证号</span> |
|
||||
<view class="text-overflow" v-if="info.certificate_number">{{info.certificate_number}}</view> |
|
||||
<view v-else class="empty-value">请填写</view> |
|
||||
</view> |
|
||||
<view class="userinfo-item" @click="changeValue('duration')"> |
|
||||
<span>工作年限</span> |
|
||||
<view class="text-overflow" v-if="info.duration">{{info.duration}}</view> |
|
||||
<view v-else class="empty-value">请填写</view> |
|
||||
</view> |
|
||||
<view class="userinfo-item" @click="changeValue('lingo_ids')"> |
|
||||
<span>语言能力</span> |
|
||||
<view class="text-overflow" v-if="info.lingo_idsStr">{{info.lingo_idsStr}}</view> |
|
||||
<view v-else class="empty-value">请选择</view> |
|
||||
</view> |
|
||||
<view class="userinfo-item" @click="changeValue('scenic_ids')"> |
|
||||
<span>擅长景区</span> |
|
||||
<view class="text-overflow" v-if="info.scenic_idsStr">{{info.scenic_idsStr}}</view> |
|
||||
<view v-else class="empty-value">请选择</view> |
|
||||
</view> |
|
||||
<view class="userinfo-item" @click="changeValue('bio')"> |
|
||||
<span>个性签名</span> |
|
||||
<view class="text-overflowRows" v-if="info.bio">{{info.bio}}</view> |
|
||||
<view v-else class="empty-value">请填写</view> |
|
||||
</view> |
|
||||
<view class="userinfo-item"> |
|
||||
<span>核心亮点</span> |
|
||||
<view class="text-overflow" v-if="info.bio">{{info.bio}}</view> |
|
||||
<view v-else class="empty-value">请填写</view> |
|
||||
</view> |
|
||||
|
|
||||
<view class="info-title" style="margin-top: 46rpx;">·讲解视频</view> |
|
||||
<view class="userinfo-item" @click="selectRank"> |
|
||||
<span>讲解视频</span> |
|
||||
<view class="text-overflow" v-if="info.rankStr">{{info.rankStr}}</view> |
|
||||
<view v-else class="empty-value">请选择</view> |
|
||||
</view> |
|
||||
|
|
||||
<view class="btn-tao" @click="submit">我已填好</view> |
|
||||
</view> |
|
||||
|
|
||||
</view> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import {pathToBase64} from "@/static/js/mmmm-image-tools/index.js" |
|
||||
export default { |
|
||||
data() { |
|
||||
|
|
||||
return { |
|
||||
info: { |
|
||||
nickname: '',mobile:'',avatar: '', |
|
||||
gender: null, genderStr: '', |
|
||||
group_id: null,group_idStr: '', |
|
||||
certificate_number: '',duration:'', |
|
||||
lingo_ids: null, lingo_idsStr:'', |
|
||||
scenic_ids: null, scenic_idsStr:'', |
|
||||
bio:'' |
|
||||
}, |
|
||||
|
|
||||
groupIds: [], // 导游等级 |
|
||||
|
|
||||
} |
|
||||
}, |
|
||||
mounted() { |
|
||||
uni.$on("updateInfo",this.updateInfo) |
|
||||
}, |
|
||||
beforeUnmount () { |
|
||||
console.log('触发off') |
|
||||
uni.$off("updateInfo",this.updateInfo) |
|
||||
}, |
|
||||
beforeDestroy () { |
|
||||
console.log('触发off') |
|
||||
uni.$off("updateInfo",this.updateInfo) |
|
||||
}, |
|
||||
|
|
||||
onLoad () { |
|
||||
this.Post({}, '/api/Merchants/get_graphic').then(res => {}) |
|
||||
|
|
||||
this.initSelect() |
|
||||
}, |
|
||||
methods: { |
|
||||
initSelect () { |
|
||||
// 获取导游等级 |
|
||||
this.Post({}, '/api/guide/getGuideGroupList').then(res => { |
|
||||
this.groupIds = res.data |
|
||||
}) |
|
||||
|
|
||||
}, |
|
||||
|
|
||||
// 上传头像 |
|
||||
uploadAvator () { |
|
||||
let _this = this |
|
||||
uni.chooseImage({ |
|
||||
count: 1, |
|
||||
success: (chooseImageRes) => { |
|
||||
const tempFilePaths = chooseImageRes.tempFilePaths; |
|
||||
pathToBase64(tempFilePaths[0]).then(base64 => { |
|
||||
_this.info.avatar = base64 |
|
||||
console.log(_this.info) |
|
||||
}) |
|
||||
}, |
|
||||
}) |
|
||||
}, |
|
||||
selectSex () { |
|
||||
let _this = this |
|
||||
let itemList = ['男','女'] |
|
||||
let valueList = ['1','2'] |
|
||||
uni.showActionSheet({ |
|
||||
itemList: itemList, |
|
||||
success: function (res) { |
|
||||
let index = res.tapIndex; |
|
||||
_this.info.genderStr = itemList[index] |
|
||||
_this.info.gender = valueList[index] |
|
||||
|
|
||||
}, |
|
||||
fail: function (res) { |
|
||||
console.log(res.errMsg); |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
selectRank () { |
|
||||
let _this = this |
|
||||
let itemList = this.groupIds.map(v=>v.name) |
|
||||
let valueList = this.groupIds.map(v=>v.id) |
|
||||
uni.showActionSheet({ |
|
||||
itemList: itemList, |
|
||||
success: function (res) { |
|
||||
let index = res.tapIndex; |
|
||||
_this.info.group_idStr = itemList[index] |
|
||||
_this.info.group_id = valueList[index] |
|
||||
|
|
||||
}, |
|
||||
fail: function (res) { |
|
||||
console.log(res.errMsg); |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
// 跳转修改数据 |
|
||||
changeValue(valueType) { |
|
||||
uni.navigateTo({ |
|
||||
url: `/subPackages/user/infoFilling?valueType=${valueType}&inputValue=${this.info[valueType]}` |
|
||||
}) |
|
||||
}, |
|
||||
|
|
||||
// 接受回调 |
|
||||
updateInfo(data) { |
|
||||
if (data.msgType == 'registerInfo') { |
|
||||
console.log(data.data) |
|
||||
let valueType = data.data.valueType |
|
||||
let valueTypeStr = valueType + 'Str' |
|
||||
let inputValue = data.data.inputValue |
|
||||
let inputValueStr = data.data.inputValueStr |
|
||||
this.info[valueType] = inputValue |
|
||||
if (this.info[valueTypeStr] !== undefined && inputValueStr) { |
|
||||
this.info[valueTypeStr] = inputValueStr |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
|
|
||||
uploadImg() { |
|
||||
uni.chooseImage({ |
|
||||
success: (chooseImageRes) => { |
|
||||
const tempFilePaths = chooseImageRes.tempFilePaths; |
|
||||
|
|
||||
// // #ifdef MP-WEIXIN |
|
||||
// uni.getFileSystemManager().readFile({ |
|
||||
// filePath: tempFilePaths[0], |
|
||||
// encoding: 'base64', |
|
||||
// success: res => { |
|
||||
// this.Post({ |
|
||||
// method: 'POST', |
|
||||
// base64: 'data:image/png;base64,' + res.data |
|
||||
// }, '/api/common/base64').then(res => { |
|
||||
// if (res.data) { |
|
||||
// this.Post({ |
|
||||
// avatar: res.data |
|
||||
// }, '/api/user/profile').then(res => { |
|
||||
// uni.showModal({ |
|
||||
// title: '提示', |
|
||||
// content: res.msg, |
|
||||
// showCancel: false, |
|
||||
// success: res => { |
|
||||
// if (res.confirm) { |
|
||||
// this.getList() |
|
||||
// } |
|
||||
// } |
|
||||
// }) |
|
||||
// }) |
|
||||
// } |
|
||||
// }) |
|
||||
// } |
|
||||
// }) |
|
||||
// // #endif |
|
||||
|
|
||||
pathToBase64(tempFilePaths[0]).then(base64 => { |
|
||||
this.Post({ |
|
||||
method: 'POST', |
|
||||
base64: base64 |
|
||||
}, '/api/common/base64').then(res => { |
|
||||
if (res.data) { |
|
||||
this.Post({ |
|
||||
avatar: res.data |
|
||||
}, '/api/user/profile').then(res => { |
|
||||
uni.showModal({ |
|
||||
title: '提示', |
|
||||
content: res.msg, |
|
||||
showCancel: false, |
|
||||
success: res => { |
|
||||
if (res.confirm) { |
|
||||
this.getList() |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
}) |
|
||||
} |
|
||||
}) |
|
||||
}) |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
|
|
||||
submit() { |
|
||||
uni.showModal({ |
|
||||
title: '提示', |
|
||||
content: '确认修改您的信息?', |
|
||||
success: res => { |
|
||||
if (res.confirm) { |
|
||||
this.Post({ |
|
||||
nickname: this.nickname, |
|
||||
gender: this.gender, |
|
||||
birthday: this.birthday |
|
||||
}, '/api/user/profile').then(res => { |
|
||||
console.log(res) |
|
||||
if (res.code == 1) { |
|
||||
uni.showModal({ |
|
||||
title: '提示', |
|
||||
content: res.msg, |
|
||||
showCancel: false, |
|
||||
success: res => { |
|
||||
if (res.confirm) { |
|
||||
this.getList() |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style scoped lang="scss"> |
|
||||
view { |
|
||||
box-sizing: content-box; |
|
||||
} |
|
||||
.bg{ |
|
||||
min-height: 100vh; |
|
||||
overflow-x: hidden; |
|
||||
background: white; |
|
||||
padding-bottom: 50rpx; |
|
||||
} |
|
||||
.header-tip{ |
|
||||
font-weight: 400; |
|
||||
font-size: 27rpx; |
|
||||
color: #585858; |
|
||||
padding: 33rpx 0; |
|
||||
text-align: center; |
|
||||
} |
|
||||
.empty-value{ |
|
||||
font-weight: 500; |
|
||||
font-size: 28rpx; |
|
||||
color: #999999; |
|
||||
} |
|
||||
|
|
||||
.info-avatar-top { |
|
||||
display: flex; |
|
||||
justify-content: space-between; |
|
||||
font-size: 28rpx; |
|
||||
border-bottom: 1rpx solid #D8D8D8; |
|
||||
padding: 40rpx 0; |
|
||||
height: 48rpx; |
|
||||
color: #333; |
|
||||
align-items: center; |
|
||||
} |
|
||||
.info-avatar-top view{ |
|
||||
display: flex; |
|
||||
align-items: center; |
|
||||
} |
|
||||
.info-avatar-top view:after{ |
|
||||
content: ""; |
|
||||
width: 20rpx; |
|
||||
height: 20rpx; |
|
||||
margin-left: 6rpx; |
|
||||
background-image: url('https://static.ticket.sz-trip.com/tongli/images/user/rightIcon-gray.png'); |
|
||||
background-size: 100% 100%; |
|
||||
} |
|
||||
.info-avatar-top img { |
|
||||
width: 80rpx; |
|
||||
height: 80rpx; |
|
||||
border-radius: 50%; |
|
||||
margin-right: 10rpx; |
|
||||
} |
|
||||
|
|
||||
.change-avatar-btn { |
|
||||
color: #FFF; |
|
||||
width: 220rpx; |
|
||||
margin: 0 auto; |
|
||||
line-height: 70rpx; |
|
||||
border-radius: 20rpx; |
|
||||
background: #4C93FF; |
|
||||
position: relative; |
|
||||
font-size: 34rpx; |
|
||||
} |
|
||||
|
|
||||
.change-avatar-btn input { |
|
||||
position: absolute; |
|
||||
left: 0; |
|
||||
right: 0; |
|
||||
top: 0; |
|
||||
bottom: 0; |
|
||||
opacity: 0; |
|
||||
} |
|
||||
|
|
||||
.user-other-info { |
|
||||
margin:0 30rpx; |
|
||||
.info-title{ |
|
||||
font-weight: bold; |
|
||||
font-size: 32rpx; |
|
||||
color: #000000; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.userinfo-item { |
|
||||
display: flex; |
|
||||
justify-content: space-between; |
|
||||
align-items: center; |
|
||||
font-size: 28rpx; |
|
||||
border-bottom: 1rpx solid #D8D8D8; |
|
||||
padding: 40rpx 30rpx 40rpx 0; |
|
||||
height: 48rpx; |
|
||||
color: #333; |
|
||||
position: relative; |
|
||||
} |
|
||||
|
|
||||
.info-avatar-top span { |
|
||||
font-weight: 500; |
|
||||
font-size: 31rpx; |
|
||||
flex-shrink: 0; |
|
||||
} |
|
||||
|
|
||||
.userinfo-item span { |
|
||||
font-weight: 500; |
|
||||
font-size: 31rpx; |
|
||||
flex-shrink: 0; |
|
||||
color: #000; |
|
||||
width: 200rpx; |
|
||||
} |
|
||||
|
|
||||
.userinfo-item i { |
|
||||
font-weight: 500; |
|
||||
font-size: 24rpx; |
|
||||
color: #999999; |
|
||||
} |
|
||||
|
|
||||
.userinfo-item { |
|
||||
& view::after { |
|
||||
content: ""; |
|
||||
width: 20rpx; |
|
||||
height: 20rpx; |
|
||||
margin-left: 6rpx; |
|
||||
background-image: url('https://static.ticket.sz-trip.com/tongli/images/user/rightIcon-gray.png'); |
|
||||
background-size: 100% 100%; |
|
||||
position: absolute; |
|
||||
right: 0; |
|
||||
margin: auto; |
|
||||
top: 0; |
|
||||
bottom: 0; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
.birthday-box { |
|
||||
text-align: right; |
|
||||
} |
|
||||
|
|
||||
.cropper { |
|
||||
width: auto; |
|
||||
height: 100%; |
|
||||
} |
|
||||
|
|
||||
.cropper-content { |
|
||||
position: fixed; |
|
||||
left: 0; |
|
||||
right: 0; |
|
||||
top: 0; |
|
||||
bottom: 0; |
|
||||
z-index: 1000; |
|
||||
} |
|
||||
|
|
||||
.dialog-footer .change-avatar-btn { |
|
||||
position: fixed; |
|
||||
text-align: center; |
|
||||
bottom: 80rpx; |
|
||||
left: 50%; |
|
||||
margin-left: -110rpx; |
|
||||
} |
|
||||
|
|
||||
.btn-tao { |
|
||||
text-align: center; |
|
||||
font-size: 30rpx; |
|
||||
width: 697rpx; |
|
||||
height: 80rpx; |
|
||||
background: #96684F; |
|
||||
border-radius: 40rpx; |
|
||||
line-height: 80rpx; |
|
||||
color: #FFFFFF; |
|
||||
margin-top: 55rpx; |
|
||||
} |
|
||||
|
|
||||
.popup-box { |
|
||||
border-radius: 20rpx 20rpx 0rpx 0rpx; |
|
||||
background: #fff; |
|
||||
overflow: hidden; |
|
||||
|
|
||||
.popup-item { |
|
||||
width: 697rpx; |
|
||||
height: 99rpx; |
|
||||
font-weight: 500; |
|
||||
font-size: 31rpx; |
|
||||
color: #12293C; |
|
||||
margin: auto; |
|
||||
} |
|
||||
.popup-item:nth-child(2) { |
|
||||
border: none; |
|
||||
border-bottom: 1rpx solid #D8D8D8; |
|
||||
border-top: 1rpx solid #D8D8D8; |
|
||||
} |
|
||||
|
|
||||
.popup-items { |
|
||||
width: 100%; |
|
||||
height: 99rpx; |
|
||||
font-weight: 500; |
|
||||
font-size: 31rpx; |
|
||||
color: #12293C; |
|
||||
border-top: 13rpx solid #F2F2F2; |
|
||||
} |
|
||||
} |
|
||||
</style> |
|