Browse Source

提交

master
chenkainan 1 year ago
parent
commit
8eb3fcdfec
  1. 156
      compoents/waterList.vue
  2. 36
      pages.json
  3. 5
      pages/index/index.vue
  4. 6
      pages/user/user.vue
  5. 27
      static/js/CommonFunction.js
  6. 6
      subPackages/food/foodDetail.vue
  7. 122
      subPackages/user/collect.vue
  8. 494
      subPackages/user/coupon.vue
  9. 386
      subPackages/user/myAddressAdd.vue
  10. 247
      subPackages/user/myContactsAdd.vue
  11. 58
      subPackages/user/privacy.vue
  12. 30
      subPackages/user/privacyInfo.vue
  13. 6
      subPackages/user/profile.vue
  14. 278
      subPackages/user/travelerList.vue

156
compoents/waterList.vue

@ -1,156 +0,0 @@
<template>
<view class="">
<view class="box">
<view class="left" ref="left">
<view class="item" v-for="(item,i) in leftList" :key="i" @click="goDetail(item)">
<image class="image" :src="item.headimg" mode="widthFix"></image>
<view class="content">
<view class="title">{{item.title}}</view>
<view class="flex-between">
<view class="text-overflow" style="display: flex;align-items: center;width: 200rpx;">
<image :src="showImg(item.author_img)" mode="" class="author-img"></image>
{{item.author}}
</view>
<view style="display: flex;">
<image src="https://static.ticket.sz-trip.com/yandu/images/index/eye.png" mode="" class="eye-img"></image>
{{item.view}}
</view>
</view>
</view>
</view>
</view>
<view class="right" ref="right">
<view class="item" v-for="(item,i) in rightList" :key="i" @click="goDetail(item)">
<image class="image" :src="item.headimg" mode="widthFix"></image>
<view class="content">
<view class="title">{{item.title}}</view>
<view class="flex-between">
<view class="text-overflow" style="display: flex;align-items: center;width: 200rpx;">
<image :src="showImg(item.author_img)" mode="" class="author-img"></image>
{{item.author}}
</view>
<view style="display: flex;">
<image src="https://static.ticket.sz-trip.com/yandu/images/index/eye.png" mode="" class="eye-img"></image>
{{item.view}}
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: ['waterList'],
data() {
return {
leftList: [], //
rightList: [], //
leftHeight: 0, //
rightHeight: 0, //
}
},
mounted() {
},
watch:{
waterList: {
handler(newVal, oldVal) {
console.log(newVal, oldVal)
this.waterList = newVal
if(newVal.length > 0) {
this.setWaterFallLayout()
}
},
immediate: true
}
},
methods: {
//uni.getImageInfo
async setWaterFallLayout() {
for (let item of this.waterList) {
try {
let h = await this.getImgHeight(item.headimg)
if (this.leftHeight <= this.rightHeight) {
this.leftList.push(item)
this.leftHeight += h
} else {
this.rightList.push(item)
this.rightHeight += h
}
} catch (e) {}
}
},
getImgHeight(url) {
return new Promise((resolve, reject) => {
uni.getImageInfo({
src: url,
success: e => {
resolve(e.height)
},
fail: e => {
reject(e)
}
})
})
},
goDetail(item) {
if(item.outside_url) {
uni.navigateTo({
url: '/subPackages/webPage/webPage?url=' + encodeURIComponent(item.outside_url)
});
}else {
uni.navigateTo({
url: '/subPackages/strategyDetail?id=' + item.id
})
}
}
}
}
</script>
<style scoped lang="scss">
.box {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.left, .right {
width: 340rpx;
.item {
width: 340rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 11rpx 0rpx rgba(17,17,17,0.26);
border-radius: 27rpx;
overflow: hidden;
margin-bottom: 13.33rpx;
.image {
width: 340rpx;
}
.content {
background: #FFFFFF;
padding: 20rpx;
.title {
font-weight: 500;
font-size: 28rpx;
color: #000000;
line-height: 40rpx;
}
.flex-between {
font-weight: 500;
font-size: 24rpx;
color: #888888;
}
}
}
}
}
</style>

36
pages.json

@ -143,6 +143,42 @@
"style": {
"navigationBarTitleText": "订单填写"
}
},
{
"path": "user/myContactsAdd",
"style": {
"navigationBarTitleText": "联系人信息"
}
},
{
"path": "user/myAddressAdd",
"style": {
"navigationBarTitleText": "收货地址"
}
},
{
"path" : "user/privacy",
"style" : {
"navigationBarTitleText" : "隐私管理"
}
},
{
"path" : "user/privacyInfo",
"style" : {
"navigationBarTitleText" : "详情"
}
},
{
"path" : "user/coupon",
"style" : {
"navigationBarTitleText" : "优惠券"
}
},
{
"path" : "user/collect",
"style" : {
"navigationBarTitleText" : "个人收藏"
}
}
]
}],

5
pages/index/index.vue

@ -147,12 +147,7 @@
</template>
<script>
import waterList from "@/compoents/waterList.vue";
export default {
components: {
waterList
},
data() {
return {
topBanner: [],

6
pages/user/user.vue

@ -100,13 +100,13 @@
cyList: [{
src: 'https://static.ticket.sz-trip.com/yandu/images/user/grsc.png',
title: '个人收藏',
path: '',
path: '/subPackages/user/collect',
isShow: true
},
{
src: 'https://static.ticket.sz-trip.com/yandu/images/user/yhq.png',
title: '优惠券',
path: '',
path: '/subPackages/user/coupon',
isShow: true
},
{
@ -130,7 +130,7 @@
{
src: 'https://static.ticket.sz-trip.com/yandu/images/user/ysgl.png',
title: '隐私管理',
path: '',
path: '/subPackages/user/privacy',
isShow: true
}
],

27
static/js/CommonFunction.js

@ -36,9 +36,34 @@ Vue.prototype.idCardNumber = (val) => {
return pattern.test(val);
}
// 护照验证正则
Vue.prototype.passportValid = (val) => {
return /^([a-zA-z]|[0-9]){5,17}$/.test(val);
}
// 台胞证正则
Vue.prototype.passportValid = (val) => {
return /^\d{8}|^[a-zA-Z0-9]{10}|^\d{18}$/.test(val);
}
// 港澳通行证正则
Vue.prototype.passportValid = (val) => {
return /^([A-Z]\d{6,10}(\(\w{1}\))?)$/.test(val);
}
// 外国人永久居留证正则
Vue.prototype.passportValid = (val) => {
return /(^[A-Za-z]{3})([0-9]{12}$)/.test(val);
}
// 军官证正则
Vue.prototype.passportValid = (val) => {
return /^[\u4E00-\u9FA5](字第)([0-9a-zA-Z]{4,8})(号?)$/.test(val);
}
// 判断电话号码格式
Vue.prototype.IsTel = tel => {
var pattern = /^1\d{10}$/;
var pattern = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
return pattern.test(tel);
}

6
subPackages/food/foodDetail.vue

@ -1,7 +1,7 @@
<template>
<view class="bg" v-if="info">
<view class="swipe-box">
<swiper class="swiper" :autoplay="true" :interval="3000" :duration="3000" circular indicator-dots indicator-color="rgba(255,255,255,.5)" indicator-active-color="#fff">
<swiper class="swiper" :autoplay="false" :interval="3000" :duration="3000" circular indicator-dots indicator-color="rgba(255,255,255,.5)" indicator-active-color="#fff">
<swiper-item v-if="info && info.videourl">
<video
:src="showImg(info.videourl)"
@ -12,8 +12,8 @@
@play="play"
@error="videoErrorCallback"
controls
width="100%"
heigth="100%"
style="width: 100%;height: 100%;"
object-fit="cover"
></video>
</swiper-item>
<swiper-item v-for="(item, index) in info.list_images.split(',')" :key="item.id">

122
subPackages/user/collect.vue

@ -0,0 +1,122 @@
<template>
<view class="bg">
<view v-for="(item,index) in list" :key="index" class="item" @click="gotoDetail(item)">
<image :src="showImg(item.arr.image)" mode="aspectFill"></image>
<view class="content flex-column">
<view class="title text-overflowRows">{{item.arr.title}}</view>
<view class="price">{{item.arr.low_money / 100}}</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: []
}
},
onShow() {
this.getList()
},
methods: {
getList() {
this.Post({
offset: 0,
limit: 100
},'/api/scenic/getCollectList').then(res => {
this.list = res.data
})
},
// type
gotoDetail(item) {
// 1 2 3 4 5 6线 7
let url = ''
switch (item.type){
case 1:
url= ''
break;
case 2:
url= '/subPackages/ticketBooking/detail?id=' + item.arr.id
break;
case 3:
url= '/subPackages/food/foodDetail?id=' + item.arr.id
break;
case 4:
url= ''
break;
case 5:
url= '/subPackages/techan/detail?id=' + item.arr.id
break;
case 6:
url= ''
break;
case 7:
url= ''
break;
default:
break;
}
this.gotoPath(url)
}
}
}
</script>
<style lang="scss" scoped>
.bg {
min-height: 100vh;
padding: 20rpx auto 100rpx;
background: #F7F7F7;
}
.item {
width: 697rpx;
height: 213rpx;
padding: 6rpx 20rpx 6rpx 6rpx;
border-radius: 20rpx;
display: flex;
margin: 0 auto 20rpx;
background: #FFFFFF;
image {
width: 200rpx;
height: 200rpx;
background: #DFEDE0;
border-radius: 13rpx;
}
.content {
flex: 1;
margin-left: 15rpx;
padding: 10rpx 0;
height: 200rpx;
justify-content: space-between;
.title {
font-weight: bold;
font-size: 31rpx;
color: #333333;
}
.price {
font-weight: bold;
font-size: 40rpx;
color: #FF3D3D;
text-align: right;
}
.price::before {
content: '¥';
font-size: 31rpx;
color: #FF3D3D;
}
.price::after {
content: '起';
font-weight: 500;
font-size: 27rpx;
color: #999999;
}
}
}
</style>

494
subPackages/user/coupon.vue

@ -0,0 +1,494 @@
<template>
<view class="bg">
<!-- 导航栏 -->
<view class="nav-list">
<view :class="['nav-item',{active:index==navActive}]" v-for="(item,index) in navList" :key="index"
@click="changeNav(index)">{{ item.name }}
</view>
</view>
<!-- 列表 -->
<view class="coupon-list" v-if="coupon.length>0">
<view :class="['coupon-item',{'hasUse':navActive!=0}]" v-for="(item, index) in coupon" :key="index">
<!-- 分割线上部分 -->
<view class="item-top">
<view class="top-left">
<view class="price price-before" v-if="item.type == 1">
<span>{{item.discounts/100}}</span>
</view>
<view class="price" v-else>
<span>{{getPecenet(item.percent)}}</span>
</view>
<view class="subtitle">
{{item.min_limit/100}}元可用
</view>
</view>
<view class="top-right">
<view class="title">
{{item.title}}
</view>
<view class="time">
{{item.open_time.slice(0,10)}}-{{item.end_time.slice(0,10)}}可用
</view>
</view>
</view>
<!-- 分割线 -->
<view class="item-circle">
<view class="circle left"></view>
<view class="line"></view>
<view class="circle right"></view>
</view>
<!-- 分割线下部分 -->
<view class="item-bottom">
<view class="rules" @click="changeRules(item,index)">
<span v-if="!item.openRules">使用规则{{item.coupon_activity.note}}</span>
<view class="open" v-else>使用规则{{item.coupon_activity.note}}</view>
<!-- <span v-if="!item.openRules">使用规则{{item.content}}</span>
<view class="open" v-else>使用规则{{item.content}}</view> -->
<image v-if="!item.openRules" src="https://yjks.oss-cn-shanghai.aliyuncs.com/uploads/20230415/6a7630c176f976bb16674dde482779fb.png" mode=""></image>
<image v-else src="https://yjks.oss-cn-shanghai.aliyuncs.com/uploads/20230415/f0073b18b3ab88cac62de60411360fc1.png" mode=""></image>
</view>
<!-- <view class="use" @click="use" v-if="navActive==0">
去使用
</view>
<view class="use" v-else>
已失效
</view> -->
</view>
</view>
</view>
<view v-else class="noCoupon">
<img src="https://static.ticket.sz-trip.com/yandu/images/user/couponNo.png" class="no-couPon">
<view>暂无优惠券</view>
</view>
<!-- 兑换优惠券 -->
<!-- <view class="duihuan" @click="open">
兑换优惠券 >
</view> -->
<!-- 弹框 -->
<uni-popup ref="popup" type="center">
<view class="popupBox">
<view class="name">
兑换优惠券
</view>
<input type="text" v-model="password" placeholder="请输入兑换码">
<view class="btns">
<view class="cancel" @click="cancel">
取消
</view>
<span></span>
<view class="sub" @click="submitPassword">
兑换
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
export default {
data() {
return {
navList: [
{name: '可使用', id:"wait_use"},
{name: '已失效', id:"past"},
],
navActive:'', //
coupon:[],
// openRules: false,
password:''
}
},
onShow() {
this.getList(this.navList[0])
},
methods: {
getPecenet:function (percent) {
if(percent>=100 || percent<=0) return "";
percent = 100 - percent;
if(percent%10==0){
percent = percent/10;
}
return percent
},
use() {
uni.switchTab({
url: "/pages/index/index",
});
},
submitPassword() {
console.log('提交的兑换码',this.password);
let that = this
that.password = that.password.trim()
that.$refs.popup.close()
if (that.password== '') {
uni.showToast({
title: '请输入优惠券领取卡号',
icon: 'none'
})
return
}
that.Post({
card_key: that.password
}, "/api/coupon/getCoupon").then((res) => {
console.log(res.code);
if (res.code == 200) {
that.coupon = []
this.getList(this.navList[0])
uni.showToast({
title: '兑换成功',
icon: 'none'
})
} else{
uni.showToast({
title: res.msg,
icon: 'none'
})
}
});
that.password = ''
},
cancel() {
this.password = ''
this.$refs.popup.close()
},
open() {
this.$refs.popup.open('center')
},
// 使
changeRules(item,index){
let list = this.coupon
list.forEach((Item, Index) => {
if (Index === index) {
Item.openRules = !Item.openRules
} else {
Item.openRules = false
}
})
this.coupon = list
this.$forceUpdate()
},
//
showNoPriceNew(price) {
if (price && price > 0) {
return (price / 100)
} else {
return '0'
}
},
//
changeNav(index){
this.navActive=index
this.getList(this.navList[this.navActive])
},
//
getList(item) {
let that = this
that.Post({
status: item.id,
offset: 0,
limit: 100,
}, "/api/coupon/getUserCoupon").then((res) => {
if (res) {
console.log(res.data);
that.coupon = res.data
}
});
}
}
}
</script>
<style lang="scss" scoped>
.bg {
background: #F7F7F7;
min-height: 100vh;
}
/*导航*/
.nav-list {
width: 100%;
height: 107rpx;
display: flex;
justify-content: space-around;
align-items: center;
position: fixed;
background: #FFFFFF;
}
.nav-list .nav-item {
text-align: center;
line-height: 106rpx;
box-sizing: border-box;
font-size: 31rpx;
font-weight: bold;
padding: .23rpx 0;
color: #333333;
}
.nav-list .nav-item.active {
color: #71B580;
border-bottom: 7rpx solid #71B580;
}
.coupon-list{
/* width: 100%; */
position: absolute;
top: 115rpx;
padding: 0 26.67rpx;
background: #F7F7F7;
min-height: 100vh;
padding-bottom: 30rpx;
}
.coupon-list .coupon-item {
background: #ffffff;
margin-top: 20rpx;
border-radius: 13rpx;
}
.coupon-list .coupon-item .item-top {
display: flex;
padding: 30rpx 16rpx 24rpx 36rpx;
align-items: center;
}
.coupon-item .item-top .price {
font-size: 25rpx;
font-weight: bold;
color: #FC5209;
display: flex;
align-items: baseline;
justify-content: center;
}
.coupon-item .item-top .price span {
font-size: 60rpx;
margin-right: 6.67rpx;
}
.top-left .subtitle {
width: 100%;
font-size: 24rpx;
color: #FC5209;
padding-left: 6rpx;
overflow: hidden;
white-space: nowrap;
}
.top-left .price-before::before{
content: '¥';
font-size: 32rpx;
}
.top-right {
margin-left: 46.67rpx;
font-size: 25rpx;
font-weight: 500;
color: #111;
}
.top-right .title {
margin-bottom: 26rpx;
font-size: 31rpx;
font-weight: bold;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.coupon-list .coupon-item .item-circle {
/* position: relative; */
line-height: 1rpx;
height: 1rpx;
width: 692rpx;
}
.coupon-list .coupon-item .item-circle .line {
border-bottom: 1px dashed #ccc;
/* position: absolute; */
top: 0;
bottom: 0;
left: 0;
right: 0;
/* width: calc(100% - 1rem); */
height: .1rpx;
margin: auto;
z-index: 9;
}
.coupon-list .coupon-item .item-circle .circle {
position: absolute;
top: 0;
bottom: 0;
margin: auto;
border-radius: 50%;
background: #ccc;
width: .46rpx;
height: .46rpx;
z-index: 10;
}
.coupon-list .coupon-item .item-circle .circle.left{
left:-.23rpx;
}
.coupon-list .coupon-item .item-circle .circle.right{
right: -.23rpx;
}
.item-bottom {
padding: 16rpx 20rpx;
display: flex;
align-items: flex-start;
justify-content: space-between;
}
.item-bottom .rules {
font-size: 24rpx;
font-weight: 500;
color: #999;
display: flex;
line-height: 47rpx;
}
.item-bottom .rules span {
width: 569rpx;
overflow: hidden; //
white-space: nowrap; //
text-overflow: ellipsis;
}
.item-bottom .rules image {
width: 20rpx;
height: 20rpx;
margin-left: 68rpx;
margin-top: 15rpx;
}
.item-bottom .use {
width: 133rpx;
height: 47rpx;
border: 1px solid #FC5209;
border-radius: 23rpx;
text-align: center;
font-size: 25rpx;
font-weight: 500;
color: #fc5209;
line-height: 47rpx;
}
.open {
width: 569rpx;
min-height: 30rpx;
flex-wrap: wrap;
}
.duihuan {
width: 293rpx;
height: 67rpx;
background: #fff;
box-shadow: 0rpx 0rpx 7rpx 0rpx rgba(153,153,153,0.18);
border-radius: 33rpx;
font-size: 31rpx;
font-weight: 500;
color: #07C49B;
text-align: center;
line-height: 67rpx;
margin-left: 228.67rpx;
position: fixed;
bottom: 52.67rpx;
}
.top-left {
width: 140rpx;
}
.top-left .price {
width: 100%;
/* overflow: hidden; */
white-space: nowrap;
}
.popupBox {
background: #fff;
border-radius: 20rpx;
padding: 40.67rpx 39.33rpx 35.33rpx 40rpx;
}
.popupBox .name {
font-size: 35rpx;
color: #111;
font-weight: bold;
margin-bottom: 57.33rpx;
text-align: center;
}
.popupBox input {
width: 454rpx;
height: 81rpx;
border: 1px solid #D8D8D8;
border-radius: 7rpx;
font-size: 31rpx;font-weight: 500;
color: #999999;
line-height: 81rpx;
margin: 0 39.33rpx 72.67rpx 40rpx;
text-align: center;
}
.popupBox .btns {
display: flex;
align-items: center;
font-size: 35rpx;
justify-content: space-around;
}
.popupBox .btns .cancel {
color: #111;
}
.popupBox .btns span {
width: 1rpx;
height: 53rpx;
background: #D8D8D8;
}
.popupBox .btns .sub {
color: #07C49B;
}
.hasUse {
color: #999 !important;
}
.hasUse .item-top .top-left .price{
color: #999 !important;
}
.hasUse .item-top .top-left .subtitle{
color: #999 !important;
}
.hasUse .item-top .top-right .title {
color: #999 !important;
}
.hasUse .item-top .top-right .time {
color: #999 !important;
}
.hasUse .item-bottom .use {
border: 1px solid #B3B3B3 !important;
color: #999999 !important;
}
.noCoupon{
padding-top: 524rpx;
text-align: center;
font-size: 31rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
.no-couPon{
width: 173rpx;
height: 173rpx;
margin-bottom: 15rpx;
}
}
</style>

386
subPackages/user/myAddressAdd.vue

@ -0,0 +1,386 @@
<template>
<view class="bg">
<view class="list-forms">
<view class="list-item">
<view class="list-item-title">姓名:</view>
<view class="list-item-input"><input type="text" v-model="username" placeholder="请输入姓名" /></view>
</view>
<view class="list-item">
<view class="list-item-title">手机号:</view>
<view class="list-item-input"><input type="number" v-model="mobile" placeholder="请输入手机号" maxlength="11"
/></view>
</view>
<view class="list-item" style="position: relative;">
<view class="list-item-title">选择地区:</view>
<view class="list-item-input3" style="flex: 1;">
<picker mode="multiSelector" :range="newProvinceDataList" range-key="name" @change="changeArea" @columnchange="pickerColumnchange"
style="position: relative;z-index: 2;">
<input type="text" readonly style="text-align: right;font-size: 35rpx;position: relative;z-index: -1;"
v-model="citySeld" disabled="true" placeholder="请选择地区"/>
</picker>
</view>
</view>
<view class="list-item">
<view class="list-item-title">详细地址:</view>
<view class="list-item-input"><input type="text" v-model="detailAddr" placeholder="请输入详细地址" /></view>
</view>
<view class="list-item">
<view class="list-item-title">设为默认:</view>
<view class="list-item-switch">
<switch :checked="idDefault" @change="switchChange" color="#7FD491"/>
</view>
</view>
<view class="list-item-btn">
<view class="list-item-post" @click="postSave()">保存</view>
</view>
</view>
</view>
</template>
<script>
import District from 'ydui-district/dist/jd_province_city_area_id';
export default {
data() {
return {
username: '',
mobile: '',
citySeld: '',
detailAddr: '',
idDefault: false,
title: '新增收货地址',
show: false,
district: District, //
ready: false,
province: null,
city: null,
area: '',
provinceId: null,
cityId: null,
areaId: null,
columns: [],
id: '',
newProvinceDataList:[
[],[],[]
],
multiIndex: [0, 0, 0],
}
},
onLoad(option){
this.id = option.id
if (option.id > 0) {
this.title = '编辑收货地址'
this.getDetail()
}
else {
this.getSeldCityList()
}
},
methods: {
switchChange(e){
this.idDefault = e.detail.value
},
changeArea(e){
//
this.multiIndex = e.detail.value;
this.citySeld = this.newProvinceDataList[0][this.multiIndex[0]].name + this.newProvinceDataList[1][this.multiIndex[1]].name + this.newProvinceDataList[2][this.multiIndex[2]].name
this.provinceId = this.newProvinceDataList[0][this.multiIndex[0]].id
this.cityId = this.newProvinceDataList[1][this.multiIndex[1]].id
this.areaId = this.newProvinceDataList[2][this.multiIndex[2]].id
},
getSeldCityList() {
let that = this
that.Post({}, '/api/areas/getAll').then(res => {
if (res.code === 1) {
var data = res.data;
var result = {};
for (var i = 0; i < data.length; i++) {
var item = data[i];
if (item.parent_id == 0) {
continue;
}
//
if (item.parent_id == "1") {
result[item.id.toString()] = {};
result[item.id.toString()].children = []
result[item.id.toString()].name = item.name;
result[item.id.toString()].id = item.id;
} else if (result[item.parent_id.toString()]) {
//
var t = {
id: item.id,
name: item.name,
children: []
}
result[item.parent_id.toString()].children.push(t)
} else {
//
var k = {
id: item.id,
name: item.name
}
for (var j = 0; j < result[item.parent_id.toString().substr(0, 2) + "0000"].children
.length; j++) {
if (result[item.parent_id.toString().substr(0, 2) + "0000"].children[j].id == item
.parent_id) {
result[item.parent_id.toString().substr(0, 2) + "0000"].children[j].children.push(k)
}
}
}
}
var r = [];
//ObjectArray
for (var i in result) {
r.push(result[i]);
}
//
that.district = r;
let arr = []
let arr1 = []
let arr2 = []
that.district.forEach(item => {
arr.push(item)
})
that.district[0].children.forEach(item => {
arr1.push(item)
})
that.district[0].children[0].children.forEach(item => {
arr2.push(item)
})
that.columns = arr
//
that.ready = true;
console.log(this.columns)
for(let i=0; i<this.columns.length; i++){
this.newProvinceDataList[0].push({name:this.columns[i].name,id:this.columns[i].id});
}
console.log(this.columns[0].children)
for(let i=0; i<this.columns[0].children.length; i++){
this.newProvinceDataList[1].push({name:this.columns[0].children[i].name,id:this.columns[0].children[i].id});
}
for(let i=0; i<this.columns[0].children[0].children.length; i++){
this.newProvinceDataList[2].push({name:this.columns[0].children[0].children[i].name,id:this.columns[0].children[0].children[i].id});
}
}
})
},
//
pickerColumnchange(e){
//
// console.log(e.detail.column);
//
// console.log(e.detail.value)
//
if(e.detail.column === 0){
this.multiIndex[0] = e.detail.value
// console.log('');
// this.newProvinceDataList[1] = [];
this.newProvinceDataList[1] = this.columns[this.multiIndex[0]].children.map((item,index)=>{
// console.log(item)
return item
})
// console.log(this.multiIndex)
if(this.columns[this.multiIndex[0]].children.length === 1){
this.newProvinceDataList[2] = this.columns[this.multiIndex[0]].children[0].children.map((item,index)=>{
// console.log(item)
return item
})
}else{
this.newProvinceDataList[2] = this.columns[this.multiIndex[0]].children[this.multiIndex[1]].children.map((item,index)=>{
// console.log(item)
return item
})
}
//
this.multiIndex.splice(1, 1, 0)
this.multiIndex.splice(2, 1, 0)
}
//
if(e.detail.column === 1){
this.multiIndex[1] = e.detail.value
// console.log('');
// console.log(this.multiIndex)
this.newProvinceDataList[2] = this.columns[this.multiIndex[0]].children[this.multiIndex[1]].children.map((item,index)=>{
// console.log(item)
return item
})
//
this.multiIndex.splice(2, 1, 0)
}
//
if(e.detail.column === 2){
this.multiIndex[2] = e.detail.value
// console.log('')
// console.log(this.multiIndex)
}
},
getDetail() {
this.Post({
id: this.id
}, "/api/user/contactDetail").then(res => {
res = res.data;
if (res && res.id > 0) {
this.username = res.name
this.mobile = res.tel
this.idDefault = res.is_default == 1 ? true : false
this.provinceId = res.province_id
this.cityId = res.city_id
this.areaId = res.district_id
this.citySeld = res.province_text + '' + res.city_text + '' + res.district_text
this.detailAddr = res.detail_addr;
this.getSeldCityList();
}
})
},
postSave() {
this.username = this.username.trim()
this.mobile = this.mobile.trim()
this.detailAddr = this.detailAddr.trim()
if (this.username.length < 1) {
uni.showToast({
title: '请输入姓名',
icon: 'none'
})
return
}
if (this.username.length > 6) {
uni.showToast({
title: '姓名最多6个字',
icon: 'none'
})
return
}
if (!this.IsTel(this.mobile)) {
uni.showToast({
title: '请输入正确的手机号',
icon: 'none'
})
return
}
if (this.citySeld.length < 1) {
uni.showToast({
title: '请选择地区',
icon: 'none'
})
return
}
if (this.detailAddr.length < 2) {
uni.showToast({
title: '请输入具体地址',
icon: 'none'
})
return
}
this.Post({
name: this.username,
tel: this.mobile,
is_default: this.idDefault ? '1' : '0',
province_id: this.provinceId,
city_id: this.cityId,
district_id: this.areaId,
detail_addr: this.detailAddr,
id: this.id || null
},'/api/user/' + (this.id > 0 ? 'edit' : 'add') + 'Consignee').then(res => {
if(res.code == 1){
uni.setStorageSync('addressNow',JSON.stringify(res.data))
uni.showModal({
title: '提示',
content: this.id>0?'编辑成功':'添加成功',
showCancel: false,
success: res => {
if(res.confirm){
uni.navigateBack({})
}
}
})
}else{
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false,
success: res => {
}
})
}
})
}
}
}
</script>
<style scoped>
.bg {
min-height: 100vh;
background-color: white;
display: flex;
flex-direction: column;
}
.list-forms {
display: flex;
flex-direction: column;
border-top: 1rpx solid #D8D8D8;
padding: 20rpx 40rpx;
box-sizing: content-box
}
.list-item {
display: flex;
border-bottom: 1rpx solid #D8D8D8;
padding: 30rpx 0;
height: 60rpx;
align-items: center;
box-sizing: content-box
}
.list-item-title {
width: 150rpx;
font-size: 31rpx;
margin-right: 20rpx;
}
.list-item-input {
flex: 1;
}
.list-item-input input {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
border: 0;
background-color: transparent;
line-height: 34rpx;
font-size: 34rpx;
text-align: right;
}
.list-item-input input::placeholder {
font-size: 26rpx;
}
.list-item-switch {
display: flex;
flex: 1;
justify-content: flex-end;
}
.list-item-btn {
display: flex;
justify-content: center;
margin-top: 20rpx;
}
.list-item-post {
display: flex;
color: #FFFFFF;
font-size: 36rpx;
width: 697rpx;
height: 73rpx;
background: linear-gradient(90deg, #9EE4FE, #7FD491);
border-radius: 37rpx;
justify-content: center;
align-items: center;
margin-top: 650rpx;
}
</style>

247
subPackages/user/myContactsAdd.vue

@ -0,0 +1,247 @@
<template>
<view class="bg">
<view class="list-forms">
<view class="list-item">
<view class="list-item-title">姓名:</view>
<view class="list-item-input"><input type="text" v-model="username" placeholder="请输入姓名" /></view>
</view>
<view class="list-item">
<picker mode="selector" :range="idcardTypeList" range-key="title" @change="changeIdType">
<view class="list-item-title flex-center"
style="border: 1rpx solid #999999;border-radius: 7rpx;padding: 18rpx 19rpx;">{{idcardTypeValue}}
<image src="https://static.ticket.sz-trip.com/yandu/images/user/dui.png" mode=""
style="width: 40rpx;height: 40rpx;margin-left: 48rpx;"></image>
</view>
</picker>
<view class="list-item-input"><input type="text" v-model="idNumber" placeholder="请输入正确的证件号" /></view>
</view>
<view class="list-item">
<view class="list-item-title">手机号:</view>
<view class="list-item-input"><input type="number" v-model="mobile" placeholder="请输入手机号"
maxlength="11" /></view>
</view>
</view>
<view class="btn" @click="submit">保存</view>
</view>
</template>
<script>
export default {
data() {
return {
username: '',
mobile: '',
idNumber: '',
idcardTypeValue: '身份证',
show: false,
idcardTypeList: [],
document_type: 'DAM01001',
id: '',
type: ''
}
},
onLoad(option) {
if (option) {
this.id = option.id
}
if(option && option.type){
this.type = option.type
}
},
onShow() {
this.getIdcardTypeList()
if (this.id) {
this.getDetail()
}
// uni.setNavigationBarTitle({
// title: ''
// })
var pages = getCurrentPages();//
var beforePage = pages[pages.length - 2];//
if(beforePage.route == 'subPackages/scenic/scenicOrder' || beforePage.route == 'subPackages/venue/venueOrder'){
uni.setStorageSync('route', 1)
}
},
methods: {
getDetail() {
this.Post({
id: this.id
}, '/api/user/contactDetail').then(res => {
if (res.code === 1) {
res = res.data
if (res && res.id > 0) {
this.username = res.name
this.mobile = res.tel
this.idNumber = res.id_number
this.idDefault = res.is_default == 1 ? true : false
this.idcardType = res.idcard_type
this.idcardTypeValue = res.document_type_text
}
}
})
},
//
getIdcardTypeList() {
this.Post({}, '/api/user/getIdcardTypeList').then(res => {
this.idcardTypeList = res.data
})
},
//
changeIdType(e) {
this.idcardTypeValue = this.idcardTypeList[e.detail.value].title
this.document_type = this.idcardTypeList[e.detail.value].document_type
},
//
submit() {
this.username = this.username.trim()
this.mobile = this.mobile.trim()
this.idNumber = this.idNumber.trim()
if (this.username.length < 1) {
uni.showToast({
title: '请输入姓名',
icon: 'none'
})
return
}
if (!this.IsTel(this.mobile)) {
uni.showToast({
title: '请输入正确的手机号',
icon: 'none'
})
return
}
if (this.idcardTypeValue == '身份证') {
if (!this.idCardNumber(this.idNumber)) {
uni.showToast({
title: '请输入正确的身份证',
icon: 'none'
})
return
}
} else if (this.idcardTypeValue == '护照') {
if (!this.passportValid(this.idNumber)) {
uni.showToast({
title: '请输入正确的护照',
icon: 'none'
})
return
}
} else if (this.idcardTypeValue == '台胞证') {
if (!this.taiwanValid(this.idNumber)) {
uni.showToast({
title: '请输入正确的台胞证',
icon: 'none'
})
return
}
} else if (this.idcardTypeValue == '港澳通行证') {
if (!this.gangaoValid(this.idNumber)) {
uni.showToast({
title: '请输入正确的港澳通行证',
icon: 'none'
})
return
}
} else if (this.idcardTypeValue == '外国人永久居留证') {
if (!this.foreignerValid(this.idNumber)) {
uni.showToast({
title: '请输入正确的外国人永久居留证',
icon: 'none'
})
return
}
} else if (this.idcardTypeValue == '军官证') {
if (!this.officerValid(this.idNumber)) {
uni.showToast({
title: '请输入正确的军官证',
icon: 'none'
})
return
}
}
this.Post({
id: this.type == 'edit'?this.id:'',
id_number: this.idNumber,
name: this.username,
tel: this.mobile,
document_type: this.document_type
}, this.type=='edit'?'/api/user/editContact':'/api/user/addContact').then(res => {
if (res.code == 1) {
uni.showModal({
title: '提示',
content: '成功',
showCancel: false,
success: res => {
if (res.confirm) {
uni.navigateBack({})
}
}
})
}
})
}
}
}
</script>
<style scoped lang="scss">
.bg {
min-height: 100vh;
background-color: #FFFFFF;
position: relative;
}
.list-forms {
padding: 0 33rpx;
.list-item {
display: flex;
border-bottom: 1rpx solid #D8D8D8;
padding: 30rpx 0;
height: 60rpx;
box-sizing: content-box;
.list-item-title {
font-size: 34rpx;
margin-right: 20rpx;
}
.list-item-input {
flex: 1;
input {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
border: 0;
background-color: transparent;
line-height: 34rpx;
font-size: 34rpx;
text-align: right;
}
input::placeholder {
font-size: 26rpx;
}
}
}
}
.btn {
width: 697rpx;
height: 80rpx;
background: linear-gradient(90deg, #9EE4FE, #7FD491);
border-radius: 40rpx;
text-align: center;
line-height: 80rpx;
font-size: 36rpx;
font-family: PingFang SC;
font-weight: 500;
color: #FFFFFF;
position: absolute;
bottom: 53rpx;
left: 27rpx;
}
</style>

58
subPackages/user/privacy.vue

@ -0,0 +1,58 @@
<template>
<view class="bg">
<view class="list">
<view class="item" v-for="(item,index) in list" :key="item.id" @click="goInfo(item)">
{{item.name}}
</view>
</view>
</view>
</template>
<script>
export default{
data(){
return {
list:[{name:'用户协议',id:'10001'},{name:'隐私协议',id:'9999'},{name:'个人信息收集清单',id:'9997'}],
}
},
onShow() {
// this.Post({
// id: 9999
// },'/api/article/getArticleById').then(res => {
// this.content = res.data.content
// })
},
methods:{
goInfo(item){
uni.navigateTo({
url:'/subPackages/user/privacyInfo?id='+item.id
})
}
}
}
</script>
<style scoped lang="scss">
view{
box-sizing: border-box;
}
.list{
width: 698rpx;
background: #FFFFFF;
box-shadow: 0px 4rpx 12rpx 0px rgba(150,149,149,0.3);
border-radius: 18rpx;
margin: 0 auto;
margin-top: 20rpx;
padding:0 20rpx ;
}
.item{
width: 100%;
height: 93rpx;
border-bottom: 1rpx solid #EEEFF7;
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
line-height: 93rpx;
}
</style>

30
subPackages/user/privacyInfo.vue

@ -0,0 +1,30 @@
<template>
<view class="bg">
<view class="text" v-html="formateRichText(content)">
</view>
</view>
</template>
<script>
export default {
data() {
return {
content:''
};
},
onLoad(option){
this.Post({
id:option.id
},'/api/article/getArticleById').then(res => {
this.content = res.data.content
})
}
}
</script>
<style lang="scss">
.text{
padding: 20rpx;
}
</style>

6
subPackages/user/profile.vue

@ -17,7 +17,7 @@
<!-- <view>{{sexes[info.gender]}}</view> -->
<radio-group @change="changesex">
<label style="margin-right: 15rpx;" v-for="(item,index) in sexes" :key="index">
<radio color="#FEB419" :value="item.value" :checked="index === info.gender-1" />{{item.text}}
<radio color="#7FD491" :value="item.value" :checked="index === info.gender-1" />{{item.text}}
</label>
</radio-group>
</view>
@ -198,7 +198,7 @@
birthday: this.birthday
}, '/api/user/profile').then(res => {
console.log(res)
if (res.code == 200) {
if (res.code == 1) {
uni.showModal({
title: '提示',
content: res.msg,
@ -339,7 +339,7 @@
font-size: 30rpx;
width: 697rpx;
height: 80rpx;
background: linear-gradient(90deg, #F84A56, #FF9834);
background: linear-gradient(90deg, #9EE4FE, #7FD491);
border-radius: 40rpx;
line-height: 80rpx;
color: #FFFFFF;

278
subPackages/user/travelerList.vue

@ -10,10 +10,88 @@
<view v-if="showType===1" class="active-bar"></view>
</view>
</view>
<view class="concat-detail">
<!-- 出行人信息 -->
<view v-if="showType===0">
<view class="item" v-for="(item,index) in travelList" :key="index">
<view class="name">
<view class="">
{{item.name}}
</view>
<view class="">
{{item.tel}}
</view>
</view>
<view class="idcard">
<view class="">
{{item.document_type_text}}:
</view>
<view class="">
{{item.id_number}}
</view>
</view>
<view class="item-btn">
<view class="choice">
<image src="https://static.ticket.sz-trip.com/yandu/images/user/dui.png" mode="aspectFill"
v-if="item.is_default==1">
</image>
<view class="yuan" v-else @click.stop="defaultC(item)">
</view>
<view class="">
默认出行人
</view>
</view>
<view class="btn-list">
<view class="btn-item" @click.stop="edit(item.id)">
修改
</view>
<view class="btn-item" @click.stop="delet(item)">
删除
</view>
</view>
</view>
</view>
</view>
<!-- 收货地址 -->
<view v-else>
<view class="item" v-for="(item,index) in addressList" :key="index">
<view class="name">
<view>
{{item.name}}
</view>
<view class="">
{{item.tel}}
<span v-if="item.is_default==1">默认</span>
</view>
</view>
<view class="idcard">
<view class="">
收货地址:
</view>
<view class="text-overflow">
{{item.address}}
</view>
</view>
<view class="item-btn" style="justify-content: flex-end;">
<view class="btn-list">
<view class="btn-item" @click.stop="edit(item.id)">
修改
</view>
<view class="btn-item" @click.stop="delet(item)">
删除
</view>
</view>
</view>
</view>
</view>
<view class="btn-box">
<navigator :url="showType ? '/subPackages/user/myAddressAdd' : '/subPackages/user/myContactsAdd'" class="btn">
{{showType ? '添加联系人' : '添加出行人'}}
</navigator>
</view>
</view>
</template>
@ -22,21 +100,72 @@
name: "travelerList",
data() {
return {
showType: 0
showType: 0,
travelList: [],
addressList: []
};
},
onShow() {
this.$nextTick(()=>{
this.init()
})
this.init()
},
methods: {
init () {
if (this.showType === 0 && this.$refs.travelListVueRef) {
this.$refs.travelListVueRef.getList()
} else if (this.showType === 1 && this.$refs.selfPickupVueRef) {
this.$refs.selfPickupVueRef.getList()
//
this.Post({}, "/api/user/contactList").then(res => {
if (res) this.travelList = res.data
})
//
this.Post({}, '/api/user/consigneeList').then(res => {
if(res) this.addressList = res.data
})
},
delet(item) {
let that = this
uni.showModal({
title: '提示',
content: '确定要删除该出行人吗?',
success: function(res) {
if (res.confirm) {
that.Post({
id: item.id
}, "/api/user/delDetail").then(res => {
if (res) {
uni.showToast({
icon: "none",
title: res.msg
})
}
that.getList()
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
defaultC(item) {
this.Post({
id: item.id,
is_default: 1
}, "/api/user/editContact").then(res => {
if (res.code == 1) {
this.travelList.forEach(i => i.is_default = 0)
item.is_default = !item.is_default
}
})
},
//
edit(id){
let url = ''
if(this.showType) {
url = '/subPackages/user/myAddressAdd?id='+id
}else {
url = "/subPackages/user/myContactsAdd?type=edit&id="+id
}
uni.navigateTo({
url: url
});
}
}
}
@ -48,7 +177,9 @@
background: #F7F7F7;
height: 100vh;
overflow-x: hidden;
padding-bottom: 200rpx;
}
.cancat-nav{
width: 100%;
display: flex;
@ -69,9 +200,130 @@
background: #71B580;
}
}
.concat-detail{
flex: 1;
height: 10rpx;
overflow: hidden;
.item {
width: 697rpx;
background: #FFFFFF;
border-radius: 13rpx;
margin: 0 auto;
margin-bottom: 28rpx;
padding: 26rpx;
.name,
.idcard {
display: flex;
font-size: 31rpx;
font-weight: bold;
color: #333333;
}
.name {
view:last-child {
margin-left: 40rpx;
}
span {
padding: 3rpx 9rpx;
background: #71B580;
border-radius: 7rpx;
font-weight: bold;
font-size: 24rpx;
color: #FFFFFF;
margin-left: 15rpx;
}
}
.idcard {
margin-top: 26rpx;
view:last-child {
margin-left: 14rpx;
font-weight: 400;
max-width: 492rpx;
}
}
.item-btn {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 40rpx;
.choice {
display: flex;
align-items: center;
view:last-child {
margin-left: 20rpx;
font-size: 27rpx;
font-weight: 500;
color: #333333;
}
image {
width: 40rpx;
height: 40rpx;
}
.yuan {
width: 40rpx;
height: 40rpx;
background: rgba(255, 200, 37, 0);
border: 1rpx solid #999999;
border-radius: 20rpx;
}
}
.btn-list {
display: flex;
align-items: center;
view {
width: 134rpx;
height: 54rpx;
background: #FFFFFF;
border: 1px solid #999999;
border-radius: 27rpx;
font-size: 27rpx;
font-weight: 500;
color: #333333;
line-height: 52rpx;
text-align: center;
}
view:last-child {
margin-left: 14rpx;
}
}
}
}
.btn-box {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 200rpx;
background-color: #fff;
.btn {
width: 697rpx;
line-height: 80rpx;
background: linear-gradient(90deg, #9EE4FE, #7FD491);
border-radius: 37rpx;
font-weight: 500;
font-size: 36rpx;
color: #000000;
text-align: center;
position: fixed;
bottom: 53rpx;
left: 26.67rpx;
}
}
</style>

Loading…
Cancel
Save