个人中心

This commit is contained in:
2020-06-19 18:07:11 +08:00
parent f0244f8077
commit 7e71f97e01
12 changed files with 182 additions and 55 deletions

View File

@@ -11,7 +11,9 @@ export default {
}
},
onLoad(option) {
console.log(option);
this.setTitle(option.title);
this.getUseHelpInfo(option.id);
},
methods: {
setTitle(title){
@@ -19,6 +21,21 @@ export default {
title: title
});
},
unescapeHTML (temp){
temp = "" + temp;
return temp.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&").replace(/&quot;/g, '"').replace(/&apos;/g, "'");
},
getUseHelpInfo(id) {
this.$u.api.getUseHelpInfo({
launch_id: id,
}).then((res)=>{
// console.log(res)
if (res.errCode == 0) {
this.nodes = this.unescapeHTML(res.data.info[0].help_info);
this.setTitle(res.data.info[0].help_title);
}
})
}
},
}
</script>

View File

@@ -4,34 +4,46 @@
<view class="old-phone">
<view class="phone-number">
<view class="title">原手机号</view>
<input type="text" placeholder="请输入手机号码" />
<input type="text" v-model="oldNumber" placeholder="请输入手机号码" />
</view>
<view class="code">
<view class="title">验证码</view>
<input type="text" placeholder="请输入验证码" />
<input type="text" v-model="oldCode" placeholder="请输入验证码" />
<view class="get-code">获取验证码</view>
</view>
</view>
<view class="new-phone">
<view class="phone-number">
<view class="title">新手机号</view>
<input type="text" placeholder="请输入手机号码" />
<input type="text" v-model="newNumber" placeholder="请输入手机号码" />
</view>
<view class="code">
<view class="title">验证码</view>
<input type="text" placeholder="请输入验证码" />
<input type="text" v-model="newCode" placeholder="请输入验证码" />
<view class="get-code">获取验证码</view>
</view>
</view>
</view>
<view class="tips">注意修改手机号需要原手机号获取验证码无原手机验证码请联系后台</view>
<view class="btn">保存</view>
</view>
</template>
<script>
export default {
data() {
return {}
}
return {
oldNumber: '',
oldCode: '',
newNumber: '',
newCode: ''
}
},
methods: {
verifyValue() {
if (this.$u.test.mobile(this.oldNumber)) this.$u.toast('请填写正确的原手机号');
if (this.$u.test.mobile(this.newNumber)) this.$u.toast('请填写正确的新手机号');
}
},
};
</script>
<style lang="scss" scoped>
@@ -73,16 +85,6 @@ export default {
}
}
}
// .phone-number::after {
// position: absolute;
// content: "";
// width: 2rpx;
// height: 43rpx;
// background: rgba(242,242,242,1);
// left: 0;
// top: 50%;
// transform: translate(0, -50%);
// }
.code {
display: flex;
align-items: center;
@@ -105,5 +107,16 @@ export default {
color: rgba(102,102,102,1);
line-height: 40rpx;
}
.btn {
margin: 120rpx auto 0;
width: 690rpx;
height: 98rpx;
background: rgba(255,120,15,1);
border-radius: 49rpx;
font-size: 36rpx;
color: rgba(255,255,255,1);
line-height: 98rpx;
text-align: center;
}
}
</style>

View File

@@ -1,6 +1,6 @@
<template>
<view class="after-sale">
<ArticleList :articleList="policyList" :type="type"></ArticleList>
<ArticleList :articleList="policyList"></ArticleList>
</view>
</template>
<script>
@@ -8,14 +8,29 @@ import ArticleList from '@/components/mine/article-list/index'
export default {
data() {
return {
page: 1,
type: '售后政策',
policyList: [1,1,1,1, 1, 1, 1]
policyList: []
}
},
components: {
ArticleList
},
methods: {},
onLoad() {
this.getPolicyList();
},
methods: {
getPolicyList () {
this.$u.api.getUseHelpList({
page: this.page,
tid: 2 // 1:使用帮助列表 2: 售后政策列表
}).then((res)=>{
if (res.errCode == 0) {
this.policyList = res.data.helpList;
}
})
}
},
}
</script>
<style lang="scss" scoped>

View File

@@ -1,6 +1,6 @@
<template>
<view class="mine-help">
<ArticleList :articleList="helpList" :type="type"></ArticleList>
<ArticleList :articleList="helpList"></ArticleList>
</view>
</template>
<script>
@@ -8,14 +8,28 @@ import ArticleList from '@/components/mine/article-list/index'
export default {
data() {
return {
type: '使用帮助',
helpList: [1,1,1,1, 1, 1, 1]
page: 1,
helpList: []
}
},
components: {
ArticleList
},
methods: {},
onLoad() {
this.getUseHelpList();
},
methods: {
getUseHelpList() {
this.$u.api.getUseHelpList({
page: this.page,
tid: 1 // 1:使用帮助列表 2: 售后政策列表
}).then((res)=>{
if (res.errCode == 0) {
this.helpList = res.data.helpList;
}
})
}
},
}
</script>
<style lang="scss" scoped>

View File

@@ -5,51 +5,72 @@
</view>
<swiper :current="swiperCurrent" @animationfinish="animationfinish">
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;">
<view class="item-container" v-for="(item, index) in 4" :key="index">
<OrderItem :current="current"></OrderItem>
<scroll-view scroll-y style="height: 100%;" @scrolltolower="reachBottom">
<view>
<view class="item-container" v-for="(item, index) in orderList" :key="index">
<OrderItem :current="current"></OrderItem>
</view>
<u-loadmore :status="loadStatus[5]" bgColor="#ECECEC" margin-bottom="20"></u-loadmore>
</view>
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;">
<view class="item-container">
<OrderItem :current="current"></OrderItem>
<view>
<view class="item-container" v-for="(item, index) in orderList" :key="index">
<OrderItem :current="current"></OrderItem>
</view>
<u-loadmore :status="loadStatus[5]" bgColor="#ECECEC" margin-bottom="20"></u-loadmore>
</view>
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;">
<view class="item-container">
<OrderItem :current="current"></OrderItem>
<view>
<view class="item-container" v-for="(item, index) in orderList" :key="index">
<OrderItem :current="current"></OrderItem>
</view>
<u-loadmore :status="loadStatus[5]" bgColor="#ECECEC" margin-bottom="20"></u-loadmore>
</view>
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;">
<view class="item-container">
<OrderItem :current="current"></OrderItem>
<view>
<view class="item-container" v-for="(item, index) in orderList" :key="index">
<OrderItem :current="current"></OrderItem>
</view>
<u-loadmore :status="loadStatus[5]" bgColor="#ECECEC" margin-bottom="20"></u-loadmore>
</view>
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;">
<view class="item-container">
<OrderItem :current="current"></OrderItem>
<view>
<view class="item-container" v-for="(item, index) in orderList" :key="index">
<OrderItem :current="current"></OrderItem>
</view>
<u-loadmore :status="loadStatus[5]" bgColor="#ECECEC" margin-bottom="20"></u-loadmore>
</view>
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;">
<view class="item-container">
<OrderItem :current="current"></OrderItem>
<scroll-view scroll-y style="height: 100%;" @scrolltolower="reachBottom">
<view>
<view class="item-container" v-for="(item, index) in orderList" :key="index">
<OrderItem :current="current"></OrderItem>
</view>
<u-loadmore :status="loadStatus[5]" bgColor="#ECECEC" margin-bottom="20"></u-loadmore>
</view>
</scroll-view>
</swiper-item>
<swiper-item class="swiper-item">
<scroll-view scroll-y style="height: 100%;">
<view class="item-container">
<OrderItem :current="current"></OrderItem>
<scroll-view scroll-y style="height: 100%;" @scrolltolower="reachBottom">
<view>
<view class="item-container" v-for="(item, index) in orderList" :key="index">
<OrderItem :current="current"></OrderItem>
</view>
<u-loadmore :status="loadStatus[6]" bgColor="#ECECEC" margin-bottom="20"></u-loadmore>
</view>
</scroll-view>
</swiper-item>
@@ -76,8 +97,11 @@ export default {
}, {
name: '售后'
}],
orderList: 5,
loadStatus: ['loadmore','loadmore','loadmore','loadmore','loadmore','loadmore','loadmore'],
page: 0,
current: 0,
swiperCurrent: 0
swiperCurrent: 0,
}
},
components: {
@@ -90,7 +114,20 @@ export default {
}
},
methods: {
reachBottom() {
// console.log(this.page);
if(this.page >= 3) return;
// 修改当前的 loadStatus
console.log(this.loadStatus);
this.loadStatus.splice(this.current, 1, "loading");
this.page++;
setTimeout(() => {
this.orderList += 5;
this.loadStatus.splice(this.current, 1, "nomore");
}, 1200);
},
tabsChange(index) {
this.current = Number(index);
this.swiperCurrent = Number(index);
},
animationfinish(e) {