13 changed files with 7 additions and 2726 deletions
@ -1,258 +0,0 @@ |
|||
<template> |
|||
<view class="content" style="overflow-x: auto;"> |
|||
<view class="search-header" :style="{'height': height+'px','padding-top':statusBarHeight+'px'}"> |
|||
<view class="title">CGC-ICH</view> |
|||
<view class="subtitle">大运河非物质文化遗产</view> |
|||
</view> |
|||
<view :style="{'height':height+'px','flex-shrink':0}"></view> |
|||
|
|||
<div style="padding-top: 88rpx;"> |
|||
<div class="login-tip">CGC-ICH 申请获得</div> |
|||
<div class="login-tip2">以下权限</div> |
|||
<div class="login-tip-box"> |
|||
<text>获得你的公开信息(昵称、头像、地区及性别)</text> |
|||
</div> |
|||
<div class="btn-box"> |
|||
<button bindtap="cancel" type="default" @click="redirectIndex">取消</button> |
|||
<button type="primary" @click="getUserInfo">同意</button> |
|||
</div> |
|||
<div class="flex-center article-box"> |
|||
<radio-group @change="toggleAgreement"> |
|||
<radio value="1" :checked="isAgreed" style="transform:scale(0.7)"></radio> |
|||
</radio-group> |
|||
<div>同意<text @click="gotoInfo">《用户服务协议》、《隐私政策》</text></div> |
|||
</div> |
|||
<uni-popup ref="popup" type="bottom" background-color="#fff"> |
|||
<button type="default" open-type="getPhoneNumber" @getphonenumber="handlePhoneNumber" style="width: 100%;height: 12vh;line-height: 12vh;">点击授权手机号</button> |
|||
</uni-popup> |
|||
</div> |
|||
|
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: "login", |
|||
data() { |
|||
return { |
|||
// 导航栏参数 |
|||
height: 0, |
|||
statusBarHeight: 0, |
|||
isAgreed: false, |
|||
}; |
|||
}, |
|||
onLoad(options) { |
|||
this.initRectInfo() |
|||
// 只需授权手机号 |
|||
if (options.needAuth === '1') { |
|||
setTimeout(() => { |
|||
this.$refs.popup.open('bottom'); |
|||
}, 400); |
|||
} |
|||
}, |
|||
methods: { |
|||
initRectInfo () { |
|||
const sysInfo = uni.getSystemInfoSync() |
|||
this.statusBarHeight = sysInfo.statusBarHeight |
|||
// 默认高度 |
|||
this.height = sysInfo.statusBarHeight + 40 |
|||
}, |
|||
// 处理手机号授权 |
|||
handlePhoneNumber(e) { |
|||
if (e.detail.errMsg === "getPhoneNumber:ok") { // 成功 |
|||
this.$refs.popup.close(); |
|||
this.Post({ |
|||
code: e.detail.code, |
|||
encryptedData: e.detail.encryptedData, |
|||
iv: e.detail.iv, |
|||
token: uni.getStorageSync('token1') |
|||
}, '/api/mini_program/bindPhoneNumber') |
|||
.then(res => { |
|||
this.$store.commit('changeUserInfo', res.data.userinfo); |
|||
this.navigateBasedOnPath(); |
|||
}) |
|||
.catch(error => { |
|||
console.error('绑定手机号失败:', error); |
|||
uni.showToast({ |
|||
title: '绑定手机号失败,请稍后重试', |
|||
icon: 'none' |
|||
}); |
|||
}); |
|||
} else { |
|||
console.error('获取手机号失败:', e.detail.errMsg); |
|||
uni.showToast({ |
|||
title: '获取手机号失败,请稍后重试', |
|||
icon: 'none' |
|||
}); |
|||
} |
|||
}, |
|||
// 跳转到协议页面 |
|||
gotoInfo() { |
|||
uni.navigateTo({ |
|||
url: '/subPackages/user/privacy' |
|||
}); |
|||
}, |
|||
// 切换协议同意状态 |
|||
toggleAgreement() { |
|||
this.isAgreed = !this.isAgreed; |
|||
}, |
|||
// 重定向到首页 |
|||
redirectIndex() { |
|||
uni.switchTab({ |
|||
url: '/pages/index/index', |
|||
}); |
|||
}, |
|||
// 获取用户信息 |
|||
getUserInfo() { |
|||
if (!this.isAgreed) { |
|||
uni.showToast({ |
|||
title: '请先勾选同意《用户服务协议》、《隐私政策》', |
|||
icon: 'none' |
|||
}); |
|||
return; |
|||
} |
|||
uni.login({ |
|||
provider: 'weixin', |
|||
success: (loginRes) => { |
|||
uni.getUserInfo({ |
|||
withCredentials: true, |
|||
success: (res) => { |
|||
this.Post({ |
|||
code: loginRes.code, |
|||
userInfo: res.userInfo, |
|||
encryptedData: res.encryptedData, |
|||
iv: res.iv, |
|||
wechat_qrcode: uni.getStorageSync('wechat_qrcode') || '' |
|||
}, '/api/mini_program/login') |
|||
.then(resTwo => { |
|||
this.$store.commit('changeUserInfo', resTwo.data.userinfo); |
|||
if (resTwo.data.userinfo.mobile) { |
|||
this.navigateBasedOnPath(); |
|||
} else { |
|||
uni.setStorageSync('token1', resTwo.data.userinfo.token); |
|||
this.$refs.popup.open('bottom'); |
|||
} |
|||
}) |
|||
.catch(error => { |
|||
console.error('登录失败:', error); |
|||
uni.showToast({ |
|||
title: '登录失败,请稍后重试', |
|||
icon: 'none' |
|||
}); |
|||
}); |
|||
}, |
|||
fail: (err) => { |
|||
console.error('获取用户信息失败:', err); |
|||
uni.showToast({ |
|||
title: '获取用户信息失败,请稍后重试', |
|||
icon: 'none' |
|||
}); |
|||
} |
|||
}); |
|||
}, |
|||
fail: (err) => { |
|||
console.error('微信登录失败:', err); |
|||
uni.showToast({ |
|||
title: '微信登录失败,请稍后重试', |
|||
icon: 'none' |
|||
}); |
|||
} |
|||
}); |
|||
}, |
|||
// 根据路径进行导航 |
|||
navigateBasedOnPath() { |
|||
if (this.$store.state.user.toPath.includes('user/user')) { |
|||
uni.switchTab({ |
|||
url: this.$store.state.user.toPath |
|||
}); |
|||
} else { |
|||
uni.navigateBack({}); |
|||
} |
|||
} |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
.search-header{ |
|||
width: 100%; |
|||
position: fixed; |
|||
top: 0; |
|||
left: 0; |
|||
right: 0; |
|||
background: white; |
|||
text-align: center; |
|||
z-index:99; |
|||
.title{ |
|||
font-size: 30rpx |
|||
} |
|||
.subtitle{ |
|||
font-size: 22rpx; |
|||
} |
|||
|
|||
} |
|||
|
|||
.content { |
|||
min-height: 100vh; |
|||
} |
|||
|
|||
.login-tip { |
|||
font-size: 28rpx; |
|||
margin: 0 60rpx; |
|||
margin-top: 40rpx; |
|||
} |
|||
|
|||
.login-tip2 { |
|||
font-size: 44rpx; |
|||
margin: 0rpx 60rpx; |
|||
margin-top: 20rpx; |
|||
font-weight: 400; |
|||
} |
|||
|
|||
.login-tip-box { |
|||
display: flex; |
|||
align-items: flex-start; |
|||
margin: 0 60rpx; |
|||
font-size: 28rpx; |
|||
margin-top: 40rpx; |
|||
line-height: 40rpx; |
|||
} |
|||
|
|||
.login-tip-box .icon-gou1 { |
|||
line-height: 80rpx; |
|||
margin-top: -20rpx; |
|||
margin-right: 30rpx; |
|||
color: #666; |
|||
} |
|||
|
|||
.btn-box { |
|||
display: flex; |
|||
position: absolute; |
|||
bottom: 100rpx; |
|||
left: 0; |
|||
right: 0; |
|||
} |
|||
|
|||
.btn-box button { |
|||
width: 400rpx; |
|||
} |
|||
|
|||
.article-box { |
|||
position: absolute; |
|||
left: 0; |
|||
right: 0; |
|||
justify-content: center; |
|||
font-size: 24rpx; |
|||
color: #1aad19; |
|||
bottom: 40rpx; |
|||
} |
|||
|
|||
.article-box .iconfont { |
|||
margin-right: 10rpx; |
|||
font-size: 26rpx; |
|||
} |
|||
|
|||
.article-box text { |
|||
border-bottom: 1px solid; |
|||
} |
|||
</style> |
@ -1,659 +0,0 @@ |
|||
<template> |
|||
<view class="bg"> |
|||
<view class="title">我的</view> |
|||
|
|||
<view class="topBox" @click="gotoProfile"> |
|||
<view class="avatar-box flex-center"> |
|||
<image :src="showImg(userInfo.avatar)" mode="aspectFill" class="headImg" v-if="userInfo.avatar"></image> |
|||
<image src="https://changshu.js-dyyj.com/uploads/20250326/516242619f0772bee371a60684618c01.png" mode="aspectFill" |
|||
class="headImg" v-else></image> |
|||
</view> |
|||
<view class="username" v-if="userInfo.nickname">{{userInfo.nickname}}</view> |
|||
<view class="username" v-else>请登录/注册 ></view> |
|||
<view class="personalCenter flex-center" v-if="userInfo.nickname"> |
|||
个人中心 |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="orderBox"> |
|||
<navigator :url="'/subPackages/order/trades'" class="moreBox flex-between"> |
|||
我的订单 |
|||
<span class="flex-between">查看更多 <img |
|||
src="https://static.ticket.sz-trip.com/cgc/images/user/rightIcon.png" alt=""></span> |
|||
</navigator> |
|||
|
|||
<view class="flex-around" style="margin-top: 20rpx;"> |
|||
<view class="orderItem" v-for="(item,index) in orderList" :key="index" @click="goTrades(item)"> |
|||
<img :src="item.src" alt=""> |
|||
<view>{{item.title}}</view> |
|||
</view> |
|||
</view> |
|||
<!-- 待付款轮播 --> |
|||
<!-- <swiper class="my-swipe" :autoplay="3000" indicator-color="white" v-if="dfkList && dfkList.length>0" circular> |
|||
<swiper-item v-for="(item,index) in dfkList" :key="item.id"> |
|||
<div class="dfkBox" @click="goToOrderDetail(item)"> |
|||
<image :src="showImg(item.order_child[0].specifications_image)" mode="aspectFill"></image> |
|||
<div class="contentBox"> |
|||
<div style="width:300rpx;"> |
|||
<div style="font-size: 27rpx;margin-bottom: 10rpx;">等待付款 </div> |
|||
<div style="display: flex;color: #8A8A8A;font-size: 27rpx;">剩余时间:<uni-countdown class="countdown" @timeup="timeup(index)" :show-day="false" :hour="differTimeList[index].slice(0,2)" :minute="differTimeList[index].slice(3,5)" :second="differTimeList[index].slice(6,8)"/></div> |
|||
</div> |
|||
<div class="orderBtn" @click.stop="setOrderId(item.order_id)">去支付</div> |
|||
</div> |
|||
</div> |
|||
</swiper-item> |
|||
</swiper> --> |
|||
</view> |
|||
|
|||
<view class="cygj"> |
|||
<view class="cyItem" style="font-weight: bold;font-size: 31rpx;color: #333333;"> |
|||
常用工具 |
|||
</view> |
|||
<view class="cyItem flex-between" v-for="(item,index) in cyList" :key="index" |
|||
@click="gotoUrl(item,index)" v-if="item.isShow"> |
|||
<view class="flex-center"> |
|||
<img :src="item.src" class="headIcon"> |
|||
{{item.title}} |
|||
</view> |
|||
<img src="https://static.ticket.sz-trip.com/yandu/images/user/rightIcon-gray.png" class="rightIcon"> |
|||
</view> |
|||
<!-- <button id="contact" class="cyItem flex-between" open-type="contact" bindcontact="handleContact" session-from="sessionFrom"> |
|||
<view class="flex-center"> |
|||
<img src="https://static.ticket.sz-trip.com/dongtai/images/user/zxkf.png" class="headIcon"> |
|||
在线客服 |
|||
</view> |
|||
<img src="https://static.ticket.sz-trip.com/dongtai/images/user/rightIcon-gray.png" class="rightIcon"> |
|||
</button> --> |
|||
</view> |
|||
|
|||
<!-- 旅游咨询弹框 --> |
|||
<uni-popup ref="popup" type="center"> |
|||
<view class="consult-popup"> |
|||
即将拨打客服电话 |
|||
<view class="consult-subtitle">服务时间:周一至周五<br>9:00-12:00,13:00-18:00</view> |
|||
<view class="consult-btns"> |
|||
<view @click="$refs.popup.close()">取消</view> |
|||
<view @click="clickPhone('0515-69186109')">确定</view> |
|||
<!-- <view> |
|||
<button class="confirm" open-type="contact">确定</button> |
|||
</view> --> |
|||
</view> |
|||
</view> |
|||
</uni-popup> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import moment from "moment"; |
|||
export default { |
|||
data() { |
|||
return { |
|||
dfkList: [], |
|||
differTimeList: [], |
|||
nowDateTime: '', //当前时间秒数 |
|||
userInfo: {}, |
|||
orderList: [{ |
|||
src: 'https://static.ticket.sz-trip.com/cgc/images/user/dfk.png', |
|||
title: '待付款', |
|||
status: 'WAIT_PAYMENT' |
|||
}, |
|||
{ |
|||
src: 'https://static.ticket.sz-trip.com/cgc/images/user/dfh.png', |
|||
title: '待使用/发货', |
|||
status: 'PAYMENT_SUCCESSFULLY' |
|||
}, |
|||
{ |
|||
src: 'https://static.ticket.sz-trip.com/cgc/images/user/dsh.png', |
|||
title: '待收货', |
|||
status: 'POST' |
|||
}, |
|||
// { |
|||
// src: 'https://changshu.js-dyyj.com/uploads/20250326/3f13d3a10dd0f88e764e3ddf1157c108.png', |
|||
// title: '待评价', |
|||
// status: 'WAIT_COMMENT' |
|||
// }, |
|||
{ |
|||
src: 'https://static.ticket.sz-trip.com/cgc/images/user/tk.png', |
|||
title: '退款/售后', |
|||
status: 'WAIT_REFUND,REFUND_SUCCESS,REFUND_REFUSAL,REFUND_ERROR,REFUND_PART' |
|||
}, |
|||
], |
|||
cyList: [ |
|||
{ |
|||
src: 'https://static.ticket.sz-trip.com/cgc/images/user/gwc.png', |
|||
title: '购物车', |
|||
path: '/subPackages/user/gwc', |
|||
isShow: true |
|||
}, |
|||
{ |
|||
src: 'https://static.ticket.sz-trip.com/cgc/images/user/kfdh.png', |
|||
title: '客服电话', |
|||
path: '', |
|||
isShow: true |
|||
}, |
|||
{ |
|||
src: 'https://static.ticket.sz-trip.com/cgc/images/user/shdz.png', |
|||
title: '收货地址', |
|||
path: '/subPackages/user/travelerList', |
|||
isShow: true |
|||
}, |
|||
{ |
|||
src: 'https://static.ticket.sz-trip.com/cgc/images/user/ysgl.png', |
|||
title: '隐私管理', |
|||
path: '/subPackages/user/privacy', |
|||
isShow: true |
|||
}, |
|||
// { |
|||
// src: 'https://changshu.js-dyyj.com/uploads/20250326/3e977f62b6cbfeec5a17d945b96b8c8c.png', |
|||
// title: '投诉建议', |
|||
// path: '/subPackages/service/service', |
|||
// isShow: true |
|||
// }, |
|||
], |
|||
} |
|||
}, |
|||
onShow() { |
|||
this.userInfo = (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo'))) || this.$store.state.user.userInfo || {} |
|||
console.log(this.userInfo) |
|||
// this.dfkList = [] |
|||
// this.nowDateTime = parseInt(new Date().getTime() / 1000) |
|||
// this.Post({}, "/api/user/userInfo").then((res) => { |
|||
// if (res.data) { |
|||
// this.userInfo = res.data; |
|||
// // this.getDfk() |
|||
|
|||
// // 是否展示商户核销 |
|||
// this.Post({},'/api/merchants/is_merchant').then(res => { |
|||
// this.cyList[6].isShow = res.data |
|||
// }) |
|||
// } |
|||
// }); |
|||
}, |
|||
methods: { |
|||
// 个人信息或登录 |
|||
gotoProfile() { |
|||
// 有token去个人信息,没有去登录 |
|||
if(this.userInfo.token) { |
|||
uni.navigateTo({ |
|||
url: '/subPackages/user/profile' |
|||
}) |
|||
}else { |
|||
uni.navigateTo({ |
|||
url: '/pages/login/login' |
|||
}) |
|||
} |
|||
}, |
|||
timeup(index) { |
|||
// return this.dfkList.splice(index,1) |
|||
}, |
|||
setOrderId(id) { |
|||
let that = this; |
|||
that.orderId = id; |
|||
that.Post({ |
|||
order_id: id, |
|||
type: "miniprogram", |
|||
platform: 'miniprogram' |
|||
}, |
|||
'/api/pay/unify' |
|||
).then(res => { |
|||
if (res.data) { |
|||
uni.requestPayment({ |
|||
nonceStr: res.data.nonceStr, |
|||
package: res.data.package, |
|||
paySign: res.data.paySign, |
|||
signType: res.data.signType, |
|||
timeStamp: res.data.timeStamp |
|||
}); |
|||
} |
|||
}); |
|||
}, |
|||
// 待付款 |
|||
getDfk() { |
|||
this.differTimeList = [] |
|||
let params = { |
|||
offset: this.dfkList.length, |
|||
limit: 10, |
|||
status: 'WAIT_PAYMENT', |
|||
} |
|||
this.Post(params, '/api/order/orderList').then(res => { |
|||
this.isLoading = false |
|||
if (res) { |
|||
this.dfkList = [...this.dfkList, ...res.data] |
|||
this.dfkList.forEach(item => { |
|||
// 获取时间差,订单关闭时间-当前时间,若存在即展示倒计时differTimeList |
|||
let del; |
|||
if (moment(item.close_time).diff(moment()) > 0) { |
|||
del = moment.utc(moment(item.close_time).diff(moment())).format('HH:mm:ss') |
|||
} else { |
|||
del = '00:00:00' |
|||
} |
|||
this.differTimeList.push(del) |
|||
}) |
|||
console.log(this.differTimeList); |
|||
console.log('this.differTimeList:' + this.differTimeList[0].slice(0, 2)) |
|||
} |
|||
}) |
|||
}, |
|||
goToOrderDetail(item) { |
|||
uni.navigateTo({ |
|||
url: '/subPackages/order/detail?id=' + item.order_id |
|||
}); |
|||
}, |
|||
getChild(list) { |
|||
let arr = [] |
|||
for (let i = 0; i < list.length; i++) { |
|||
if (list[i].product_model == "ticket") { |
|||
console.log(list[i]); |
|||
arr.push(list[i]) |
|||
break |
|||
} |
|||
} |
|||
console.log(arr); |
|||
if (arr.length > 0) { |
|||
return arr[0] |
|||
} else { |
|||
return list[0] |
|||
} |
|||
|
|||
}, |
|||
goCoupon() { |
|||
uni.navigateTo({ |
|||
url: "/subPackages/user/coupon", |
|||
}); |
|||
}, |
|||
goKeFu() { |
|||
uni.navigateTo({ |
|||
url: "/subPackages/publicservices/ServiceOnline", |
|||
}); |
|||
}, |
|||
// open(){ |
|||
// this.$refs.popup.open('center') |
|||
// }, |
|||
gotoUrl(item, index) { |
|||
if (item.title == "客服电话") { |
|||
this.$refs.popup.open() |
|||
return; |
|||
} |
|||
uni.navigateTo({ |
|||
url: item.path |
|||
}) |
|||
}, |
|||
qidai() { |
|||
uni.showToast({ |
|||
title: '功能建设中...', |
|||
icon: 'none' |
|||
}) |
|||
}, |
|||
goTrades(item) { |
|||
if (item) { |
|||
let title = item.title |
|||
if (title == "待使用/发货") title="待使用" |
|||
uni.navigateTo({ |
|||
url: "/subPackages/order/trades?type=" + title, |
|||
}); |
|||
} else { |
|||
uni.navigateTo({ |
|||
url: "/subPackages/order/trades", |
|||
}); |
|||
} |
|||
}, |
|||
//判断是否关注公众号 |
|||
isGz(item) { |
|||
this.$refs.pop.openPop( |
|||
'https://yjks.oss-cn-shanghai.aliyuncs.com/uploads/20230517/db9eb60e0abfea8be1075b406fefe551.jpg'); |
|||
// this.Post({}, '/api/wechat/getSubcribeInfo').then(res => { |
|||
// if (res.data) { |
|||
// uni.navigateTo({ |
|||
// url:'/subPackages/webPage/webPage?url='+'https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzU2NjQwNTYxNg==#wechat_redirect' |
|||
// }) |
|||
// } else { |
|||
// console.log(this.$refs.pop); |
|||
// } |
|||
// }); |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
view{ |
|||
box-sizing: border-box; |
|||
} |
|||
|
|||
::v-deep .uni-countdown { |
|||
font-size: 20px !important; |
|||
|
|||
::v-deep .uni-countdown__splitor { |
|||
font-size: 20px !important; |
|||
} |
|||
} |
|||
|
|||
.bg { |
|||
min-height: 100vh; |
|||
overflow-x: hidden; |
|||
background: url('https://static.ticket.sz-trip.com/cgc/images/user/bg.png') no-repeat; |
|||
background-size: 100% auto; |
|||
background-color: #F7F7F7; |
|||
padding-bottom: 100rpx; |
|||
} |
|||
|
|||
.title { |
|||
font-weight: bold; |
|||
font-size: 36rpx; |
|||
color: #333333; |
|||
position: absolute; |
|||
top: 110rpx; |
|||
left: 50%; |
|||
transform: translate(-50%, 0); |
|||
} |
|||
|
|||
.topBox { |
|||
width: 750rpx; |
|||
height: 373rpx; |
|||
padding: 100rpx 0 0 26rpx; |
|||
box-sizing: border-box; |
|||
display: flex; |
|||
margin-top: 90rpx; |
|||
|
|||
.avatar-box { |
|||
width: 120rpx; |
|||
height: 120rpx; |
|||
background: #FFFFFF; |
|||
border-radius: 50%; |
|||
overflow: hidden; |
|||
} |
|||
|
|||
.headImg { |
|||
width: 120rpx; |
|||
height: 120rpx; |
|||
border-radius: 50%; |
|||
} |
|||
|
|||
.username { |
|||
margin: 40rpx 0 0 28rpx; |
|||
font-weight: 500; |
|||
font-size: 40rpx; |
|||
color: #000000; |
|||
} |
|||
|
|||
.personalCenter { |
|||
width: 165rpx; |
|||
height: 59rpx; |
|||
background: rgba(24, 135, 145, 1); |
|||
border-radius: 29rpx 0rpx 0rpx 29rpx; |
|||
margin: 40rpx 0 0 auto; |
|||
font-weight: bold; |
|||
font-size: 28rpx; |
|||
color: #FFFFFF; |
|||
} |
|||
} |
|||
|
|||
.orderBox { |
|||
width: 697rpx; |
|||
background: #FFFFFF; |
|||
box-shadow: 0rpx 0rpx 23rpx 0rpx rgba(80, 80, 80, 0.12); |
|||
border-radius: 20rpx; |
|||
margin: -48rpx auto 0; |
|||
padding-bottom: 30.6rpx; |
|||
|
|||
.moreBox { |
|||
height: 84rpx; |
|||
margin: auto; |
|||
font-size: 31rpx; |
|||
font-family: PingFang SC; |
|||
font-weight: bold; |
|||
color: #000000; |
|||
padding-left: 26rpx; |
|||
|
|||
span { |
|||
padding-right: 18rpx; |
|||
font-size: 27rpx; |
|||
font-family: PingFang SC; |
|||
font-weight: 500; |
|||
box-sizing: border-box; |
|||
|
|||
img { |
|||
width: 12rpx; |
|||
height: 21rpx; |
|||
margin-left: 12rpx; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.orderItem { |
|||
font-size: 27rpx; |
|||
font-family: PingFang SC; |
|||
font-weight: 500; |
|||
color: #000000; |
|||
width: 25%; |
|||
text-align: center; |
|||
|
|||
img { |
|||
width: 80rpx; |
|||
height: 80rpx; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.lxwm { |
|||
width: 696rpx; |
|||
height: 447rpx; |
|||
background: #FFFFFF; |
|||
box-shadow: 0px 4rpx 12rpx 0px rgba(150, 149, 149, 0.3); |
|||
border-radius: 20rpx; |
|||
margin: auto; |
|||
padding: 27rpx 19rpx 0 19rpx; |
|||
font-size: 31rpx; |
|||
font-family: PingFang SC; |
|||
font-weight: bold; |
|||
color: #000000; |
|||
|
|||
.midBox { |
|||
padding: 26rpx 43rpx 21rpx 44rpx; |
|||
box-sizing: border-box; |
|||
|
|||
img { |
|||
width: 265rpx; |
|||
height: 252rpx; |
|||
border-radius: 15rpx; |
|||
} |
|||
} |
|||
|
|||
.botBox { |
|||
padding: 0 30rpx 0 51rpx; |
|||
font-size: 27rpx; |
|||
font-family: PingFang SC; |
|||
font-weight: bold; |
|||
color: #000000; |
|||
} |
|||
} |
|||
|
|||
.cygj { |
|||
width: 697rpx; |
|||
background: #FFFFFF; |
|||
border-radius: 20rpx; |
|||
margin: 30rpx auto 0; |
|||
padding: 0 27rpx; |
|||
font-size: 28rpx; |
|||
font-family: PingFang SC; |
|||
font-weight: 500; |
|||
color: #000000; |
|||
box-sizing: border-box; |
|||
|
|||
.cyItem { |
|||
height: 106rpx; |
|||
display: flex; |
|||
align-items: center; |
|||
border-bottom: 1rpx solid #D8D8D8; |
|||
|
|||
.headIcon { |
|||
width: 42rpx; |
|||
height: 42rpx; |
|||
margin-right: 15rpx; |
|||
} |
|||
|
|||
.rightIcon { |
|||
width: 20rpx; |
|||
height: 20rpx; |
|||
} |
|||
} |
|||
|
|||
.cyItem:last-child { |
|||
border: none; |
|||
} |
|||
} |
|||
|
|||
.my-swipe { |
|||
// width: 100%; |
|||
margin: 0 30rpx; |
|||
margin-top: 37.3rpx; |
|||
} |
|||
|
|||
swiper { |
|||
height: 111rpx !important; |
|||
} |
|||
|
|||
.dfkBox { |
|||
width: 100%; |
|||
height: 111rpx; |
|||
background: #F7F7F7; |
|||
margin: 0 auto 30.64rpx; |
|||
// padding: 0.25rem; |
|||
display: flex; |
|||
} |
|||
|
|||
.dfkBox image { |
|||
width: 137rpx; |
|||
height: 111rpx; |
|||
border-radius: 13rpx; |
|||
flex-shrink: 0; |
|||
// margin-right: 16.7rpx; |
|||
} |
|||
|
|||
.dfkBox .contentBox { |
|||
padding-left: 5rpx; |
|||
padding-right: 5rpx; |
|||
height: 111rpx; |
|||
width: 100%; |
|||
display: flex; |
|||
justify-content: space-around; |
|||
align-items: center; |
|||
} |
|||
|
|||
// .van-count-down{ |
|||
// font-size: 0.39rem; |
|||
// font-family: PingFang SC; |
|||
// font-weight: 400; |
|||
// color: #FB6E4D; |
|||
// } |
|||
|
|||
.orderBtn { |
|||
width: 152rpx; |
|||
height: 56rpx; |
|||
background: linear-gradient(270deg, #FC5109, #FDC43A); |
|||
; |
|||
border-radius: 28rpx; |
|||
text-align: center; |
|||
line-height: 56rpx; |
|||
font-size: 27rpx; |
|||
font-family: PingFang SC; |
|||
font-weight: 400; |
|||
color: #FFFFFF; |
|||
// margin-left: 50rpx; |
|||
// margin-right: 20rpx; |
|||
} |
|||
|
|||
#contact { |
|||
-webkit-tap-highlight-color: transparent; |
|||
background-color: rgba(0, 0, 0, 0); |
|||
border-radius: 0; |
|||
box-sizing: border-box; |
|||
color: transparent; |
|||
cursor: pointer; |
|||
overflow: hidden; |
|||
padding: 0 27rpx; |
|||
position: relative; |
|||
text-align: center; |
|||
text-decoration: none; |
|||
border: transparent 0px solid; |
|||
display: flex; |
|||
align-items: center; |
|||
font-size: 28rpx; |
|||
font-family: PingFang SC; |
|||
font-weight: 500; |
|||
color: #000000; |
|||
} |
|||
|
|||
button::after { |
|||
border: none; |
|||
background-color: rgba(0, 0, 0, 0); |
|||
} |
|||
|
|||
.more { |
|||
width: 100vw; |
|||
height: 100vh; |
|||
background-color: rgba(0, 0, 0, .5); |
|||
position: fixed; |
|||
top: 0; |
|||
left: 0; |
|||
display: flex; |
|||
flex-direction: column; |
|||
justify-content: space-around; |
|||
align-items: center; |
|||
|
|||
image { |
|||
width: 646rpx; |
|||
height: 959rpx; |
|||
} |
|||
|
|||
img { |
|||
width: 80rpx; |
|||
height: 80rpx; |
|||
} |
|||
} |
|||
|
|||
.consult-popup { |
|||
width: 487rpx; |
|||
height: 367rpx; |
|||
background: #F0F0F0; |
|||
border-radius: 20rpx; |
|||
padding: 65rpx 0 23rpx; |
|||
font-weight: bold; |
|||
font-size: 32rpx; |
|||
color: #000000; |
|||
text-align: center; |
|||
|
|||
.consult-subtitle { |
|||
font-weight: 500; |
|||
font-size: 27rpx; |
|||
color: #333333; |
|||
margin-top: 43rpx; |
|||
} |
|||
|
|||
.consult-btns { |
|||
display: flex; |
|||
margin-top: 75rpx; |
|||
|
|||
view { |
|||
width: 50%; |
|||
font-weight: bold; |
|||
font-size: 32rpx; |
|||
color: #00AEA0; |
|||
line-height: 54rpx; |
|||
} |
|||
view:first-child { |
|||
border-right: 1rpx solid #D8D8D8; |
|||
color: #000000; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.confirm{ |
|||
height: 58rpx; |
|||
line-height: 58rpx; |
|||
background: none; |
|||
font-weight: bold; |
|||
font-size: 32rpx; |
|||
color: #00AEA0; |
|||
} |
|||
</style> |
@ -1,8 +0,0 @@ |
|||
<template> |
|||
</template> |
|||
|
|||
<script> |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
@ -1,147 +0,0 @@ |
|||
<template> |
|||
<view class="bg"> |
|||
|
|||
<swiper class="swiper" :autoplay="true" :interval="3000" :duration="1000" circular indicator-dots indicator-color="rgba(255,255,255,.5)" |
|||
indicator-active-color="#fff" v-if="detail.images"> |
|||
<swiper-item v-for="(item, index) in detail.images.split(',')" :key="item.id"> |
|||
<view class="swiper-item"> |
|||
<image class="item-img" :src="showImg(item)" mode="aspectFill"></image> |
|||
</view> |
|||
</swiper-item> |
|||
</swiper> |
|||
|
|||
<view class="topBox"> |
|||
<view class="title text-overflowRows">{{detail.title}}</view> |
|||
<view class="flex-between"> |
|||
<view class="name"> |
|||
<image :src="showImg(detail.author_img)" mode=""></image> |
|||
{{detail.author}} |
|||
</view> |
|||
<view class="other-info"> |
|||
<image @click="likeAricle(detail)" v-if="detail.is_star" :src="showImg('/uploads/20250513/00b5680ca4b62479a59b40786979e3e2.png')" mode=""></image> |
|||
<image @click="likeAricle(detail)" v-else :src="showImg('/uploads/20250513/99e8d59b9692ae73b3204a6cec79611b.png')" mode=""></image> |
|||
<text style="padding-right: 36rpx;">{{handleNum(detail.star)}}</text> |
|||
<image :src="showImg('/uploads/20250513/71acef9a784095e9ba17c88580506705.png')" mode=""></image> |
|||
{{handleNum(detail.view)}} |
|||
</view> |
|||
</view> |
|||
|
|||
</view> |
|||
|
|||
<view class="content" v-html="formateRichText(detail.content)"></view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
detail: {} |
|||
} |
|||
}, |
|||
onLoad(option) { |
|||
this.Post({id: option.id},'/api/article/getArticleById').then(res => { |
|||
if (res.data.flag == 0) { |
|||
uni.showToast({title: '文章不存在或已下架',icon: 'none'}) |
|||
setTimeout(() => {this.goBack()}, 2000) |
|||
} |
|||
this.detail = res.data; |
|||
}); |
|||
}, |
|||
methods: { |
|||
likeAricle (item) { |
|||
this.Post({article_id: item.id},'/api/article/setArticleStar').then(res => { |
|||
if (res.code == 200 || res.code == 1) { |
|||
this.detail.is_star = !this.detail.is_star |
|||
if (this.detail.is_star) { |
|||
this.detail.star++ |
|||
} else { |
|||
this.detail.star-- |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
handleNum (num) { |
|||
if (num<=0) { return 0 } |
|||
if (num>=1000) { |
|||
return (num/1000).toFixed(1)+'k' |
|||
} |
|||
return num |
|||
}, |
|||
}, |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.bg { |
|||
width: 750rpx; |
|||
min-height: 100vh; |
|||
background: #FFFFFF; |
|||
padding-bottom: 100rpx; |
|||
} |
|||
|
|||
.swiper { |
|||
height: 408rpx; |
|||
|
|||
.swiper-item { |
|||
width: 100%; |
|||
height: 408rpx; |
|||
|
|||
.item-img { |
|||
width: 750rpx; |
|||
height: 408rpx; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.topBox { |
|||
width: 100%; |
|||
padding: 28rpx 32rpx; |
|||
|
|||
.title { |
|||
font-weight: 500; |
|||
font-size: 32rpx; |
|||
color: #000000; |
|||
} |
|||
.flex-between{ |
|||
padding: 28rpx 0; |
|||
border-bottom: 2rpx solid #F7F7F7; |
|||
} |
|||
|
|||
.name { |
|||
font-weight: 400; |
|||
font-size: 24rpx; |
|||
color: #000000; |
|||
display: flex; |
|||
align-items: center; |
|||
|
|||
|
|||
image { |
|||
width: 48rpx; |
|||
height: 48rpx; |
|||
// border-radius: 50%; |
|||
margin-right: 12rpx; |
|||
} |
|||
} |
|||
|
|||
.other-info{ |
|||
display: flex; |
|||
align-items: center; |
|||
font-weight: 400; |
|||
font-size: 24rpx; |
|||
color: #848484; |
|||
|
|||
image{ |
|||
width: 32rpx; |
|||
height: 32rpx; |
|||
margin-right: 8rpx; |
|||
} |
|||
} |
|||
} |
|||
|
|||
.content { |
|||
width: 100%; |
|||
background: #FFFFFF; |
|||
padding:0 28rpx; |
|||
} |
|||
</style> |
@ -1,151 +0,0 @@ |
|||
<template> |
|||
<view class="bg"> |
|||
<img :src="showImg(headImg)" class="topImg" /> |
|||
|
|||
<div class="article-container"> |
|||
<view @click="viewDetail(item)" v-for="(item,index) in list" :key="index" class="item"> |
|||
<image class="img" :src="showImg(item.image)" mode="aspectFill"></image> |
|||
<view class="content flex-column"> |
|||
<view class="title text-overflowRows">{{item.title}}</view> |
|||
<view class="text-overflow" style="font-size: 24rpx;color: #848484;">{{item.subtitle}}</view> |
|||
<view class="subtitle flex-between"> |
|||
<view style="color: #000000;"> |
|||
<image style="width: 48rpx;height:48rpx" :src="showImg(item.author_img)" mode=""></image> |
|||
{{item.author}} |
|||
</view> |
|||
<view> |
|||
<image @click="likeAricle(item)" v-if="item.is_like" :src="showImg('/uploads/20250513/00b5680ca4b62479a59b40786979e3e2.png')" mode=""></image> |
|||
<image @click="likeAricle(item)" v-else :src="showImg('/uploads/20250513/99e8d59b9692ae73b3204a6cec79611b.png')" mode=""></image> |
|||
<text style="padding-right: 36rpx;">{{handleNum(item.star)}}</text> |
|||
<image :src="showImg('/uploads/20250513/71acef9a784095e9ba17c88580506705.png')" mode=""></image> |
|||
{{handleNum(item.view)}} |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</div> |
|||
|
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
list: [], |
|||
finished: false, |
|||
headImg: '' |
|||
} |
|||
}, |
|||
onReady() { |
|||
this.getArticleByType() |
|||
this.getHeadImg(10212).then(res => {this.headImg = res}) |
|||
}, |
|||
methods: { |
|||
// 游记攻略 |
|||
getArticleByType() { |
|||
this.Post({ |
|||
type_id: 1, |
|||
offset: this.list.length, |
|||
limit: 10 |
|||
},'/api/Article/getArticleByType').then(res => { |
|||
if (res.data.length < 10) { |
|||
this.finished = true |
|||
} |
|||
this.list = [...this.list, ...res.data] |
|||
}) |
|||
}, |
|||
likeAricle (item) { |
|||
|
|||
}, |
|||
viewDetail(item) { |
|||
if (item.url) { |
|||
uni.navigateTo({ |
|||
url:"/subPackages/webPage/webPage?url="+encodeURIComponent(item.url) |
|||
}) |
|||
return |
|||
} |
|||
uni.navigateTo({ |
|||
url:'/subPackages/letter/detail?id='+item.id |
|||
}) |
|||
}, |
|||
handleNum (num) { |
|||
if (num<=0) { return 0 } |
|||
if (num>=1000) { |
|||
return (num/1000).toFixed(1)+'k' |
|||
} |
|||
return num |
|||
}, |
|||
}, |
|||
//下拉触底事件 |
|||
onReachBottom() { |
|||
setTimeout(() => { |
|||
if (!this.finished) this.getArticleByType(); |
|||
}, 1000); |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.bg { |
|||
width: 750rpx; |
|||
min-height: 100vh; |
|||
background: #FFFFFF; |
|||
padding-bottom: 50rpx; |
|||
} |
|||
|
|||
.topImg { |
|||
width: 100%; |
|||
height: 380rpx; |
|||
} |
|||
|
|||
.article-container{ |
|||
margin-top: -22rpx; |
|||
width: 100%; |
|||
background: #FFFFFF; |
|||
border-radius: 24rpx ; |
|||
position: relative; |
|||
padding: 32rpx; |
|||
} |
|||
|
|||
.item { |
|||
width: 100%; |
|||
height: 198rpx; |
|||
margin-bottom:30rpx; |
|||
display: flex; |
|||
|
|||
.img { |
|||
width: 208rpx; |
|||
height: 198rpx; |
|||
border-radius: 24rpx; |
|||
flex-shrink: 0; |
|||
} |
|||
|
|||
.content { |
|||
width: 370rpx; |
|||
flex: 1; |
|||
height: 198rpx; |
|||
padding: 12rpx 0 0 24rpx; |
|||
justify-content: space-between; |
|||
|
|||
.title { |
|||
font-weight: 400; |
|||
font-size: 28rpx; |
|||
color: #000000; |
|||
} |
|||
|
|||
.subtitle { |
|||
font-weight: 500; |
|||
font-size: 27rpx; |
|||
color: #848484; |
|||
|
|||
image { |
|||
width: 32rpx; |
|||
height: 32rpx; |
|||
margin-right: 6rpx; |
|||
vertical-align: middle; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</style> |
@ -1,115 +0,0 @@ |
|||
<template> |
|||
<view class="bg"> |
|||
<image :src="showImg(headImg)" mode="aspectFill" class="topImg"></image> |
|||
|
|||
<view class="box"> |
|||
<view v-for="(item,index) in list" :key="index" class="item" @click="gotoVideo(item)"> |
|||
<view style="display: flex;align-items: center;"> |
|||
<image :src="showImg(item.author_img)" mode="aspectFill" class="profile"></image> |
|||
<view class="name">{{item.author}}</view> |
|||
</view> |
|||
<view class="title"> |
|||
{{item.title}} |
|||
</view> |
|||
<view class="video-box" :style="{backgroundImage: 'url('+showImg(item.image)+')'}"> |
|||
<image src="https://static.ticket.sz-trip.com/cgc/images/index/plays.png" mode="" class="play"></image> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
list: [], |
|||
headImg: '', |
|||
} |
|||
}, |
|||
onReady() { |
|||
this.getHeadImg(10213).then(res => {this.headImg = res}) |
|||
this.Post({ |
|||
type_id: 2, |
|||
offset: 0, |
|||
limit: 100 |
|||
}, '/api/article/getArticleByType').then(res => { |
|||
if(res.data) { |
|||
this.list = res.data |
|||
} |
|||
}) |
|||
}, |
|||
methods: { |
|||
gotoVideo(item) { |
|||
uni.navigateTo({ |
|||
url: '/subPackages/video/video?item=' + encodeURIComponent(JSON.stringify(item)) |
|||
}) |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.bg { |
|||
min-height: 100vh; |
|||
background: #FFFFFF; |
|||
padding-bottom: 100rpx; |
|||
} |
|||
|
|||
.topImg { |
|||
width: 750rpx; |
|||
height: 380rpx; |
|||
} |
|||
|
|||
.box { |
|||
margin-top: -24rpx; |
|||
border-radius: 24rpx 24rpx 0 0; |
|||
padding: 0 32rpx; |
|||
|
|||
.item { |
|||
padding: 32rpx 0; |
|||
|
|||
.profile { |
|||
width: 48rpx; |
|||
height: 48rpx; |
|||
border-radius: 50%; |
|||
margin-right: 16rpx; |
|||
} |
|||
.name { |
|||
font-weight: 500; |
|||
font-size: 28rpx; |
|||
color: #000000; |
|||
} |
|||
|
|||
.title { |
|||
font-weight: 400; |
|||
font-size: 28rpx; |
|||
color: #000000; |
|||
margin-top: 24rpx; |
|||
} |
|||
|
|||
.video-box { |
|||
width: 686rpx; |
|||
height: 372rpx; |
|||
border-radius: 32rpx; |
|||
margin-top: 20rpx; |
|||
background-size: 100% 100%; |
|||
position: relative; |
|||
|
|||
.play { |
|||
position: absolute; |
|||
top: 0; |
|||
bottom: 0; |
|||
left: 0; |
|||
right: 0; |
|||
margin: auto; |
|||
width: 56rpx; |
|||
height: 56rpx; |
|||
} |
|||
} |
|||
} |
|||
.item:nth-child(n+2) { |
|||
border-top: 2rpx solid rgba(0,0,0,0.05); |
|||
} |
|||
} |
|||
</style> |
@ -1,89 +0,0 @@ |
|||
<template> |
|||
<view class="bg"> |
|||
<view class="nickname-box"> |
|||
<input v-model="nickname" type="text" placeholder="请输入内容" /> |
|||
</view> |
|||
<view class="btn" @click="save">保存</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: "changeNickname", |
|||
data: function() { |
|||
return { |
|||
nickname: "" |
|||
} |
|||
}, |
|||
methods: { |
|||
save: function() { |
|||
if (!this.nickname) { |
|||
uni.showToast({ |
|||
title: '请输入昵称', |
|||
icon: 'none' |
|||
}) |
|||
return; |
|||
} |
|||
this.Post({ |
|||
nickname: this.nickname |
|||
}, '/api/user/profile').then(res => { |
|||
console.log(res) |
|||
if (res.code == 1 || res.code == 200) { |
|||
uni.showModal({ |
|||
title: '提示', |
|||
content: '保存成功!', |
|||
success: res => { |
|||
if (res.confirm) { |
|||
this.goBack() |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.bg { |
|||
min-height: 100vh; |
|||
padding-top: 50rpx; |
|||
} |
|||
|
|||
.nickname-box { |
|||
display: flex; |
|||
padding: 10rpx 0 30rpx; |
|||
margin: 0 30rpx; |
|||
align-items: center; |
|||
background: white; |
|||
margin-bottom: 100rpx; |
|||
font-size: 30rpx; |
|||
height: 70rpx; |
|||
border-bottom: 1rpx solid #D8D8D8; |
|||
} |
|||
|
|||
.nickname-box span { |
|||
flex-shrink: 0; |
|||
} |
|||
|
|||
.nickname-box input { |
|||
flex: 1; |
|||
font-size: 30rpx; |
|||
display: block; |
|||
} |
|||
|
|||
.btn { |
|||
color: black; |
|||
margin: 0 auto; |
|||
line-height: 80rpx; |
|||
position: relative; |
|||
font-size: 34rpx; |
|||
text-align: center; |
|||
width: 333rpx; |
|||
height: 80rpx; |
|||
background: #C3282E; |
|||
border-radius: 40rpx; |
|||
color: #FFFFFF; |
|||
} |
|||
</style> |
@ -1,387 +0,0 @@ |
|||
<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-input" 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: 33rpx;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="#6CA5AA"/> |
|||
</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) { |
|||
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){ |
|||
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: 31rpx; |
|||
text-align: right; |
|||
font-weight: 500; |
|||
} |
|||
|
|||
.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: #6CA5AA; |
|||
border-radius: 37rpx; |
|||
justify-content: center; |
|||
align-items: center; |
|||
margin-top: 650rpx; |
|||
} |
|||
</style> |
@ -1,58 +0,0 @@ |
|||
<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:'10202 '}], |
|||
} |
|||
}, |
|||
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> |
@ -1,30 +0,0 @@ |
|||
<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> |
@ -1,407 +0,0 @@ |
|||
<template> |
|||
<view v-if="info"> |
|||
<view class="user-other-info"> |
|||
<div class="info-avatar-top"> |
|||
<span>头像</span> |
|||
<view @click="uploadImg()"> |
|||
<image :src="showImg(info.avatar)" mode="aspectFill" |
|||
style="width: 80rpx;height: 80rpx;border-radius: 50%;"></image> |
|||
</view> |
|||
</div> |
|||
<navigator url="/subPackages/user/changeNickname" tag="view" class="userinfo-item"> |
|||
<span>昵称</span> |
|||
<view>{{nickname}}</view> |
|||
</navigator> |
|||
<!-- <view class="userinfo-item" @click="showSexSelect = true"> |
|||
<span>性别</span> |
|||
<view @click="$refs.popup.open()">{{gender == 1 ? '男' : (gender == 2 ? '女' : '保密')}}</view> |
|||
</view> --> |
|||
<view class="userinfo-item"> |
|||
<span>手机号</span> |
|||
<view>{{info.mobile}}</view> |
|||
</view> |
|||
<!-- <view class="userinfo-item"> |
|||
<span>生日</span> |
|||
<picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindDateChange"> |
|||
<view class="uni-input">{{birthday}}</view> |
|||
</picker> |
|||
</view> |
|||
<navigator url="/subPackages/user/logout" tag="view" class="userinfo-item"> |
|||
<span>注销账号</span> |
|||
<i>注销后账号无法恢复,请谨慎操作</i> |
|||
</navigator> --> |
|||
<!-- <view class="btn-tao" @click="submit">保存</view> --> |
|||
</view> |
|||
|
|||
<!-- 性别弹框 --> |
|||
<uni-popup ref="popup" type="bottom"> |
|||
<view class="popup-box"> |
|||
<view class="popup-item flex-center" v-for="(item,index) in sexes" :key="index" @click="changesex(index)">{{item.text}}</view> |
|||
<view class="popup-items flex-center" @click="$refs.popup.close()">取消</view> |
|||
</view> |
|||
</uni-popup> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import {pathToBase64} from "@/static/js/mmmm-image-tools/index.js" |
|||
export default { |
|||
name: "Profile", |
|||
data() { |
|||
const currentDate = this.getDate({ |
|||
format: true |
|||
}) |
|||
return { |
|||
date: currentDate, |
|||
info: null, |
|||
showSexSelect: false, |
|||
sexes: [{ |
|||
value: '1', |
|||
text: '男' |
|||
}, |
|||
{ |
|||
value: '2', |
|||
text: '女' |
|||
}, |
|||
{ |
|||
value: '0', |
|||
text: '保密' |
|||
} |
|||
], |
|||
today: null, |
|||
showCropper: false, |
|||
nickname: '', |
|||
gender: '', |
|||
birthday: '', |
|||
email: '', |
|||
fileList1: [], |
|||
startDate: '1900-1-1', |
|||
endDate: '2050-1-1' |
|||
} |
|||
}, |
|||
onShow() { |
|||
console.log(this.$store.state.user.userInfo,uni.getStorageSync('userInfo')) |
|||
this.getList() |
|||
}, |
|||
computed: { |
|||
// startDate() { |
|||
// return this.getDate('start'); |
|||
// }, |
|||
// endDate() { |
|||
// return this.getDate('end'); |
|||
// } |
|||
}, |
|||
methods: { |
|||
getFile(e) { |
|||
console.log(e) |
|||
}, |
|||
getList() { |
|||
let today = new Date(); |
|||
today = today.getFullYear() + "/" + (today.getMonth() + 1) + "/" + today.getDate(); |
|||
this.today = today; |
|||
this.Post({}, "/api/user/userInfo").then(res => { |
|||
if (!res.data.birthday) { |
|||
let date = new Date(); |
|||
res.data.birthday = date.getFullYear() + "/" + (date.getMonth() + 1) + "/" + date |
|||
.getDate(); |
|||
} |
|||
this.info = res.data; |
|||
this.nickname = this.info.nickname |
|||
this.email = this.info.email |
|||
this.birthday = this.info.birthday |
|||
this.gender = this.info.gender |
|||
this.info.token = JSON.parse(uni.getStorageSync('userInfo')).token || this.$store.state.user.userInfo.token |
|||
console.log(this.info) |
|||
this.$store.commit('changeUserInfo', this.info) |
|||
}) |
|||
}, |
|||
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() |
|||
} |
|||
} |
|||
}) |
|||
}) |
|||
} |
|||
}) |
|||
}) |
|||
} |
|||
}); |
|||
}, |
|||
//生日 |
|||
bindDateChange: function(e) { |
|||
this.birthday = e.detail.value |
|||
}, |
|||
getDate(type) { |
|||
const date = new Date(); |
|||
let year = date.getFullYear(); |
|||
let month = date.getMonth() + 1; |
|||
let day = date.getDate(); |
|||
|
|||
if (type === 'start') { |
|||
year = year - 60; |
|||
} else if (type === 'end') { |
|||
year = year + 2; |
|||
} |
|||
month = month > 9 ? month : '0' + month; |
|||
day = day > 9 ? day : '0' + day; |
|||
return `${year}/${month}/${day}`; |
|||
}, |
|||
changesex(index) { |
|||
this.gender = this.sexes[index].value |
|||
this.$refs.popup.close() |
|||
}, |
|||
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; |
|||
} |
|||
.info-avatar-top { |
|||
display: flex; |
|||
justify-content: space-between; |
|||
font-size: 30rpx; |
|||
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: 30rpx; |
|||
} |
|||
|
|||
.userinfo-item { |
|||
display: flex; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
font-size: 30rpx; |
|||
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; |
|||
} |
|||
|
|||
.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: #C3282E; |
|||
border-radius: 40rpx; |
|||
line-height: 80rpx; |
|||
color: #FFFFFF; |
|||
position: fixed; |
|||
left: 26rpx; |
|||
bottom: 100rpx; |
|||
} |
|||
|
|||
.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> |
@ -1,339 +0,0 @@ |
|||
<template> |
|||
<view class="bg"> |
|||
<!-- <view class="cancat-nav flex-around"> |
|||
<view :class="['concat-nav-item',showType===0?'active':'']" @click="showType=0"> |
|||
<view>出行人信息</view> |
|||
<view v-if="showType===0" class="active-bar"></view> |
|||
</view> |
|||
<view :class="['concat-nav-item',showType===1?'active':'']" @click="showType=1"> |
|||
<view>收货地址</view> |
|||
<view v-if="showType===1" class="active-bar"></view> |
|||
</view> |
|||
</view> --> |
|||
|
|||
<!-- 出行人信息 --> |
|||
<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}} |
|||
<span v-if="item.is_default==1">默认</span> |
|||
</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> |
|||
|
|||
<script> |
|||
export default { |
|||
name: "travelerList", |
|||
data() { |
|||
return { |
|||
showType: 1, |
|||
travelList: [], |
|||
addressList: [] |
|||
}; |
|||
}, |
|||
onShow() { |
|||
this.init() |
|||
}, |
|||
methods: { |
|||
init () { |
|||
// 出行人信息 |
|||
// 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.init() |
|||
}) |
|||
} 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 |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.bg { |
|||
position: relative; |
|||
background: #F7F7F7; |
|||
height: 100vh; |
|||
overflow-x: hidden; |
|||
padding-bottom: 200rpx; |
|||
} |
|||
|
|||
.cancat-nav{ |
|||
width: 100%; |
|||
display: flex; |
|||
height: 112rpx; |
|||
flex-shrink: 0; |
|||
background-color: #fff; |
|||
.concat-nav-item{ |
|||
ffont-weight: 500; |
|||
font-size: 35rpx; |
|||
color: #000000; |
|||
height: 100%; |
|||
text-align: center; |
|||
position: relative; |
|||
padding-top: 35rpx; |
|||
} |
|||
.concat-nav-item.active{ |
|||
color: #000000; |
|||
} |
|||
.active-bar{ |
|||
width: 73rpx; |
|||
height: 7rpx; |
|||
background: #515150; |
|||
border-radius: 3rpx; |
|||
margin: auto; |
|||
position: absolute; |
|||
bottom: 0; |
|||
left: 0; |
|||
right: 0; |
|||
} |
|||
} |
|||
|
|||
.item { |
|||
width: 697rpx; |
|||
background: #FFFFFF; |
|||
border-radius: 13rpx; |
|||
margin: 28rpx auto 0; |
|||
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: #515150; |
|||
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: #6CA5AA; |
|||
border-radius: 37rpx; |
|||
font-weight: 500; |
|||
font-size: 36rpx; |
|||
color: #fff; |
|||
text-align: center; |
|||
position: fixed; |
|||
bottom: 53rpx; |
|||
left: 26.67rpx; |
|||
} |
|||
} |
|||
</style> |
Loading…
Reference in new issue