This commit is contained in:
ghusermoon 2020-06-24 16:39:31 +08:00
parent 8c993da2cd
commit 28e80b49ff
14 changed files with 132 additions and 54 deletions

View File

@ -1,6 +1,10 @@
export default { export default {
init(vm){ init(vm){
return { return {
// 获取商城首页信息(顶部轮播图与商品分类)
getShopTopList(){
return vm.$u.post('Shop/getShopTopList');
},
// 商品推荐 // 商品推荐
getGoodsRecommend({page}){ getGoodsRecommend({page}){
return vm.$u.post('Goods/getGoodsRecommend', { return vm.$u.post('Goods/getGoodsRecommend', {
@ -10,7 +14,11 @@ export default {
// 购物车商品列表 // 购物车商品列表
getCartList() { getCartList() {
return vm.$u.post('cart/cartList'); return vm.$u.post('cart/cartList');
} },
// 购物车商品列表(树结构)
getCartTreeList() {
return vm.$u.post('cart/cartTreeList');
},
} }
} }

View File

@ -160,10 +160,24 @@ export default {
time: time time: time
}); });
}, },
// 会员服务-积分数
getMemberPointsStat() {
return vm.$u.post('member/memberPointsStat');
},
// 会员服务-积分列表 // 会员服务-积分列表
getPointslogList() { getPointslogList() {
return vm.$u.post('member/pointslogList'); return vm.$u.post('member/pointslogList');
}, },
// 商品收藏列表
getGoodsFavoritesList() {
return vm.$u.post('Member/getFavoritesList');
},
// 店铺收藏列表
getStoreFavoritesList({ type }) {
return vm.$u.post('Member/getFavoritesList', {
type: type
});
},
} }
} }
} }

View File

@ -58,13 +58,13 @@ export default {
this.getAreaData(); this.getAreaData();
}, },
created() { created() {
// console.log(this.info); console.log(typeof this.info);
this.initAddressInfo(); this.initAddressInfo();
}, },
methods: { methods: {
// //
initAddressInfo() { initAddressInfo() {
if(JSON.stringify(this.info) != '{}') { if(this.info) {
[this.name, this.phone, this.address, this.area, this.area_id, this.city_id] = [ [this.name, this.phone, this.address, this.area, this.area_id, this.city_id] = [
this.info.address_realname, this.info.address_realname,
this.info.address_mob_phone, this.info.address_mob_phone,
@ -78,7 +78,7 @@ export default {
}, },
//  // 
confirmBtn() { confirmBtn() {
JSON.stringify(this.info) != '{}' ? this.editAddress() : this.addAddress(); this.info ? this.editAddress() : this.addAddress();
}, },
// //
validateValue() { validateValue() {

View File

@ -1,5 +1,6 @@
<template> <template>
<view class="article-list"> <view class="article-list">
<u-empty text="数据为空" mode="data" color="#000000" img-width="240" margin-top="300" v-if="!articleList.length"></u-empty>
<view v-for="(item, index) in articleList" :key="index" class="list-item" @click="toDetailsPage(item)"> <view v-for="(item, index) in articleList" :key="index" class="list-item" @click="toDetailsPage(item)">
<view>{{ item.help_title }}</view> <view>{{ item.help_title }}</view>
<image src="@/pageE/static/mine/21.png"></image> <image src="@/pageE/static/mine/21.png"></image>
@ -20,7 +21,6 @@ export default {
type: 'navigateTo', type: 'navigateTo',
url: '/pageE/mine/ArticleDetails', url: '/pageE/mine/ArticleDetails',
params: { params: {
title: item.help_title,
id: item.help_id id: item.help_id
} }
}) })
@ -32,6 +32,7 @@ export default {
.article-list { .article-list {
min-height: calc(100vh - var(--window-top)); min-height: calc(100vh - var(--window-top));
background-color: #ECECEC; background-color: #ECECEC;
overflow: hidden;
.list-item { .list-item {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -1,5 +1,6 @@
<template> <template>
<view class="collection-item"> <view class="collection-item">
<u-empty mode="list" v-if="!list.length" color="#000" img-width="200" font-size="30" margin-top="300"></u-empty>
<u-swipe-action <u-swipe-action
v-for="(item, index) in list" :key="index" v-for="(item, index) in list" :key="index"
:index='index' :index='index'
@ -43,7 +44,6 @@ export default {
show: false, show: false,
} }
], ],
btnWidth: 152,
show: false, show: false,
options: [ options: [
{ {
@ -55,7 +55,18 @@ export default {
] ]
} }
}, },
mounted() {
this.getGoodsFavoritesList();
},
methods: { methods: {
getGoodsFavoritesList() {
this.$u.api.getGoodsFavoritesList().then(res => {
if(res.errCode == 0) {
}
})
},
click(index) { click(index) {
this.list.splice(index, 1); this.list.splice(index, 1);
this.$u.toast(`删除了第${index+1}个cell`); this.$u.toast(`删除了第${index+1}个cell`);

View File

@ -48,8 +48,14 @@ export default {
status: '编辑', status: '编辑',
list: [ list: [
{ {
//
member_id: 1,
store_id: 1,
store_name: "官方自营店铺",
//
goods: [ goods: [
{ {
//
checked: false checked: false
}, },
{ {
@ -74,14 +80,21 @@ export default {
} }
}, },
onLoad() { onLoad() {
this.getCartList(); // this.getCartList();
}, },
methods: { methods: {
getCartList() { getCartList() {
this.$u.api.getCartList().then((res)=>{ this.$u.api.getCartTreeList().then((res)=>{
if (res.errCode == 0) { if (res.errCode == 0) {
console.log(res); let cartList = []
this.list = res.data.store_cart_list;
// Object.assign(this, { checked });
this.list.forEach(store => {
store
store.forEach(goods => {
})
})
} }
}) })
}, },

View File

@ -7,12 +7,11 @@
export default { export default {
data() { data() {
return { return {
nodes: `<p>13268748568645634nfdhf dfvjdfjgdfl vdufhnh1</p>123346<h1>das</h1><h1>das</h1><h1>das1</h1><h2>das2</h2><h3>das3</h3>` nodes: '',
} }
}, },
onLoad(option) { onLoad(option) {
console.log(option); // console.log(option);
this.setTitle(option.title);
this.getUseHelpInfo(option.id); this.getUseHelpInfo(option.id);
}, },
methods: { methods: {
@ -21,6 +20,7 @@ export default {
title: title title: title
}); });
}, },
//
unescapeHTML (temp){ unescapeHTML (temp){
temp = "" + temp; temp = "" + temp;
return temp.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&").replace(/&quot;/g, '"').replace(/&apos;/g, "'"); return temp.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&").replace(/&quot;/g, '"').replace(/&apos;/g, "'");
@ -29,7 +29,6 @@ export default {
this.$u.api.getUseHelpInfo({ this.$u.api.getUseHelpInfo({
launch_id: id, launch_id: id,
}).then((res)=>{ }).then((res)=>{
// console.log(res)
if (res.errCode == 0) { if (res.errCode == 0) {
this.nodes = this.unescapeHTML(res.data.info[0].help_info); this.nodes = this.unescapeHTML(res.data.info[0].help_info);
this.setTitle(res.data.info[0].help_title); this.setTitle(res.data.info[0].help_title);

View File

@ -9,11 +9,11 @@
<view class="integral-top"> <view class="integral-top">
<view> <view>
<view class="title">总积分</view> <view class="title">总积分</view>
<view class="value">999</view> <view class="value">{{ memberInfo.member_points }}</view>
</view> </view>
<view> <view>
<view class="title">经验值</view> <view class="title">经验值</view>
<view class="value">999</view> <view class="value">{{ memberInfo.member_exppoints }}</view>
</view> </view>
<view> <view>
<view class="title">预计进度</view> <view class="title">预计进度</view>
@ -71,10 +71,12 @@ export default {
current: 0, current: 0,
swiperCurrent: 0, swiperCurrent: 0,
nodes: '<h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1>', nodes: '<h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1>',
pointslogList: [] pointslogList: [],
memberInfo: {}
} }
}, },
onShow() { onShow() {
this.getMemberPointsStat();
this.getPointslogList(); this.getPointslogList();
}, },
methods: { methods: {
@ -86,6 +88,13 @@ export default {
this.swiperCurrent = current; this.swiperCurrent = current;
this.current = current; this.current = current;
}, },
getMemberPointsStat() {
this.$u.api.getMemberPointsStat().then((res)=>{
if (res.errCode == 0) {
this.memberInfo = res.data;
}
})
},
getPointslogList() { getPointslogList() {
this.$u.api.getPointslogList().then((res)=>{ this.$u.api.getPointslogList().then((res)=>{
if (res.errCode == 0) { if (res.errCode == 0) {

View File

@ -1,5 +1,6 @@
<template> <template>
<view class="store"> <view class="store">
<u-empty mode="list" v-if="!list.length" color="#000" img-width="200" font-size="30" margin-top="300"></u-empty>
<u-swipe-action <u-swipe-action
v-for="(item, index) in list" :key="index" v-for="(item, index) in list" :key="index"
:index='index' :index='index'
@ -26,21 +27,7 @@
export default { export default {
data() { data() {
return { return {
list: [ list: [],
{
id: 1,
show: false
},
{
id: 2,
show: false
},
{
id: 3,
show: false,
}
],
btnWidth: 152,
show: false, show: false,
options: [ options: [
{ {
@ -52,7 +39,19 @@ export default {
] ]
} }
}, },
mounted() {
this.getStoreFavoritesList();
},
methods: { methods: {
getStoreFavoritesList() {
this.$u.api.getStoreFavoritesList({
type: 2 //
}).then(res => {
if(res.errCode == 0) {
}
})
},
click(index) { click(index) {
this.list.splice(index, 1); this.list.splice(index, 1);
this.$u.toast(`删除了第${index+1}个cell`); this.$u.toast(`删除了第${index+1}个cell`);
@ -70,6 +69,9 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.store { .store {
min-height: calc(100vh - var(--window-top));
background-color: #ECECEC;
padding-top: 1rpx;
.item { .item {
padding: 30rpx; padding: 30rpx;
display: flex; display: flex;

View File

@ -1,6 +1,7 @@
<template> <template>
<view class="address"> <view class="address">
<u-radio-group v-model="current" @change="changeDefault" size="29" active-color="#FF780F"> <u-radio-group v-model="current" @change="changeDefault" size="29" active-color="#FF780F">
<u-empty text="暂无收货地址" mode="address" color="#000000" img-width="120" margin-top="300" v-if="!addressList.length"></u-empty>
<view v-for="(item, index) in addressList" :key="index" class="address-item"> <view v-for="(item, index) in addressList" :key="index" class="address-item">
<AddressItem :item="item" :current='current' @getAddressList="getAddressList"></AddressItem> <AddressItem :item="item" :current='current' @getAddressList="getAddressList"></AddressItem>
</view> </view>
@ -14,7 +15,7 @@ import AddressItem from '@/components/mine/address-block/address-item'
export default { export default {
data() { data() {
return { return {
current: -1, current: -1, // radio
addressList: [] addressList: []
} }
}, },
@ -46,7 +47,7 @@ export default {
// console.log(id) // console.log(id)
this.$u.api.setDefaultAddress({ this.$u.api.setDefaultAddress({
address_id: id address_id: id
}).then((res)=>{ }).then(res => {
if(res.errCode == 0) { if(res.errCode == 0) {
this.getAddressList(); this.getAddressList();
} else { } else {

View File

@ -9,7 +9,6 @@ export default {
data() { data() {
return { return {
page: 1, page: 1,
type: '售后政策',
policyList: [] policyList: []
} }
}, },

View File

@ -6,7 +6,8 @@
<swiper :current="swiperCurrent" @animationfinish="animationfinish"> <swiper :current="swiperCurrent" @animationfinish="animationfinish">
<swiper-item class="swiper-item"> <swiper-item class="swiper-item">
<scroll-view scroll-y class="order-list" @scrolltolower="reachBottom"> <scroll-view scroll-y class="order-list" @scrolltolower="reachBottom">
<view> <u-empty text="订单为空" mode="order" color="#000000" v-if="!orderList.length"></u-empty>
<view v-else>
<view v-for="(item, index) in orderList" :key="index" class="order-item"> <view v-for="(item, index) in orderList" :key="index" class="order-item">
<view class="order-title"> <view class="order-title">
<view class="order-text">订单</view> <view class="order-text">订单</view>
@ -46,7 +47,13 @@ export default {
onShow() { onShow() {
this.current = 0; this.current = 0;
this.swiperCurrent = 0; this.swiperCurrent = 0;
this.getManicureList(); this.getManicureList().then(order => {
// console.log(order);
this.orderList = this.orderList.concat(order);
// console.log(this.orderList);
});
}, },
filters: { filters: {
dateFormat(value) { dateFormat(value) {
@ -59,26 +66,27 @@ export default {
} }
}, },
methods: { methods: {
getManicureList() { async getManicureList() {
this.$u.api.getManicureList({ let res = await this.$u.api.getManicureList({
page: this.page page: this.page
}).then((res)=>{
if (res.errCode == 0) {
this.orderList = res.data.list;
}
}) })
if (res.errCode == 0) {
return res.data.list;
}
}, },
reachBottom() { reachBottom() {
// console.log(this.page);
if(this.page >= 3) return;
// loadStatus // loadStatus
console.log(this.loadStatus); this.loadStatus = "loading";
this.loadStatus.splice(this.current, 1, "loading");
this.page++; this.page++;
setTimeout(() => { this.getManicureList().then(order => {
this.orderList += 5; if (!order.length) {
this.loadStatus.splice(this.current, 1, "nomore"); // page-1
}, 1200); this.page--;
this.loadStatus = "nomore";
} else {
this.orderList = this.orderList.concat(order);
}
})
}, },
tabsChange(index) { tabsChange(index) {
this.swiperCurrent = index; this.swiperCurrent = index;

View File

@ -55,8 +55,15 @@ export default {
name: this.name, name: this.name,
time: new Date(this.time) time: new Date(this.time)
}).then((res)=>{ }).then((res)=>{
let type = res.errCode == 0 ? 'success' : 'error'; if(res.errCode == 0) {
this.showToast(res.message, type); this.$refs.uToast.show({
title: res.message,
type: 'success',
url: '/pageE/tool/Manicure'
})
} else {
this.showToast(res.message, 'error');
}
}) })
}, },
chooseDate(e) { chooseDate(e) {

View File

@ -95,10 +95,16 @@ export default {
} }
}, },
onLoad() { onLoad() {
console.log(this.$u.http) // this.getShopTopList();
this.getGoodsRecommend(); this.getGoodsRecommend();
}, },
methods: { methods: {
// getShopTopList() {
// this.$u.api.getShopTopList().then((res)=>{
// if (res.errCode == 0) {
// }
// })
// },
getGoodsRecommend() { getGoodsRecommend() {
this.$u.api.getGoodsRecommend({ this.$u.api.getGoodsRecommend({
page: 1, page: 1,