Enzo 4 years ago
parent
commit
a07ab0327e
  1. 49
      components/index-coupon/index-coupon.less
  2. 91
      components/index-coupon/index-coupon.vue
  3. 2
      components/index-nav/index-nav.vue
  4. 12
      components/lf-indexFind/lf-indexFind.vue
  5. 25
      components/lf-multiColumnAd/lf-multiColumnAd.vue
  6. 12
      components/lf-seckill/lf-seckill.vue
  7. 15
      pages/address/add/add.vue
  8. 57
      pages/address/list/list.vue
  9. 26
      pages/index/category/category.vue
  10. 74
      pages/index/index/index.vue
  11. 1
      pages/shop/shopdetail.vue
  12. 12
      pages/user/my/center.vue
  13. 21
      pages/user/my/setting.vue

49
components/index-coupon/index-coupon.less

@ -1,49 +0,0 @@
@import '../../common/css/global';
.coupon-warp-box {
background: #FFFFFF;
overflow:auto;
white-space:nowrap;
width:100%;
padding: 10px 15px;
.coupon-item-box {
width: 160px;
height: 65px;
display: inline-block;
background: @mainColor;
margin-right: 5px;
border-radius: 4px;
.coupon-item {
display: flex;
align-items: center;
justify-content: space-between;
height: 100%;
padding: 5px;
color: #FFFFFF;
.left {
.money {
font-size: 10px;
}
.num {
font-size: 30px;
}
}
.right {
font-size: 10px;
text-align: center;
.label {
}
.btn{
padding: 2px 10px;
border-radius: 3px;
background: #FFFFFF;
color: @mainColor;
margin-top: 5px;
box-shadow:0px 2px 4px 0px rgba(0,0,0,0.1);
}
}
}
}
}

91
components/index-coupon/index-coupon.vue

@ -1,91 +0,0 @@
<template>
<!--优惠券-->
<view class="coupon-warp-box" :style="'margin-bottom: ' + meta.margin_bottom + 'px'" v-if="indexCoupon && indexCoupon.length">
<view class="coupon-item-box" :style="'background: ' + config.mainColor" v-for="(item, index) in indexCoupon" :key="index">
<view class="coupon-item">
<view class="left">
<block v-if="item.associate.action_type.type == 'cash'">
<span class="money">
</span>
<span class="num">
{{ item.associate.action_type.value }}
</span>
</block>
<block v-if="item.associate.action_type.type == 'discount'">
<span class="num">
{{ item.associate.action_type.value }}
</span>
<span class="money">
</span>
</block>
</view>
<view class="right">
<view class="label">
{{item.associate.title}}
</view>
<view class="btn" :style="'color: ' + config.mainColor" :data-code="item.associate.code" :data-index="index" v-if="!item.associate.has_get" @tap="getCoupon">
点击领取
</view>
<view class="btn" :data-id="item.associate_id" v-else catchtap="_jumpList">
去使用
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {};
},
props: {
config: {
type: Object,
value: ''
},
indexCoupon: {
type: Array,
value: ''
},
show: {
type: Number,
value: ''
},
meta: {
type: Object,
value: ""
}
},
//
methods: {
//
getCoupon(e) {
var code = e.currentTarget.dataset.code;
var index = e.currentTarget.dataset.index;
var myEventDetail = {
code: code,
index: index
};
this.$emit('myGetCoupon', myEventDetail);
},
_jumpList(e) {
var id = e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/coupon/goods/goods?id=' + id
});
}
}
};
</script>
<style rel="stylesheet/less" lang="less">
@import "index-coupon";
</style>

2
components/index-nav/index-nav.vue

@ -3,7 +3,7 @@
<view class="quick-nav" :style="'margin-bottom: ' + meta.margin_bottom + 'px'">
<scroll-view :scroll-x="true" class="scroll-view" @scroll="scroll">
<view class="nav-content">
<view class="nav-item" v-for="(item, index) in list" :key="index" @tap="_jumpImg" :data-src="item.link">
<view class="nav-item" v-for="(item, index) in navData" :key="index" @tap="_jumpImg" :data-src="item.link">
<view class="top-info">
<image :src="item.image"></image>
</view>

12
components/lf-indexFind/lf-indexFind.vue

@ -6,9 +6,9 @@
<!-- :class="{'max-item': index == 0}" -->
<view class="find-item"
@click="$url('/pages/discover/discoverdetails')"
v-for="(item, index) in 5" :key="index">
<image class="img" src="https://picsum.photos/200/300"></image>
<view class="lf-line-2 info">南边开风儿吹北边放花儿开西边来春归去东边来北边跑</view>
v-for="(item, index) in list" :key="index">
<image class="img" :src="item.image"></image>
<view class="lf-line-2 info">{{ item.associate.title }}</view>
</view>
</view>
<view style="height: 10rpx;"></view>
@ -18,6 +18,12 @@
<script>
export default {
props: {
list: {
type: Array,
default: []
}
},
data(){
return {
current: 0

25
components/lf-multiColumnAd/lf-multiColumnAd.vue

@ -1,14 +1,14 @@
<template>
<view class="content">
<view class="left" @click="$url('/pages/index/list/selected')">
<image class="left-img"></image>
<view class="left" @click="$url(cubeData[0].link)">
<image class="left-img" :src="cubeData[0].image"></image>
</view>
<view class="right">
<view class="right-img" @click="$msg('敬请期待')">
<image></image>
<view class="right-img" @click="$url(cubeData[1].link)">
<image :src="cubeData[1].image"></image>
</view>
<view class="right-img" @click="$msg('敬请期待')">
<image></image>
<view class="right-img" @click="$url(cubeData[2].link)">
<image :src="cubeData[2].image"></image>
</view>
</view>
</view>
@ -16,16 +16,11 @@
<script>
export default {
data(){
return {
props: {
cubeData: {
type: Array,
default: []
}
},
created(){
},
methods: {
}
}
</script>

12
components/lf-seckill/lf-seckill.vue

@ -2,7 +2,7 @@
<view class="content">
<view class="title">剁手不心疼</view>
<view class="card" @click="$url('/pages/shop/seckillList')">
<view class="title">秒杀购</view>
<view class="title">{{ title || '秒杀购' }}</view>
<view class="desc">低价不等人快来秒杀啦</view>
<scroll-view class="scroll-view" :scroll-x="true">
<view class="lf-flex">
@ -22,6 +22,16 @@
<script>
export default {
props: {
list: {
type: Array,
default: []
},
title: {
type: String,
default: ''
}
},
data(){
return {

15
pages/address/add/add.vue

@ -8,7 +8,7 @@
<view class="info-item">
<label for="name">姓名:</label>
<view class="form-control">
<input type="text" id="name" data-type="accept_name" :value="detail.accept_name" @input="input" />
<input type="text" id="name" placeholder="请输入收货人姓名" data-type="accept_name" :value="detail.accept_name" @input="input" />
</view>
</view>
<view class="info-item">
@ -30,7 +30,7 @@
<view class="info-item">
<label for="phone">联系电话:</label>
<view class="form-control">
<input type="number" maxlength="11" id="phone" data-type="mobile" :value="detail.mobile" @input="input" />
<input type="number" maxlength="11" placeholder="请输入联系电话" id="phone" data-type="mobile" :value="detail.mobile" @input="input" />
</view>
</view>
@ -70,14 +70,14 @@
<view class="info-item">
<label for="address">详细地址:</label>
<view class="form-control">
<input type="text" id="address" data-type="address" :value="detail.address" @input="input" />
<input type="text" id="address" data-type="address" placeholder="请输入详细地址" :value="detail.address" @input="input" />
</view>
</view>
<!-- TODO -->
<view class="info-item">
<label for="name">门牌号:</label>
<view class="form-control">
<input type="text" id="name" data-type="house_num" :value="house_num" @input="input" />
<input type="text" id="name" placeholder="请输入门牌号(选填)" data-type="house_num" :value="house_num" @input="input" />
</view>
</view>
<view class="info-item">
@ -425,6 +425,7 @@ export default {
area: data.area,
address_name: data.address_name.join(" "),
address: data.address,
house_num: data.house_num,
sex: data.sex,
is_default: data.is_default ? 1 : 0
};
@ -496,6 +497,7 @@ export default {
address_name: data.address_name.join(" "),
address: data.address,
house_num: data.house_num,
sex: data.sex,
is_default: data.is_default ? 1 : 0
};
var token = this.$cookieStorage.get('user_token');
@ -625,9 +627,12 @@ export default {
watch: {}
};
</script>
<style rel="stylesheet/less" lang="less" scoped>
<style lang="less" scoped>
@import "add";
.identify-address>textarea{
border-color: #e5e5e5 !important;
}
/deep/.input-placeholder{
font-weight: initial;
}
</style>

57
pages/address/list/list.vue

@ -31,21 +31,22 @@
</view>
<view class="lf-row-between">
<view @tap="setInfo(item)">
<text class="lf-iconfont icon--1"></text>
<text class="lf-iconfont icon-bianji"></text>
<text class="lf-m-l-10">编辑</text>
</view>
<view class="lf-m-l-50" @click="deleteAddress(item)">
<text class="lf-iconfont icon--1"></text>
<view class="lf-m-l-50 lf-color-red" @click="deleteAddress(item, index)">
<text class="lf-iconfont icon-shanchu"></text>
<text class="lf-m-l-10">删除</text>
</view>
</view>
</view>
</view>
<lf-nocontent src="/static/images/empty.png" text="您还未添加地址" v-if="list.length <= 0 && !is_load"></lf-nocontent>
</view>
<view style="height: 230rpx;"></view>
<view class="add-address" @tap="add">
<view class="small-btn">
<text class="lf-iconfont icon--2"></text>
<text class="lf-iconfont icon-jia"></text>
<text class="lf-m-l-10">新增收货地址</text>
</view>
</view>
@ -61,7 +62,8 @@ export default {
list: [],
order_no: '',
url: '',
id:''
id:'',
is_load: true
};
},
@ -89,8 +91,14 @@ export default {
props: {},
methods: {
//
deleteAddress(item){
deleteAddress(item, index){
console.log("item", item)
uni.showModal({
title: '温馨提示',
content: '您确定删除该收货地址吗?',
success: result => {
if(result.confirm){
var token = this.$cookieStorage.get('user_token');
this.$http.ajax({
api: '/api/address/'+ item.id,
@ -100,18 +108,45 @@ export default {
}
}).then(res => {
console.log("删除地址", res);
this.$msg('删除成功', {icon: 'success'});
this.list.splice(index, 1);
}).catch(err => {
this.$msg('删除失败', {icon: 'error'});
})
}
}
})
},
//
radioChange(e){
let current = e.target.value;
let id = null;
this.list.forEach((item, index) => {
if(current == index){
item.is_default = 1;
id = item.id;
}else{
item.is_default = 0;
}
})
this.switchDefaultAddress(id);
},
switchDefaultAddress(id){
var token = this.$cookieStorage.get('user_token');
this.$http.ajax({
api: 'api/address/'+ id,
method: 'PUT',
header: {
Authorization: token
},
data: {
is_default: 1
}
}).then(res => {
this.$msg('操作成功', {icon: 'success'});
}).catch(err => {
this.$msg('切换默认地址失败');
})
},
setInfo(e) {
// var from = e.currentTarget.dataset.info;
@ -150,6 +185,7 @@ export default {
//
queryAddressList() {
this.is_load = true;
var token = this.$cookieStorage.get('user_token');
this.$http.get({
api: 'api/address',
@ -176,7 +212,10 @@ export default {
image: '../../../static/error.png'
});
}
});
this.is_load = false;
}).catch(err => {
this.is_load = false;
})
},
setData: function (obj) {
@ -213,7 +252,9 @@ export default {
</style>
<style rel="stylesheet/less" lang="less">
@import "list";
.lf-color-red{
color: red;
}
.user-item, .menu-item{
height: 50rpx;
width: 100%;

26
pages/index/category/category.vue

@ -70,6 +70,7 @@
</view>
</view>
</view>
<lf-nocontent src="/static/images/empty.png" v-if="brand_list.length <= 0"></lf-nocontent>
</scroll-view>
<!-- 锚点定位 -->
<view class="fixed-point" v-if="point_list.length">
@ -148,7 +149,7 @@
},
onLoad(options) {
// https://ext.dcloud.net.cn/plugin?id=5031
this.getBrandList();
this.getBrandList({load: true});
if(this.$isRight(options)){
this.current = options.current || 1;
this.left_selectIndex = options.type || 0;
@ -167,15 +168,29 @@
// this.createAtoZ();
},
methods: {
getBrandList(){
getBrandList(options = {}){
let par = {};
if(options.filter){
let _floor = this.filter_list['floor'];
let _class = this.filter_list['class'];
if(_floor.current != null){
par.floor = _floor.list[_floor.current].name;
}
if(_class.current != null){
par.category_id = _class.current;
}
}
this.$http.get({
api: '/api/brand'
api: '/api/brand',
data: par
}).then(res => {
console.log("getBrandList", res);
if(options.load){
let category = res.data.data.category;
let floor = res.data.data.floor;
this.filter_list['floor'].list = floor;
this.filter_list['class'].list = category;
}
this.brand_list = res.data.data.list;
this.autoCreateAtoZ(res.data.data.list);
});
@ -193,8 +208,13 @@
//
selectFilter(item, index){
console.log(item, index);
if(this.filter_list[this.filter_active].current == index){
this.filter_list[this.filter_active].current = null;
}else{
this.filter_list[this.filter_active].current = index;
}
this.filter_active = '';
this.getBrandList({filter: true});
},
// A-Z
createAtoZ(){

74
pages/index/index/index.vue

@ -22,6 +22,7 @@
<!-- #endif -->
<block v-if="microData && microData.pages && microData.pages.length">
<view v-for="(item, index) in microData.pages" :key="index">
<!-- 菜单按钮和搜索按钮 -->
<!-- <view v-if="item.name == 'micro_page_componet_search'">
<view class="banner">
<view class="search">
@ -38,17 +39,23 @@
<indexBanner :banner-data="item.value" :banner-title="item.title" :screen-width="screenWidth" :show="item.is_show_title" :meta="item.meta"></indexBanner>
</view>
<!--优惠券组件-->
<view v-if="item.name == 'micro_page_componet_coupon' && item.value && item.value.length">
<!-- <view v-if="item.name == 'micro_page_componet_coupon' && item.value && item.value.length">
<indexCoupon :index-coupon="item.value" :config="config" @myGetCoupon="getCoupon" :show="item.is_show_title" :meta="item.meta"></indexCoupon>
</view> -->
<!--快捷导航-->
<view v-if="item.name == 'micro_page_componet_nav' && item.value && item.value.length">
<indexNav :nav-data="item.value" :meta="item.meta"></indexNav>
</view>
<!--套餐-->
<view v-if="item.name == 'micro_page_componet_suit' && item.value && item.value.length">
<indexSuit :suit-data="item.value" :index-data="indexData" :show="item.is_show_title" :meta="item.meta"></indexSuit>
</view>
<!--大咖推荐-->
<view v-if="item.name == 'micro_page_componet_article_-' && item.value && item.value.length">
<!-- <view v-if="item.name == 'micro_page_componet_article_-' && item.value && item.value.length">
<bigCoffee :coffee-data="item.value" :coffee-title="item.title" :show="item.is_show_title" :meta="item.meta"></bigCoffee>
</view>
</view> -->
<!--专属方案-->
<view v-if="item.name == 'micro_page_componet_article_|' && item.value && item.value.length">
<exclusivePlan :plan-data="item.value" :plan-title="item.title" :show="item.is_show_title" :meta="item.meta"></exclusivePlan>
@ -58,26 +65,23 @@
<healthTips :health-data="item.value" :title="item.title" :show="item.is_show_title" :meta="item.meta"></healthTips>
</view>
<!--猜你喜欢-->
<view v-if="item.name == 'micro_page_componet_guess_like' && item.value && item.value.length">
<!-- <view v-if="item.name == 'micro_page_componet_guess_like' && item.value && item.value.length">
<waterfallsFlow :water-data="item.value" :title="item.title" :show="item.is_show_title" :meta="item.meta"></waterfallsFlow>
</view>
</view> -->
<!--拼团-->
<view v-if="item.name == 'micro_page_componet_groupon' && item.value && item.value.length">
<indexGroupon :index-data="item.value" :config="config" :server="microData.server_time" typename="拼团" :meta="item.meta"></indexGroupon>
</view>
<!--秒杀-->
<view v-if="item.name == 'micro_page_componet_seckill' && item.value && item.value.length">
<!-- <view v-if="item.name == 'micro_page_componet_seckill' && item.value && item.value.length">
<indexSeckill :index-data="item.value" :config="config" :server="microData.server_time" :big-index="index" @:startevent="isStarts" @:endevent="isEnd"
:meta="item.meta"></indexSeckill>
</view>
</view> -->
<!--打call indexCall-->
<view v-if="item.name == 'micro_page_componet_free_event' && item.value && item.value.length">
<indexCall :call-data="item.value" :config="config" :is-login="isLogin" :server="microData.server_time" :meta="item.meta"></indexCall>
</view>
<!--快捷导航-->
<view v-if="item.name == 'micro_page_componet_nav' && item.value && item.value.length">
<indexNav :nav-data="item.value" :meta="item.meta"></indexNav>
</view>
<!-- 今日头条 TODO 暂时借用快捷导航字段判断 -->
<view class="fuwu-tips" v-if="item.name == 'micro_page_componet_nav' && item.value && item.value.length">
<view class="fuwu-tips-title">今日头条</view>
@ -87,45 +91,45 @@
<text class="fuwu-tips-desc2">(部分品牌满额包邮)</text> -->
</view>
</view>
<!-- 活动页入口 TODO -->
<view class="lf-activity" v-if="item.name == 'micro_page_componet_nav' && item.value && item.value.length" @click="$url('/pages/index/activity/goods')">
<image src="https://picsum.photos/200" mode="aspectFill"></image>
<!-- 活动页入口 TODO 根据旧版魔方修改,一张图 -->
<view class="lf-activity" v-if="item.name == 'micro_page_componet_cube' && item.value && item.value.length && item.type == '1_1'" @click="$url(item.value[0].link)">
<image :src="item.value[0].image" mode="aspectFill"></image>
</view>
<!-- TODO 新做秒杀模块 -->
<view v-if="item.name == 'micro_page_componet_nav' && item.value && item.value.length">
<lf-seckill></lf-seckill>
<!-- TODO 新做秒杀模块,根据旧版秒杀修改 -->
<view v-if="item.name == 'micro_page_componet_seckill' && item.value && item.value.length">
<lf-seckill :list="item.value" :title="item.title"></lf-seckill>
</view>
<!-- TODO 广告活动模块 -->
<view v-if="item.name == 'micro_page_componet_nav' && item.value && item.value.length">
<lf-multi-column-ad></lf-multi-column-ad>
<!-- TODO 广告活动模块根据旧版魔方修改,三张图 -->
<view v-if="item.name == 'micro_page_componet_cube' && item.value && item.value.length && item.type == '3_2'">
<lf-multi-column-ad :cube-data="item.value"></lf-multi-column-ad>
</view>
<!-- TODO 首页发现推荐模块 -->
<view v-if="item.name == 'micro_page_componet_nav' && item.value && item.value.length">
<lf-index-find></lf-index-find>
<!-- TODO 首页发现推荐模块根据大咖推荐文章修改 -->
<view v-if="item.name == 'micro_page_componet_article_-' && item.value && item.value.length">
<lf-index-find :list="item.value"></lf-index-find>
</view>
<!-- TODO 大牌不停推模块 - 店铺矩阵 -->
<view v-if="item.name == 'micro_page_componet_nav' && item.value && item.value.length">
<view v-if="item.name == 'micro_page_componet_category' && item.value && item.value.length">
<lf-index-shop-matrix></lf-index-shop-matrix>
</view>
<!-- TODO 店铺商品展示模块 -->
<view v-if="item.name == 'micro_page_componet_nav' && item.value && item.value.length">
<!-- TODO 店铺商品展示模块 可根据micro_page_componet_category修改 -->
<view v-if="item.name == 'micro_page_componet_category' && item.value && item.value.length">
<view class="lf-module-title" @click="$url('/pages/shop/goodsSpecial')">好物种草间</view>
<lf-shop-goods-card v-for="(d_item,d_index) in 2" :key="d_index"></lf-shop-goods-card>
<lf-shop-goods-card v-for="(d_item,d_index) in item.value" :key="d_index"></lf-shop-goods-card>
</view>
<!--图片魔方-->
<view v-if="item.name == 'micro_page_componet_cube' && item.value && item.value.length">
<!-- <view v-if="item.name == 'micro_page_componet_cube' && item.value && item.value.length">
<indexCube :cube-data="item.value" :show-type="item.type" :cube-title="item.title" :show="item.is_show_title" :meta="item.meta" :is-agent="userInfo.is_agent"></indexCube>
</view>
</view> -->
<!--分类商品-->
<view v-if="item.name == 'micro_page_componet_category' && item.value && item.value.length">
<!-- <view v-if="item.name == 'micro_page_componet_category' && item.value && item.value.length">
<indexCategory :category-data="item.value" :meta="item.meta"></indexCategory>
</view>
</view> -->
<!--商品分组-->
<view v-if="item.name == 'micro_page_componet_goods_group' && item.value && item.value.length">
<!-- <view v-if="item.name == 'micro_page_componet_goods_group' && item.value && item.value.length">
<indexGrouping :grouping-data="item.value" :meta="item.meta"></indexGrouping>
</view>
</view> -->
<!-- TODO 为你推荐模块 -->
<view v-if="item.name == 'micro_page_componet_nav' && item.value && item.value.length">
<view v-if="item.name == 'micro_page_componet_category' && item.value && item.value.length">
<view class="lf-module-title">为你推荐</view>
<view style="padding: 0 11px;">
<lf-waterfall :list="recommend_list"></lf-waterfall>
@ -396,7 +400,6 @@
import {pageLogin, getUrl,config,isBirthday,autoLogin} from '@/common/js/utils.js';
import indexBanner from '@/components/index-banner/index-banner';
import indexCube from '@/components/index-cube/index-cube';
import indexCoupon from '@/components/index-coupon/index-coupon';
import indexSuit from '@/components/index-suit/index-suit';
import bigCoffee from '@/components/big-coffee/big-coffee';
import exclusivePlan from "@/components/exclusive-plan/exclusive-plan";
@ -508,7 +511,6 @@
components: {
indexBanner,
indexCube,
indexCoupon,
indexSuit,
bigCoffee,
exclusivePlan,

1
pages/shop/shopdetail.vue

@ -242,7 +242,6 @@
title: item.name
}
})
// TODO list
if(tab_item.page == 1){
tab_item.list = list;
}else{

12
pages/user/my/center.vue

@ -153,7 +153,8 @@
userInfo: {mobile_replace: '正在获取'}, //
token: '', // token
code: '',
centerInfo: {}
centerInfo: {},
show_count: 0
}
},
onLoad(){
@ -177,6 +178,15 @@
this.getMeInfo();
this.getUcenter();
},
onShow(){
this.show_count++;
if(this.show_count > 1){
var token = this.$cookieStorage.get('user_token');
this.token = token || '';
this.getMeInfo();
this.getUcenter();
}
},
//
onPageScroll(event){
if(event.scrollTop >= 50){

21
pages/user/my/setting.vue

@ -79,7 +79,7 @@
</view>
</view>
<view class="lf-p-l-32 lf-p-r-32 lf-bg-white">
<view class="set-tag" @click="$msg('敬请期待')">
<view class="set-tag" @click="makePhoneCall">
<view class="lf-font-28 lf-color-black">
客服电话
</view>
@ -158,8 +158,25 @@
}
});
},
//
makePhoneCall(){
uni.makePhoneCall({
phoneNumber: String('13132794740')
})
},
signOut(){
this.$msg('敬请期待')
uni.showModal({
title: '温馨提示',
content: '您确定退出登录吗?',
success: result => {
if(result.confirm){
this.$cookieStorage.clear('user_token');
this.$msg('操作成功', {icon: 'success'}).then(() => {
this.$toBack();
});
}
}
})
}
}
}

Loading…
Cancel
Save