16 changed files with 1849 additions and 191 deletions
@ -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> |
|
@ -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> |
@ -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> |
@ -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 = []; |
||||
|
//将Object转为Array |
||||
|
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> |
@ -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> |
@ -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> |
@ -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> |
Loading…
Reference in new issue