个人中心

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

View File

@ -6,6 +6,10 @@ export default {
return vm.$u.post('Goods/getGoodsRecommend', {
page: page
});
},
// 购物车商品列表
getCartList() {
return vm.$u.post('cart/cartList');
}
}
}

View File

@ -54,7 +54,20 @@ export default {
member_mobile: member_mobile,
sms_code: sms_code
});
}
},
// 使用帮助&售后政策列表
getUseHelpList({page, tid}) {
return vm.$u.post('Member/UseHelpList', {
page: page,
tid: tid
});
},
// 使用帮助&售后政策详情
getUseHelpInfo({ launch_id }) {
return vm.$u.post('Member/UseHelpInfo', {
launch_id: launch_id
});
},
}
}
}

View File

@ -23,7 +23,9 @@ const install = (Vue, vm) => {
// 方式四如果token放在了Storage本地存储中拦截是每次请求都执行的
// 所以哪怕您重新登录修改了Storage下一次的请求将会是最新值
const token = uni.getStorageSync('token');
config.header.token = token;
// console.log(token);
// config.header.token = token;
config.header.Authorization = token;
// config.header.Token = 'xxxxxx';
// 可以对某个url进行特别处理此url参数为this.$u.get(url)中的url值

View File

@ -1,7 +1,7 @@
<template>
<view class="article-list">
<view v-for="(item, index) in articleList" :key="index" class="list-item" @click="toDetailsPage()">
<view>{{ type }}</view>
<view v-for="(item, index) in articleList" :key="index" class="list-item" @click="toDetailsPage(item)">
<view>{{ item.help_title }}</view>
<image src="@/pageE/static/mine/21.png"></image>
</view>
</view>
@ -13,13 +13,17 @@ export default {
},
props: {
articleList: Array,
type: String
},
methods: {
toDetailsPage() {
uni.navigateTo({
url: '/pageE/mine/ArticleDetails?title=' + this.type + "详情"
});
toDetailsPage(item) {
this.$u.route({
type: 'navigateTo',
url: '/pageE/mine/ArticleDetails',
params: {
title: item.help_title,
id: item.help_id
}
})
}
},
}

View File

@ -1,15 +1,12 @@
<template>
<view class="shop-item">
<image></image>
<text>{{ info.gc_name }}</text>
<text>1</text>
</view>
</template>
<script>
export default {
name:"shopItem",
props: {
info: Object
}
}
</script>
<style lang="scss" scoped>

View File

@ -73,7 +73,18 @@ export default {
checkedAll: false
}
},
onLoad() {
this.getCartList();
},
methods: {
getCartList() {
this.$u.api.getCartList().then((res)=>{
if (res.errCode == 0) {
console.log(res);
}
})
},
reduce(value, store) {
console.log(value, store)
},

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) {

View File

@ -29,7 +29,7 @@
</view>
</view>
<view class="fenlei">
<shopitem v-for="item in classifyList" :key="item.gc_id" class="item" :info="item"></shopitem>
<shopitem v-for="item in 5" class="item"></shopitem>
</view>
<view class="fenlei">
<shopitem v-for="item in 5" class="item"></shopitem>