jiazhipeng 5 months ago
parent
commit
b11511591a
  1. 25
      pages.json
  2. 411
      pages/index/index.vue
  3. 651
      pages/user/user.vue
  4. BIN
      static/images/home.png
  5. BIN
      static/images/mine.png
  6. BIN
      static/images/selectHome.png
  7. BIN
      static/images/selectMine.png
  8. 103
      static/js/request.js
  9. 680
      subPackages/order/trades.vue
  10. 58
      subPackages/user/privacy.vue
  11. 30
      subPackages/user/privacyInfo.vue

25
pages.json

@ -9,7 +9,8 @@
{
"path": "pages/user/user",
"style": {
"navigationBarTitleText": "大美非遗"
"navigationBarTitleText": "我的",
"navigationStyle": "custom"
}
}
],
@ -22,6 +23,24 @@
"navigationBarTitleText": "uni-app"
}
},
{
"path" : "user/privacy",
"style" : {
"navigationBarTitleText" : "详情"
}
},
{
"path" : "user/privacyInfo",
"style" : {
"navigationBarTitleText" : "详情"
}
},
{
"path" : "order/trades",
"style" : {
"navigationBarTitleText" : "全部订单"
}
},
{
"path": "techan/index",
"style": {
@ -44,8 +63,8 @@
]
}],
"tabBar": {
"color": "#999999",
"selectedColor": "#333333",
"color": "#333333",
"selectedColor": "#6CA5AA",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"fontSize": "24rpx",

411
pages/index/index.vue

@ -1,6 +1,81 @@
<template>
<view class="content">
<!-- 头部banner -->
<view class="top-box">
<!-- 搜索 -->
<view class="search-box">
<image src="https://static.ticket.sz-trip.com/cgc/images/index/search.png" mode=""></image>
<span>|</span>
搜一搜您想要的
</view>
<swiper class="top-banner" :circular="true" :interval="6000"
:duration="800" :indicator-dots="false" :autoplay="true" v-if="topBanner">
<swiper-item v-for="(item, index) in topBanner" :key="index" @click.stop="gotoUrlNew(item)">
<image class="top-banner" :src="showImg(item.head_img)" mode="aspectFill" lazy-load="true"></image>
</swiper-item>
</swiper>
</view>
<!-- 金刚区 -->
<view class="menu-box flex-between">
<view class="menu-left flex-around">
<view class="" v-for="(item,index) in menuList" :key="index">
<image :src="`https://static.ticket.sz-trip.com/cgc/images/index/${index + 1}.png`" class="topImg" mode="heightFix"></image>
<image :src="`https://static.ticket.sz-trip.com/cgc/images/index/${index + 1}s.png`" class="titleImg" mode="heightFix"></image>
</view>
</view>
<view class="menu-right flex-around">
<swiper class="menu-right" :circular="true" :interval="6000"
:duration="800" :indicator-dots="false" :autoplay="true" v-if="topBanner">
<swiper-item v-for="(item, index) in topBanner" :key="index" @click.stop="gotoUrlNew(item)">
<image class="menu-right" :src="showImg(item.head_img)" mode="aspectFill" lazy-load="true"></image>
</swiper-item>
</swiper>
</view>
</view>
<!-- 非遗手札 -->
<view class="title-box flex-between">
<image src="https://static.ticket.sz-trip.com/cgc/images/index/title1.png" mode=""></image>
<image src="https://static.ticket.sz-trip.com/cgc/images/index/more.png" mode=""></image>
</view>
<view class="handwritten-box flex-between">
<image :src="showImg(item.head_img)" mode="aspectFill" v-for="(item,index) in handwrittenList" :key="index"></image>
</view>
<!-- 非遗时光 -->
<view class="title-box flex-between">
<image src="https://static.ticket.sz-trip.com/cgc/images/index/title2.png" mode=""></image>
<image src="https://static.ticket.sz-trip.com/cgc/images/index/more.png" mode=""></image>
</view>
<view class="time-box" style="background-image: url('https://static.ticket.sz-trip.com/uploads/20230920/7cdb05709d09cc2c86ea5671bd657c85.jpg')">
<image src="https://static.ticket.sz-trip.com/cgc/images/index/play.png" class="play"></image>
</view>
<!-- 底部推荐 -->
<view class="hot-type flex-around">
<view v-for="(item,index) in hotType" :key="index" :class="{'hot-active': index == hotIndex}" @click="changeType(index)">
{{item.title}}
</view>
</view>
<view class="hot-box">
<view class="hot-column" v-for="(column, index) in 2" :key="index">
<view v-for="(item,indexs) in getColumnItems(index)" :key="indexs" class="hot-item" @click="gotoHotDetail(item)">
<view class="image-container">
<image :src="item.src" mode="widthFix" class="hot-img" lazy-load="true"></image>
<image src="https://static.ticket.sz-trip.com/cgc/images/index/plays.png" mode="widthFix" class="play-img" v-if="hotIndex" lazy-load="true"></image>
</view>
<view class="hot-content">
<view class="title text-overflowRows">{{item.title || item.name}}</view>
<view class="subtitle" v-if="hotIndex">
<image :src="item.src" mode="aspectFill"></image>
{{item.author}}
</view>
</view>
</view>
</view>
</view>
</view>
</template>
@ -8,16 +83,135 @@
export default {
data() {
return {
topBanner: [
{
head_img: 'https://static.ticket.sz-trip.com/uploads/20230920/7cdb05709d09cc2c86ea5671bd657c85.jpg'
},
{
head_img: 'https://changshu.js-dyyj.com/uploads/20250418/8a7631a1955ca05e619c0a25ad5ac1d1.jpg'
}
],
menuList: [
{
path: ''
},
{
path: ''
},
{
path: ''
},
{
path: ''
},
{
path: ''
},
{
path: ''
}
],
handwrittenList: [
{head_img: 'https://static.ticket.sz-trip.com/uploads/20230920/7cdb05709d09cc2c86ea5671bd657c85.jpg'},
{head_img: 'https://static.ticket.sz-trip.com/uploads/20230920/7cdb05709d09cc2c86ea5671bd657c85.jpg'},
{head_img: 'https://static.ticket.sz-trip.com/uploads/20230920/7cdb05709d09cc2c86ea5671bd657c85.jpg'},
{head_img: 'https://static.ticket.sz-trip.com/uploads/20230920/7cdb05709d09cc2c86ea5671bd657c85.jpg'},
],
hotType: [
{
title: '好物推荐',
id: '41'
},
{
title: '猜你喜欢',
id: '41'
}
],
hotIndex: 0,
hotList: [],
isLoading: false,
limit: 4
}
},
onLoad() {
},
onReady() {
//
if(!uni.getStorageSync('location')) {
this.getLocation()
}
this.changeType(0)
},
onReachBottom() {
setTimeout(() => {
if (!this.isLoading) this.getHotList();
}, 1000);
},
methods: {
//
getColumnItems(columnIndex) {
const columnItems = [];
this.hotList.forEach((item, index) => {
switch (this.hotIndex) {
case 1:
item.src = this.showImg(item.image);
break;
default:
item.src = this.showImg(item.image);
}
if (index % 2 === columnIndex) {
columnItems.push(item);
}
});
return columnItems;
},
//
changeType(index) {
this.hotIndex = index
this.isLoading = false
this.hotList = []
this.getHotList()
},
getHotList() {
if(this.typeIndex == 1) {
this.Post({
type_id: this.hotType[this.hotIndex].id,
offset: this.hotList.length,
limit: this.limit
},'/api/Article/getArticleByType').then(res => {
if(res) {
if(res.data.length < this.limit) this.isLoading = true
this.hotList = this.hotList.concat(res.data)
}
})
}else {
this.Post({
type_id: this.hotType[this.hotIndex].id,
offset: this.hotList.length,
limit: this.limit
},'/api/Article/getArticleByType').then(res => {
if(res) {
if(res.data.length < this.limit) this.isLoading = true
this.hotList = this.hotList.concat(res.data)
}
})
}
},
gotoHotDetail(item) {
if(this.typeIndex == 1) {
//
uni.navigateTo({
url: '/subPackages/video/video?item=' + encodeURIComponent(JSON.stringify(item))
})
}else {
}
}
}
}
</script>
<style lang="scss" scoped>
@ -26,4 +220,219 @@
background: #F9F0EA;
padding: 21rpx 0 50rpx;
}
.top-box {
width: 684rpx;
height: 451rpx;
border-radius: 30rpx;
overflow: hidden;
position: relative;
margin: auto;
.top-banner {
width: 100%;
height: 100%;
}
.search-box {
width: 632rpx;
height: 40rpx;
background: #FFFFFF;
border-radius: 20rpx;
position: absolute;
z-index: 1000;
top: 31rpx;
left: 26rpx;
display: flex;
align-items: center;
font-weight: 500;
font-size: 24rpx;
color: #7B7C7D;
padding-left: 21rpx;
image {
width: 29rpx;
height: 28rpx;
}
span {
padding: 0 15rpx;
}
}
}
.menu-box {
margin: 54rpx 33rpx 0;
.menu-left {
flex-wrap: wrap;
&>view {
width: 33%;
display: flex;
flex-direction: column;
align-items: center;
}
&>view:nth-child(n+4) {
margin-top: 36rpx;
}
.topImg {
height: 108rpx;
}
.titleImg {
height: 22rpx;
margin-top: 8rpx;
}
}
.menu-right {
width: 254rpx;
height: 323rpx;
border-radius: 20rpx;
}
}
.title-box {
margin: 60rpx 44rpx 21rpx 50rpx;
align-items: flex-end;
&>image {
width: 350rpx;
height: 32rpx;
}
&>image:last-child {
width: 59rpx;
height: 20rpx;
}
}
.handwritten-box {
margin: 0 46rpx;
flex-wrap: wrap;
image {
width: 322rpx;
height: 181rpx;
border-radius: 10rpx;
}
&>image:nth-child(n+3) {
margin-top: 13rpx;
}
}
.time-box {
background-size: 100% 100%;
width: 657rpx;
height: 370rpx;
border-radius: 30rpx;
margin: 23rpx auto 0;
position: relative;
.play {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 90rpx;
height: 90rpx;
}
}
.hot-type {
height: 122rpx;
font-weight: bold;
font-size: 32rpx;
color: #B5B5B6;
&>view {
position: relative;
}
&>view::after {
content: "";
position: absolute;
left: 0;
right: 0;
bottom: -10rpx;
background-color: #B5B5B6;
margin: 0 auto;
width: 32rpx;
height: 4rpx;
}
.hot-active {
color: #000000;
}
.hot-active::after {
background-color: #000000;
}
}
.hot-box {
margin: 0 48rpx;
display: flex;
justify-content: space-between;
.hot-column {
width: 319rpx;
display: flex;
flex-direction: column;
}
.hot-item {
width: 319rpx;
background: #FFFFFF;
border-radius: 20rpx;
overflow: hidden;
margin-bottom: 13rpx;
.image-container {
position: relative;
.hot-img {
width: 319rpx;
}
.play-img {
width: 66.67rpx;
height: 66.67rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
.hot-content {
padding: 15rpx;
.title {
font-weight: bold;
font-size: 26rpx;
color: #000000;
}
.subtitle {
margin-top: 20rpx;
font-weight: 400;
font-size: 24rpx;
color: #000000;
display: flex;
align-items: center;
image {
width: 48rpx;
height: 48rpx;
border-radius: 50%;
border: 1rpx solid #000000;
display: block;
margin-right: 15rpx;
}
}
}
}
}
</style>

651
pages/user/user.vue

@ -1,8 +1,657 @@
<template>
<view class="bg">
<view class="title">我的</view>
<view class="topBox">
<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" @click="gotoProfile">
个人中心
</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:0013: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: '',
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: '',
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) {
uni.navigateTo({
url: "/subPackages/order/trades?type=" + item.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>
<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>

BIN
static/images/home.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
static/images/mine.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
static/images/selectHome.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
static/images/selectMine.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 10 KiB

103
static/js/request.js

@ -1,58 +1,77 @@
import Vue from 'vue'
import store from '@/store'
import Vue from 'vue';
import store from '@/store';
let NEWAPIURL = 'https://tlgz.sz-trip.com'
Vue.prototype.NEWAPIURL = NEWAPIURL
// 定义 API URL
const DEV_API_URL = 'https://tlgz.sz-trip.com';
const PROD_API_URL = 'https://tlgz.sz-trip.com';
const NEWAPIURL = process.env.NODE_ENV === 'development' ? DEV_API_URL : PROD_API_URL;
Vue.prototype.Post = (params, apiurl) => {
if (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo')).token) params.token = JSON.parse(uni.getStorageSync('userInfo')).token
else if (store.state.user.userInfo.token) params.token = store.state.user.userInfo.token
params.token = "aa3940ea-57f5-412e-9803-4035d5115994"
// 获取token
const getToken = () => {
const userInfoFromStorage = uni.getStorageSync('userInfo');
if (userInfoFromStorage) {
const userInfo = JSON.parse(userInfoFromStorage);
if (userInfo.token) {
return userInfo.token;
}
}
return store.state.user.userInfo.token;
};
// 定义错误处理函数
const handleError = (res, reject) => {
setTimeout(() => {
uni.showToast({
title: res.data?.msg || res.msg,
icon: 'none'
});
reject(res);
}, 0);
if (res.data?.code === 401) {
store.commit('changeLoginPath');
}
};
// 挂载到 Vue 原型上
Vue.prototype.NEWAPIURL = NEWAPIURL;
// #ifdef H5
Vue.prototype.NEWAPIURL = '/api';
// #endif
Vue.prototype.Post = (params = {}, apiurl) => {
const token = getToken() || '92f610cd-381e-4135-ac27-fc5671af8495';
if (token) {
params.token = token;
}
return new Promise((resolve, reject) => {
uni.showLoading({
title: '加载中'
})
});
uni.request({
method: params.method || 'GET',
url: NEWAPIURL + apiurl,
data: params || {},
header: params.header || {
url: Vue.prototype.NEWAPIURL + apiurl,
data: params,
header: {
'content-type': 'application/json',
'token': params.token || ''
'token': token || ''
},
success: res => {
success: (res) => {
console.log('success', res.data);
uni.hideLoading()
if (res.data.code === 1) {
resolve(res.data)
if (res.data.code === 200 || res.data.code === 1) {
resolve(res.data);
} else {
setTimeout(() => {
uni.showToast({
title: res.data.msg,
icon: 'none'
})
reject(null)
}, 0)
if (res.data.code === 401) {
store.commit('changeLoginPath')
}
handleError(res, reject);
}
},
fail: err => {
console.log('err', err)
fail: (err) => {
console.log('err', err);
uni.hideLoading()
setTimeout(() => {
uni.showToast({
title: err.msg || err.data.msg,
icon: 'none'
})
}, 0)
if (err.data.code === 401) {
store.commit('changeLoginPath')
}
reject(err)
}
})
})
handleError(err, reject);
}
});
});
};
export default NEWAPIURL;
export default NEWAPIURL

680
subPackages/order/trades.vue

@ -0,0 +1,680 @@
<template>
<view class="bg">
<view class="top-bg">
<view class="search-box">
<view class="left">
<image src="https://static.ticket.sz-trip.com/yandu/images/eventCalendar/search.png"
mode="aspectFill"></image>
<input v-model="keywords" type="text" placeholder="请输入关键字" @confirm="search()" />
</view>
<!-- <view class="btn" @click="search()">搜索</view> -->
</view>
<view class="common-box">
<view class="common-types com-flex-tao">
<view @click="setType(index)" v-for="(item, index) in typeList" :key="item.id"
:class="['common-type', typeIndex == index ? 'active' : '']">
{{ item.name }}
</view>
</view>
</view>
</view>
<view class="list-common-empty" v-if="list.length == 0">
<img :src="showImg('/uploads/20221201/8f97261b8eddffcc55342eca0ed0249c.png')" />
<p class="list-common-empty-tip">暂无订单~</p>
</view>
<view class="trade-list" v-if="list.length > 0">
<view v-for="(item, key) in list" :key="item.id" class="trade-items" v-if="showItem(item)"
@click="() => choseType(item)">
<view class="trade-item-head">
<view class="trade-item-head-tid">订单号:{{ item.order_id }}</view>
<view class="trade-item-head-state">{{ item.status_text }}</view>
</view>
<view class="trade-item-pros">
<view class="trade-item-pro" v-for="(pro, proIndex) in item.order_child" :key="pro.child_id">
<view class="trade-item-pro-img" v-if="pro.specifications_image">
<image :src="showImg(pro.specifications_image)" mode="aspectFill"></image>
</view>
<view style="flex: 1;">
<view class="trade-item-pro-title">{{ pro.goods_title }}</view>
<view class="trade-item-pro-subtitle">{{ pro.specifications_name }}</view>
</view>
<view class="trade-item-pro-price">
<view class="trade-item-pro-price-pri">{{ pro.pay_money / 100 }}</view>
<view class="trade-item-pro-num">x{{ pro.num }}</view>
</view>
</view>
</view>
<view class="trade-item-info">
合计
<text>{{ item.pay_money / 100 }}</text>
</view>
<view class="trade-item-btns">
<view @click.stop="() => refund(item.order_id, key)" v-if="item.status == 'PAYMENT_SUCCESSFULLY'">
申请退款</view>
<view @click.stop="() => closeOrder(item.order_id, item)" v-if="item.status == 'WAIT_PAYMENT'">关闭订单
</view>
<view @click.stop="confirmpost(item.order_id, key)" v-if="item.postFlag">确认收货</view>
<view class="pay-btn" @click.stop="setOrderId(item.order_id)" v-if="item.status == 'WAIT_PAYMENT'">
立即支付</view>
</view>
</view>
</view>
<!-- <view v-if="list.length === 0 && finished" class="noDate">
<view>暂无订单</view>
</view> -->
</view>
</template>
<script>
export default {
name: 'Trades',
data() {
return {
finished: false,
list: [],
typeList: [{
id: 'ALL',
name: '全部'
},
{
id: 'WAIT_PAYMENT',
name: '待付款'
},
{
id: 'PAYMENT_SUCCESSFULLY',
name: '待使用'
},
{
id: 'PAYMENT_SUCCESSFULLY',
name: '待发货'
},
{
id: 'POST',
name: '待收货'
},
// {
// id: 'WAIT_COMMENT',
// name: ''
// },
{
id: 'WAIT_REFUND,REFUND_SUCCESS,REFUND_REFUSAL,REFUND_ERROR,REFUND_PART',
name: '退款/售后'
}
],
typeIndex: 0,
ajaxFlag: true,
keywords: '',
orderId: null,
dateRange: [],
type: ''
};
},
onLoad(options) {
console.log(options);
if (options.type) this.typeIndex = this.typeList.findIndex(vm => vm.name === options.type);
uni.$on("updateDataByConnect", this.getDataByConnect)
},
onShow() {
this.getList();
},
onUnload() {
uni.$off("updateDataByConnect", this.getDataByConnect)
},
onReachBottom() {
if (this.finished) return false;
this.getList();
},
methods: {
getDataByConnect(data) {
if (data.msgType == "updateOrderTrades") {
this.list = [];
this.finished = false;
this.getList()
}
},
emptyFunc() {
},
showItem(item) {
let flag = true;
// if (this.typeIndex == 2 && item.order_child[0] && !item.order_child[0].consignee) flag = false
return flag;
},
onReload() {
this.list = [];
this.finished = false;
this.getList();
},
setType(index) {
this.typeIndex = index;
this.onReload();
},
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,
success: () => {
const templateIds = [
// 退
'hRZoiEES2BWtKb6Xgsnn8khLQH9un5j_11qu0bwlhfE',
//
'YyTCUIYBnrj9CyKks8cOjNX_Rk8a4yVdswMP-zXVbhc'
]
uni.requestSubscribeMessage({
tmplIds: templateIds,
complete (res) {
that.list = [];
that.finished = false;
that.getList()
}
})
}
});
}
});
},
//
confirmpost(id, index) {
let that = this;
uni.showModal({
title: '提示',
content: '是否确认收货?',
success: successRes => {
if (successRes.confirm) {
that.Post({
order_id: id
},
'/api/order/confirmPost'
).then(res => {
if (res.code == 1) {
list[index].order_child.map(item => {
item.status = 'WAIT_COMMENT';
});
list[index].status = 'WAIT_COMMENT';
list[index].postFlag = false;
that.list = list;
uni.showToast({
title: '操作成功'
});
that.$forceUpdate();
}
});
}
}
});
},
//
closeOrder(id, index) {
console.log(id);
console.log(index);
let that = this;
uni.showModal({
title: '提示',
content: '是否关闭订单?',
success: successRes => {
if (successRes.confirm) {
that.Post({
order_id: id
},
'/api/order/closeOrder'
).then(res => {
if (res.code == 1) {
uni.showToast({
title: '关闭成功',
icon: 'success'
});
that.list = [];
that.finished = false;
that.getList();
}
});
}
}
});
},
//
deletOrder(id) {
let that = this;
uni.showModal({
title: '提示',
content: '是否删除订单?',
success: successRes => {
if (successRes.confirm) {
that.Post({
order_id: id
},
'/api/order/delOrder'
).then(res => {
if (res.code == 1) {
uni.showToast({
title: '删除成功',
icon: 'success'
});
that.list = [];
that.finished = false;
that.getList();
}
});
}
}
});
},
// 退
refund(id, index) {
console.log(id);
let that = this;
uni.showModal({
title: '提示',
content: '是否申请退款?',
success: successRes => {
if (successRes.confirm) {
that.Post({
order_id: id
},
'/api/order/applyRefund'
).then(res => {
if (res.code == 1) {
uni.showToast({
title: '申请成功',
icon: 'success'
});
that.onReload();
}
});
}
}
});
},
search(e) {
this.list = [];
this.getList();
// if (e.keyCode == 13) {
// //
// this.keywords = e.target.value;
// }
},
getList() {
let data = {
status: this.typeList[this.typeIndex].id == 'ALL' ? '' : this.typeList[this.typeIndex].true_id ||
this.typeList[this.typeIndex].id,
offset: this.list.length,
limit: 5,
name: this.keywords,
type: this.typeList[this.typeIndex].name == '待使用' ? 1 : (this.typeList[this.typeIndex].name ==
'待发货' ? 2 : '')
};
this.Post(data, '/api/order/orderList').then(res => {
this.list = [...this.list, ...res.data]
if (res.data.length < 5) {
this.finished = true;
}
});
},
UpdateOrder(id) {
this.ajaxFlag = false;
let list = this.list;
this.Post({
order_id: id
},
'/api/order/orderDetail'
).then(res => {
this.ajaxFlag = true;
list.map(item => {
if (item.order_id == id) {
item = res.data;
}
});
this.list = list;
});
},
choseType(item) {
uni.navigateTo({
url: '/subPackages/order/detail?id=' + item.order_id
});
},
}
};
</script>
<style scoped lang="scss">
view {
box-sizing: border-box;
}
.common-box {
height: 90rpx;
}
.common-types {
background: white;
height: 90rpx;
font-size: 31rpx;
z-index: 10;
margin: auto;
color: #666;
overflow-x: scroll;
overflow-y: hidden;
padding: 0 27rpx;
}
.common-types::-webkit-scrollbar {
width: 0rpx;
height: 0;
display: none;
}
.common-type {
flex-shrink: 0;
margin: 0 26rpx;
line-height: 90rpx;
height: 90rpx;
position: relative;
}
.common-type.active {
font-size: 31rpx;
font-weight: bold;
color: #000;
}
.common-type.active:after {
display: block;
width: 60%;
font-size: 0;
content: '1';
margin: auto;
position: absolute;
left: 0;
right: 0;
bottom: 1rpx;
height: 4rpx;
background: #C3282E;
border-radius: 2rpx;
}
.bg {
min-height: 100vh;
background-color: #f7f7f7;
}
.noDate {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-top: 200rpx;
}
.noDate img {
width: 514rpx;
height: auto;
}
.noDate view {
font-size: 24rpx;
color: #777777;
}
.trade-list {
padding: 28rpx 26rpx;
}
.trade-items {
background-color: white;
margin-bottom: 28rpx;
border-radius: 20rpx;
}
.trade-item-head {
display: flex;
justify-content: space-between;
padding: 28rpx 20rpx;
border-bottom: 1rpx solid #d8d8d8;
}
.trade-item-head-tid {
font-size: 24rpx;
display: flex;
align-items: center;
color: #666666;
}
.trade-item-head-state {
font-size: 27rpx;
font-family: PingFang SC;
font-weight: bold;
color: #C3282E;
}
.trade-item-head-name {
display: flex;
align-items: center;
font-size: 31rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
image {
width: 33rpx;
height: 31rpx;
}
view {
margin-left: 13rpx;
}
}
.trade-item-pros {
display: flex;
/* background-color: #F2F2F2; */
flex-direction: column;
}
.trade-item-pro {
display: flex;
padding: 20rpx;
justify-content: space-between;
}
.trade-item-pro-img {
display: flex;
justify-content: center;
align-items: center;
}
.trade-item-pro-img image {
width: 180rpx;
height: 180rpx;
border-radius: 10rpx;
}
.trade-item-pro-price {
display: flex;
flex-direction: column;
}
.trade-item-pro-title {
text-align: left;
flex: 1;
padding: 0 20rpx;
font-size: 28rpx;
}
.trade-item-pro-subtitle {
text-align: left;
flex: 1;
padding: 0 20rpx;
font-weight: 500;
font-size: 24rpx;
color: #C3282E;
margin-top: 20rpx;
}
.trade-item-pro-price view {
display: flex;
flex-wrap: nowrap;
text-wrap: none;
white-space: nowrap;
justify-content: flex-end;
}
.trade-item-pro-price-pri {
font-size: 27rpx;
color: #C3282E;
font-weight: 500;
color: #333333;
}
.trade-item-pro-num {
font-size: 24rpx;
color: #666666;
margin-top: 24rpx;
}
.trade-item-info {
font-size: 28rpx;
display: flex;
justify-content: flex-end;
align-items: center;
background-color: white;
padding: 0rpx 20rpx;
margin-top: -6rpx;
/* border-bottom: 1px solid #B6B6B6; */
}
.trade-item-info text {
font-size: 36rpx;
font-weight: bold;
color: rgba(238, 0, 0, 1);
}
.trade-item-btns {
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
padding: 20rpx;
}
.trade-item-btns view {
margin-left: 20rpx;
background: rgba(237, 237, 237, 0);
border: 1rpx solid #999999;
border-radius: 27rpx;
padding: 8rpx 16rpx;
font-size: 27rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
.trade-item-btns .pay-btn {
color: #FFFFFF;
background: #C3282E;
border: none;
padding: 10rpx 16rpx;
}
.comment-btn {
width: 100rpx;
text-align: center;
line-height: 40rpx;
border-radius: 20rpx;
border: 1px solid #999999;
color: #333333;
justify-content: center !important;
font-size: 24rpx;
margin-top: 16rpx;
}
.list-common-empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 50vh;
}
.list-common-empty img {
width: 483rpx;
height: 254rpx;
}
.list-common-empty-tip {
margin-top: 61rpx;
font-size: 29rpx;
font-family: PingFang SC;
font-weight: 500;
color: #8599b5;
}
.com-flex-tao {
display: flex;
justify-content: space-between;
align-items: center;
}
.search-box {
width: 697rpx;
height: 67rpx;
background: #f2f2f2;
border-radius: 33rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 8rpx 0 28rpx;
margin: 0 auto;
margin-bottom: 20rpx;
.left {
display: flex;
align-items: center;
image {
width: 28rpx;
height: 30rpx;
}
input {
margin-left: 20rpx;
font-size: 31rpx;
font-weight: 400;
color: #333;
width: 450rpx;
}
}
.btn {
width: 107rpx;
height: 53rpx;
background: #71B580;
border-radius: 27rpx;
font-size: 28rpx;
font-weight: 400;
color: #ffffff;
line-height: 53rpx;
text-align: center;
}
}
.top-bg {
background: #fff;
padding-top: 20rpx;
}
</style>

58
subPackages/user/privacy.vue

@ -0,0 +1,58 @@
<template>
<view class="bg">
<view class="list">
<view class="item" v-for="(item,index) in list" :key="item.id" @click="goInfo(item)">
{{item.name}}
</view>
</view>
</view>
</template>
<script>
export default{
data(){
return {
list:[{name:'用户协议',id:'10001'},{name:'隐私协议',id:'9999'},{name:'个人信息收集清单',id:'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>

30
subPackages/user/privacyInfo.vue

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