Merge branch 'master' of http://git.luyuan.tk/luyuan/deming into xbx
This commit is contained in:
commit
58dc04fc4d
@ -1,6 +1,14 @@
|
||||
export default {
|
||||
init(vm){
|
||||
return {
|
||||
// 获取首页轮播
|
||||
getIndexSwiper() {
|
||||
return vm.$u.post('adv/indexadv');
|
||||
},
|
||||
// 获取首页轮播
|
||||
getZhiBoSwiper() {
|
||||
return vm.$u.post('adv/divebroadcastxadv');
|
||||
},
|
||||
// 发现列表
|
||||
getArticlelist({ page, value, store_id, member_id, is_video_img }){
|
||||
return vm.$u.post('article/articlelist', {
|
||||
@ -29,6 +37,12 @@ export default {
|
||||
article_id: article_id,
|
||||
});
|
||||
},
|
||||
// 直播列表
|
||||
// getZhiboList() {
|
||||
// return vm.$u.post('article/articleCollect', {
|
||||
// article_id: article_id,
|
||||
// });
|
||||
// },
|
||||
// 屏蔽用户
|
||||
articleAddShield({ article_id, member_id }) {
|
||||
return vm.$u.post('article/articleAddShield', {
|
||||
@ -64,9 +78,10 @@ export default {
|
||||
return vm.$u.post('Goods/getGoodsClassifyList');
|
||||
},
|
||||
// 商品推荐
|
||||
getGoodsRecommend({page}){
|
||||
getGoodsRecommend({page, gc_id}){
|
||||
return vm.$u.post('Goods/getGoodsRecommend', {
|
||||
page: page
|
||||
page: page,
|
||||
gc_id: gc_id,
|
||||
});
|
||||
},
|
||||
// 购物车商品列表
|
||||
@ -121,16 +136,23 @@ export default {
|
||||
});
|
||||
},
|
||||
// 选择地区计算运费
|
||||
getFreight({ freight_hash, city_id, area_id }) {
|
||||
getFreight({ freight_hash, city_id, area_id, delivery }) {
|
||||
return vm.$u.post('Buy/change_addr', {
|
||||
freight_hash: freight_hash,
|
||||
city_id: city_id,
|
||||
area_id: area_id,
|
||||
delivery: delivery,
|
||||
});
|
||||
},
|
||||
// 商品详情
|
||||
// getGoodsDetails({ id }) {
|
||||
// return vm.$u.post('Goods/goodDetails', {
|
||||
// goods_id: id
|
||||
// });
|
||||
// },
|
||||
// 商品详情
|
||||
getGoodsDetails({ id }) {
|
||||
return vm.$u.post('Goods/goodDetails', {
|
||||
return vm.$u.post('goods/goodsInfo', {
|
||||
goods_id: id
|
||||
});
|
||||
},
|
||||
@ -155,6 +177,65 @@ export default {
|
||||
return vm.$u.post('ShopSearch/search',{
|
||||
keyword,page,order
|
||||
})
|
||||
},
|
||||
// 秒杀推荐
|
||||
recommendedSpike() {
|
||||
return vm.$u.post('Spike/recommendedSpike');
|
||||
},
|
||||
// 秒杀详情
|
||||
getSpikeInfo({ id }) {
|
||||
return vm.$u.post('Spike/spikeInfo', {
|
||||
groupbuy_id: id
|
||||
});
|
||||
},
|
||||
// 秒杀列表
|
||||
getSpikeList({ page }) {
|
||||
return vm.$u.post('spike/spikeList', {
|
||||
page: page
|
||||
});
|
||||
},
|
||||
// 拼团列表
|
||||
getPinTuanList({ page, gc_id }) {
|
||||
return vm.$u.post('Specialci/pintuanList', {
|
||||
page: page,
|
||||
gc_id: gc_id,
|
||||
});
|
||||
},
|
||||
// 拼团商品详情
|
||||
getPinTuanDetails({ pintuan_id }) {
|
||||
return vm.$u.post('Specialci/pintuanInfo', { pintuan_id: pintuan_id });
|
||||
},
|
||||
// pintuanPush
|
||||
getPinTuanPush() {
|
||||
return vm.$u.post('Specialci/pintuanPush');
|
||||
},
|
||||
// 商品分类(拼团分类)
|
||||
getGoodsClass() {
|
||||
return vm.$u.post('Specialci/goodsClass');
|
||||
},
|
||||
// 优惠券列表(要兑换的)
|
||||
getCouponList({ page, store_id, type, gc_id }) {
|
||||
return vm.$u.post('Coupon/CouponList', {
|
||||
page: page,
|
||||
store_id: store_id,
|
||||
type: type,
|
||||
gc_id: gc_id,
|
||||
});
|
||||
},
|
||||
// 领取优惠券
|
||||
getCoupon({ id }) {
|
||||
return vm.$u.post('Coupon/getCoupon', {
|
||||
vouchertemplate_id: id,
|
||||
});
|
||||
},
|
||||
// 我的优惠券(已有的)
|
||||
getMemberCouponList({ store_id, gc_id, type, status }) {
|
||||
return vm.$u.post('Coupon/getMemberCouponList', {
|
||||
store_id: store_id,
|
||||
gc_id: gc_id,
|
||||
type: type,
|
||||
status: status,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ export default {
|
||||
address,
|
||||
true_name,
|
||||
mobile_phone,
|
||||
// longitude,
|
||||
// longitude,
|
||||
// latitude,
|
||||
}) {
|
||||
return vm.$u.post('memberAddress/addressAdd', {
|
||||
@ -236,10 +236,28 @@ export default {
|
||||
if(refund_state) Object.assign(params, {refund_state: refund_state});
|
||||
return vm.$u.post('Order/orderList', params);
|
||||
},
|
||||
// 售后列表
|
||||
getAfterSaleList({ page }) {
|
||||
return vm.$u.post('order/afterSaleList', { page: page });
|
||||
},
|
||||
// 订单详情
|
||||
getOrderInfo({ order_id }) {
|
||||
return vm.$u.post('Order/orderInfo', { order_id: order_id });
|
||||
},
|
||||
// 取消订单
|
||||
cancelOrder({ order_id, msg = '' } = {}) {
|
||||
let params = { order_id: order_id };
|
||||
if(msg) Object.assign(params, {msg: msg});
|
||||
return vm.$u.post('Order/buyer_cancel', params);
|
||||
},
|
||||
// 删除订单
|
||||
deleteOrder({ order_id }) {
|
||||
return vm.$u.post('order/order_delete', { order_id: order_id });
|
||||
},
|
||||
// 确认收货
|
||||
confirmReceive ({ order_id }) {
|
||||
return vm.$u.post('Order/order_receive', { order_id: order_id });
|
||||
},
|
||||
// 查询订单的评价信息
|
||||
getOrderEvaluateInfo({ id }) {
|
||||
return vm.$u.post('Order/getOrderEvaluateInfo', { id: id });
|
||||
@ -284,6 +302,19 @@ export default {
|
||||
delMessage({ type }) {
|
||||
return vm.$u.post('/message/readMessage', { type });
|
||||
},
|
||||
|
||||
// 已读消息
|
||||
refreshToken({ }) {
|
||||
return vm.$u.post('/Auth/refreshToken', { });
|
||||
},
|
||||
// 屏蔽列表
|
||||
articlShieldList() {
|
||||
return vm.$u.post('/Article/articlShieldList');
|
||||
},
|
||||
// 取消屏蔽
|
||||
articleDelShield({ id }) {
|
||||
return vm.$u.post('article/articleDelShield', { member_id: id });
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
24
common/store/index.js
Normal file
24
common/store/index.js
Normal file
@ -0,0 +1,24 @@
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
Vue.use(Vuex)
|
||||
|
||||
const store = new Vuex.Store({
|
||||
state: {
|
||||
cartInfo: {}, // 购物车数据
|
||||
orderAddress: {}, // 下单时选择的地址
|
||||
},
|
||||
getters: {
|
||||
getOrderAddress(state) {
|
||||
return state.orderAddress;
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
updateCart(state, cart) {
|
||||
state.cartInfo = cart;
|
||||
},
|
||||
updateAddress(state, address) {
|
||||
state.orderAddress = address;
|
||||
}
|
||||
}
|
||||
})
|
||||
export default store;
|
@ -1,6 +1,10 @@
|
||||
<template>
|
||||
<view class="video-item" v-if="item" @click="toDetailsPage">
|
||||
<image class="head" :src="item.article_pic"></image>
|
||||
<image class="head" :src="item.article_pic" v-if="item.type == 1" ></image>
|
||||
<view class="header_fist" v-else>
|
||||
<view class="backes">111</view>
|
||||
<image class="head" :src="item.article_pic" ></image>
|
||||
</view>
|
||||
<view class="title" v-if="!isguanzhu">{{ item.article_title }}</view>
|
||||
<view class="jianjie">{{ item.article_content }}</view>
|
||||
<view class="user">
|
||||
@ -163,6 +167,16 @@
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
.header_fist{
|
||||
position: relative;
|
||||
.backes{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
background: #000000;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
@ -186,6 +200,7 @@ export default {
|
||||
this.$u.api.articleLike({
|
||||
article_id: this.item.article_id,
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if(res.errCode == 0) {
|
||||
this.$emit("getArticlelist");
|
||||
}
|
||||
@ -195,6 +210,7 @@ export default {
|
||||
this.$u.api.articleCollect({
|
||||
article_id: this.item.article_id,
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if(res.errCode == 0) {
|
||||
this.$emit("getArticlelist");
|
||||
}
|
||||
@ -205,12 +221,16 @@ export default {
|
||||
article_id: this.item.article_id,
|
||||
member_id: this.item.member_id,
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if(res.errCode == 0) {
|
||||
this.$emit("getArticlelist");
|
||||
}
|
||||
})
|
||||
},
|
||||
toDetailsPage() {
|
||||
uni.navigateTo({
|
||||
url: '/pageB/photo/index',
|
||||
});
|
||||
|
||||
},
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="items">
|
||||
<view class="item-top">
|
||||
<view class="item-top" @click="choiceAddress">
|
||||
<view class="user-info">
|
||||
<view class="user-name">{{ item.address_realname }}</view>
|
||||
<view class="user-pnone">{{ item.address_mob_phone | phoneFormat }}</view>
|
||||
@ -35,17 +35,15 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
/**
|
||||
* address
|
||||
* @description 地址
|
||||
* @property {Object} item 地址信息
|
||||
* @property {String} state 是否选择地址 choise
|
||||
*/
|
||||
export default {
|
||||
name: 'address-item',
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
props: ['item', 'current'],
|
||||
mounted() {
|
||||
// console.log(this.item);
|
||||
},
|
||||
props: ['item', 'current', 'state'],
|
||||
filters: {
|
||||
phoneFormat(value) {
|
||||
return value.replace(/^(\d{3})\d*(\d{4})$/, '$1****$2');
|
||||
@ -74,6 +72,15 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
choiceAddress() {
|
||||
if(this.state) {
|
||||
this.$store.commit('updateAddress', this.item);
|
||||
this.$u.route({
|
||||
type: 'navigateBack',
|
||||
url: '/pageC/cart/ConfirmOrder',
|
||||
})
|
||||
}
|
||||
},
|
||||
showToast(message, type) {
|
||||
this.$refs.uToast.show({
|
||||
title: message,
|
||||
|
@ -1,24 +1,24 @@
|
||||
<template>
|
||||
<view class="c-coupon">
|
||||
<view :class="status == 0 ? 'coupon-usable' : 'coupon-unable'">
|
||||
<view :class="type == 1 && status != 0 ? 'coupon-unable' : 'coupon-usable'">
|
||||
<view class="info-type" :style="{ backgroundImage: 'url(' + (status == 0 ? '/static/image/mine/30.png' : '/static/image/mine/31.png') + ')', backgroundSize:'contain', backgroundRepeat: 'no-repeat' }">
|
||||
<div class="wrap_left_top"></div>
|
||||
{{ couponInfo.index&1 ? '店铺优惠券' : '平台优惠券' }}
|
||||
{{ couponInfo.type == 2 ? '店铺优惠券' : '平台优惠券' }}
|
||||
</view>
|
||||
<view class="coupon-info">
|
||||
<view class="info-usable">
|
||||
<view class="price">¥<span>10</span></view>
|
||||
<view class="condition">满100使用</view>
|
||||
<view class="price">¥<span>{{ couponInfo.vouchertemplate_price }}</span></view>
|
||||
<view class="condition">满{{ couponInfo.vouchertemplate_limit }}使用</view>
|
||||
</view>
|
||||
<view class="info-store u-line-1">仅限 nike官方旗舰店 鞋子商品使用</view>
|
||||
<view class="info-integral">兑换积分:200积分</view>
|
||||
<view class="info-date">有效期2018.09.06-2018.10.06</view>
|
||||
<view class="info-store u-line-1">仅限{{ couponInfo.vouchertemplate_storename }}鞋子商品使用</view>
|
||||
<view class="info-integral">兑换积分:{{ couponInfo.vouchertemplate_points }}积分</view>
|
||||
<view class="info-date">有效期{{ couponInfo.vouchertemplate_startdate }}-{{ couponInfo.vouchertemplate_enddate }}</view>
|
||||
</view>
|
||||
<view class="coupon-btn">
|
||||
<text v-if="type == 0 && status == 0" @click="exchange">立即兑换</text>
|
||||
<text v-if="type == 0 && status == 0" @click="exchangeCoupon">立即兑换</text>
|
||||
<text v-if="type == 1 && status == 0" @click="use">立即使用</text>
|
||||
<image v-if="status == 1" src="/static/image/mine/28.png"></image>
|
||||
<image v-if="status == 2" src="/static/image/mine/29.png"></image>
|
||||
<image v-if="type == 1 && status == 1" src="/static/image/mine/28.png"></image>
|
||||
<image v-if="type == 1 && status == 2" src="/static/image/mine/29.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -27,7 +27,7 @@
|
||||
/**
|
||||
* coupon 优惠券
|
||||
* @description 优惠券组件
|
||||
* @property {Number} type 优惠券操作方式(兑换优惠券: 0 / 使用优惠券: 1)
|
||||
* @property {Number} type 优惠券操作方式(可兑换的优惠券: 0 / 自己的优惠券: 1)
|
||||
* @property {Object} coupon-info 优惠券信息
|
||||
* @event {Function} exchange 兑换优惠券
|
||||
* @event {Function} use 使用优惠券
|
||||
@ -41,12 +41,21 @@ export default {
|
||||
type: Number,
|
||||
couponInfo: Object,
|
||||
},
|
||||
created() {
|
||||
console.log(this.couponInfo);
|
||||
},
|
||||
methods: {
|
||||
exchange() {
|
||||
this.$emit('exchange', this.couponInfo.index);
|
||||
this.$emit('exchange', this.couponInfo.vouchertemplate_id);
|
||||
},
|
||||
exchangeCoupon() {
|
||||
this.$u.api.getCoupon({ id: this.couponInfo.vouchertemplate_id }).then(res => {
|
||||
this.$u.toast(res.message);
|
||||
if(res.errCode == 0) {}
|
||||
})
|
||||
},
|
||||
use() {
|
||||
this.$emit('use', this.couponInfo.index);
|
||||
this.$emit('use', this.couponInfo.vouchertemplate_id);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -23,9 +23,10 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-btn" v-if="[10, 30, 20, 40].indexOf(order.order_state) >= 0">
|
||||
<view class="logistics" v-if="order.order_state == 30">确认收货</view>
|
||||
<view class="logistics" v-if="order.order_state == 30" @click="toOtherPage('Logistics')">查看物流</view>
|
||||
<view class="comment" v-if="order.order_state == 40 && order.evaluation_state == 0" @click="toOtherPage('Comment')">立即评价</view>
|
||||
<view class="calcel" v-if="order.order_state == 10">取消支付</view>
|
||||
<view class="calcel" v-if="order.order_state == 10" @click="cancelOrder">取消支付</view>
|
||||
<view class="payment" v-if="order.order_state == 10">立即支付</view>
|
||||
<view class="service" v-if="order.order_state == 20">联系官方客服</view>
|
||||
<view class="submit" v-if="order.order_state == 20">提交官方审核</view>
|
||||
@ -36,7 +37,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
state: '', // 1: 待收货 2: 待评价 3: 交易成功 4: 已取消 5: 已退款 6: 待支付
|
||||
state: '', // 1: 待收货 2: 待评价 3: 交易成功 4: 已取消 5: 已退款 6: 待支付, 7: 售后
|
||||
}
|
||||
},
|
||||
props: {
|
||||
@ -69,8 +70,23 @@ export default {
|
||||
break;
|
||||
}
|
||||
if(this.order.refund_state) state = '已退款';
|
||||
// 申请退款
|
||||
if(this.order.refund_data) {
|
||||
if([1, 2].indexOf(this.order.refund_data.refund_state) >= 0) state = '待退款';
|
||||
if(this.order.refund_data.refund_state == 3) state = '已退款';
|
||||
}
|
||||
|
||||
this.state = state;
|
||||
},
|
||||
cancelOrder() {
|
||||
this.$u.api.cancelOrder({
|
||||
order_id: this.order.order_id,
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.$emit("refreshOrderList", { reload: 'again' });
|
||||
}
|
||||
})
|
||||
},
|
||||
toOtherPage(url) {
|
||||
this.$u.route('/pageE/order/' + url, {
|
||||
oid: this.order.order_id,
|
||||
|
@ -12,9 +12,7 @@
|
||||
<view v-if="type" class="welcome_jumpes" @click="leap_over">跳过{{remaining}}</view>
|
||||
<view v-if="banner" class="welcome_jumpes" @click="leap_overto">跳过</view>
|
||||
<!-- 轮播图 -->
|
||||
<view class="uni-padding-wrap" v-if="banner" style="height:300rpx">
|
||||
{{'ddd' + heightOut}}
|
||||
111
|
||||
<view class="uni-padding-wrap" v-if="banner" >
|
||||
<view>
|
||||
<view class="uni-padding-wrap">
|
||||
<view class="page-section swiper">
|
||||
@ -24,7 +22,7 @@
|
||||
<view class="swiper-item uni-bg-red">
|
||||
<image :src=" 'https://' + item.launch_path"></image>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
@ -199,10 +197,19 @@
|
||||
},
|
||||
durationChange(e) {
|
||||
this.duration = e.target.value
|
||||
},
|
||||
refreshToken_function(){
|
||||
this.$u.api.refreshToken({}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.errCode == 0) {
|
||||
let token = res.data.token;
|
||||
uni.setStorageSync('token', token);//存储toke值
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.refreshToken_function()
|
||||
// 3秒倒计时调用
|
||||
this.remaining_time()
|
||||
this.apiwelcome()
|
||||
@ -215,14 +222,14 @@
|
||||
// height: 400rpx;
|
||||
}
|
||||
.welcome_jumpes {
|
||||
width: 90rpx;
|
||||
height: 35rpx;
|
||||
width: 94rpx;
|
||||
height: 36rpx;
|
||||
opacity: 0.5;
|
||||
border-radius: 18rpx;
|
||||
position: absolute;
|
||||
right: 37rpx;
|
||||
top: 34rpx;
|
||||
font-size: 20rpx;
|
||||
top: 66rpx;
|
||||
font-size: 22rpx;
|
||||
text-align: center;
|
||||
line-height: 35rpx;
|
||||
color: #fff;
|
||||
|
@ -3,24 +3,83 @@
|
||||
<view class="top">
|
||||
商品推荐
|
||||
</view>
|
||||
<view class="label">
|
||||
<!-- <view class="label">
|
||||
<text v-for="item in classifyList" :key="item.gc_id">{{ item.gc_name }}</text>
|
||||
</view>
|
||||
<view class="item">
|
||||
<item v-for="item in goodsList" :key="item.goods_id" :info="item"></item>
|
||||
</view>
|
||||
</view> -->
|
||||
<view>
|
||||
<u-tabs-swiper ref="uTabs" :list="classifyList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="current" font-size="24" :show-bar="false" @change="tabsChange" height="60" ></u-tabs-swiper>
|
||||
</view>
|
||||
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" >
|
||||
<swiper-item class="swiper-item" v-for="(_, index) in classifyList" :key="index">
|
||||
<!-- <scroll-view scroll-y style="height: 800rpx;width: 100%;"> -->
|
||||
<view class="item">
|
||||
<item v-for="item in goodsList" :key="item.goods_id" :info="item"></item>
|
||||
</view>
|
||||
<u-empty text="暂无商品" mode="list" color="#000" v-if="!goodsList.length"></u-empty>
|
||||
<!-- </scroll-view> -->
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import item from "./item"
|
||||
export default {
|
||||
name:"list",
|
||||
name:"list",
|
||||
data() {
|
||||
return {
|
||||
current: Number,
|
||||
swiperCurrent: 0,
|
||||
goodsList: [],
|
||||
}
|
||||
},
|
||||
components:{
|
||||
item
|
||||
},
|
||||
props: {
|
||||
classifyList: Array,
|
||||
goodsList: Array,
|
||||
classifyList: Array
|
||||
},
|
||||
watch: {
|
||||
current(index) {
|
||||
const id = this.classifyList[index].gc_id;
|
||||
this.getGoodsRecommend(id);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.current = 0;
|
||||
console.log(this.classifyList);
|
||||
},
|
||||
methods: {
|
||||
getGoodsRecommend(gc_id) {
|
||||
this.$u.api.getGoodsRecommend({
|
||||
page: 1,
|
||||
gc_id: gc_id,
|
||||
}).then((res)=>{
|
||||
if (res.errCode == 0) {
|
||||
this.goodsList = res.data.goodsList;
|
||||
console.log(this.goodsList);
|
||||
}
|
||||
})
|
||||
},
|
||||
// tabs通知swiper切换
|
||||
tabsChange(index) {
|
||||
this.swiperCurrent = index;
|
||||
},
|
||||
// swiper-item左右移动,通知tabs的滑块跟随移动
|
||||
transition(e) {
|
||||
let dx = e.detail.dx;
|
||||
this.$refs.uTabs.setDx(dx);
|
||||
},
|
||||
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
|
||||
// swiper滑动结束,分别设置tabs和swiper的状态
|
||||
animationfinish(e) {
|
||||
let current = e.detail.current;
|
||||
this.$refs.uTabs.setFinishCurrent(current);
|
||||
this.swiperCurrent = current;
|
||||
this.current = current;
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -33,21 +92,21 @@ export default {
|
||||
text-align: center;
|
||||
color: #333;
|
||||
}
|
||||
.label{
|
||||
display: flex;
|
||||
color: #999;
|
||||
flex-wrap: wrap;
|
||||
>text{
|
||||
margin-right: 34rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
}
|
||||
.item{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
margin-top: 20rpx;
|
||||
// .label{
|
||||
// display: flex;
|
||||
// color: #999;
|
||||
// flex-wrap: wrap;
|
||||
// >text{
|
||||
// margin-right: 34rpx;
|
||||
// margin-bottom: 10rpx;
|
||||
// }
|
||||
// }
|
||||
// .item{
|
||||
// display: flex;
|
||||
// flex-wrap: wrap;
|
||||
// justify-content: space-between;
|
||||
// margin-top: 20rpx;
|
||||
|
||||
}
|
||||
// }
|
||||
}
|
||||
</style>
|
@ -1,29 +1,39 @@
|
||||
<template>
|
||||
<view class="recommend">
|
||||
<view class="top">
|
||||
<text>今日秒杀推荐</text>
|
||||
<text>{{ type == 'spike' ? '今日秒杀推荐' : '今日拼团推荐' }}</text>
|
||||
<text>点击查看更多></text>
|
||||
</view>
|
||||
<view class="connect">
|
||||
<view class="time">
|
||||
<image></image>
|
||||
<text>12:00</text>
|
||||
<view class="time" v-if="type == 'spike'">
|
||||
<image src="/static/image/common/15.png"></image>
|
||||
<text>{{ info.groupbuy_starttime_histime }}</text>
|
||||
</view>
|
||||
<view class="info">
|
||||
<text>修身套头上衣</text>
|
||||
<text class="u-line-2">珂莱蒂尔雪纺衫2020春装新简约百搭V领蕾丝九分... </text>
|
||||
<text class="u-line-1">{{ type == 'spike' ? info.groupbuy_name : '' }}</text>
|
||||
<text class="u-line-2">{{ info.goods_name }}</text>
|
||||
<view>
|
||||
<text>¥99</text>
|
||||
<text>¥299</text>
|
||||
<text>¥{{ info.groupbuy_price }}</text>
|
||||
<text>¥{{ info.goods_price }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<image class="img"></image>
|
||||
<image class="img" :src="info.groupbuy_image1"></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name:"recommend"
|
||||
name:"recommend",
|
||||
data() {
|
||||
return {
|
||||
info: {}
|
||||
}
|
||||
},
|
||||
props: ['recommendData', 'type'],
|
||||
created() {
|
||||
this.info = this.recommendData;
|
||||
console.log(this.recommendData);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@ -48,7 +58,7 @@ export default {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-right: 18rpx;
|
||||
margin-right: 28rpx;
|
||||
justify-content: center;
|
||||
>image{
|
||||
width: 90rpx;
|
||||
@ -62,6 +72,7 @@ export default {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.info{
|
||||
width: 340rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
>text:nth-child(1){
|
||||
@ -87,6 +98,7 @@ export default {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-left: 33rpx;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,21 +4,25 @@
|
||||
<view class="title">
|
||||
<view class="name">全部秒杀</view>
|
||||
<view class="time">
|
||||
<text class="num">12</text>
|
||||
<text class="num">{{ time.littleHour }}</text>
|
||||
<text class="mah">:</text>
|
||||
<text class="num">12</text>
|
||||
<text class="num">00</text>
|
||||
<text class="mah">:</text>
|
||||
<text class="num">12</text>
|
||||
<text class="num">00</text>
|
||||
<text>-</text>
|
||||
<text class="num">{{ time.bigHour }}</text>
|
||||
<text class="mah">:</text>
|
||||
<text class="num">00</text>
|
||||
<text class="mah">:</text>
|
||||
<text class="num">00</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="next">
|
||||
<view class="next" @click="viewMore">
|
||||
查看更多>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<sitem></sitem>
|
||||
<sitem></sitem>
|
||||
<sitem></sitem>
|
||||
<sitem v-for="(item, index) in list.slice(0, 3)" :key="index" :item="item"></sitem>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -28,7 +32,15 @@ export default {
|
||||
name:"seckill",
|
||||
components:{
|
||||
sitem
|
||||
}
|
||||
},
|
||||
props: ['list', 'time'],
|
||||
methods: {
|
||||
viewMore() {
|
||||
this.$u.route({
|
||||
url: '/pageC/spike/index',
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@ -46,15 +58,17 @@ export default {
|
||||
color: #333;
|
||||
}
|
||||
.time{
|
||||
margin-left: 39rpx;
|
||||
margin-left: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 20rpx;
|
||||
.num{
|
||||
box-sizing: content-box;
|
||||
width: 25rpx;
|
||||
height: 25rpx;
|
||||
background-color: #bfbfbf;
|
||||
margin: 0 10rpx;
|
||||
padding: 2rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,25 +1,33 @@
|
||||
<template>
|
||||
<view class="item">
|
||||
<image class="head"></image>
|
||||
<text class="title">商品名</text>
|
||||
<image class="head" :src="item.groupbuy_image1"></image>
|
||||
<text class="title u-line-2">{{ item.goods_name }}</text>
|
||||
<view class="price">
|
||||
<text>¥99</text>
|
||||
<text>¥299</text>
|
||||
<text>¥{{ item.groupbuy_price }}</text>
|
||||
<text>¥{{ item.goods_price }}</text>
|
||||
</view>
|
||||
<view class="info">
|
||||
<text>剩余21件</text>
|
||||
<text>剩余{{ item.inventory | formatValue }}件</text>
|
||||
<text>立即购买</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name:"item"
|
||||
name:"item",
|
||||
props: ['item'],
|
||||
filters: {
|
||||
formatValue(value) {
|
||||
let temp = Number(value);
|
||||
if(temp > 999) temp = '999+';
|
||||
return temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.item{
|
||||
width: 210rpx;
|
||||
width: 220rpx;
|
||||
.head{
|
||||
width: 210rpx;
|
||||
height: 131rpx;
|
||||
@ -43,6 +51,7 @@ export default {
|
||||
>text:last-child{
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
}
|
||||
@ -50,7 +59,7 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 22rpx;
|
||||
font-size: 20rpx;
|
||||
margin-top: 19rpx;
|
||||
>text:first-child{
|
||||
color: #666;
|
||||
|
91
components/shop/special-shop/index.vue
Normal file
91
components/shop/special-shop/index.vue
Normal file
@ -0,0 +1,91 @@
|
||||
<template>
|
||||
<view class="special">
|
||||
<image :src="item.groupbuy_image1"></image>
|
||||
<view class="right">
|
||||
<view class="name u-line-1">{{ item.goods_name }}</view>
|
||||
<view class="price" v-if="type == 'spike'">
|
||||
<view class="groupbuy-price">{{ item.groupbuy_price }}</view>
|
||||
<view class="goods-price">{{ item.goods_price }}</view>
|
||||
</view>
|
||||
<view class="buy">
|
||||
<view class="num">剩余{{ item.inventory }}件</view>
|
||||
<view class="btn">立即购买</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
props: {
|
||||
item: Object,
|
||||
type: String,
|
||||
},
|
||||
created() {
|
||||
console.log(this.item);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.special {
|
||||
margin-bottom: 30rpx;
|
||||
display: flex;
|
||||
width: 690rpx;
|
||||
background: rgba(245,245,245,1);
|
||||
border-radius: 6rpx;
|
||||
> image {
|
||||
flex-shrink: 0;
|
||||
width: 210rpx;
|
||||
height: 170rpx;
|
||||
border-radius: 6rpx 0rpx 0rpx 6rpx;
|
||||
}
|
||||
.right {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx;
|
||||
.name {
|
||||
width: 400rpx;
|
||||
font-size: 26rpx;
|
||||
color: rgba(51,51,51,1);
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.price {
|
||||
display: flex;
|
||||
.groupbuy-price {
|
||||
font-size: 26rpx;
|
||||
color: rgba(255,49,49,1);
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.goods-price {
|
||||
font-size: 24rpx;
|
||||
text-decoration: line-through;
|
||||
color: rgba(153,153,153,1);
|
||||
}
|
||||
}
|
||||
.buy {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.num {
|
||||
font-size: 22rpx;
|
||||
color: rgba(102,102,102,1);
|
||||
}
|
||||
.btn {
|
||||
width: 140rpx;
|
||||
height: 50rpx;
|
||||
background: rgba(255,120,15,1);
|
||||
border-radius: 25rpx;
|
||||
font-size: 22rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(255,255,255,1);
|
||||
line-height: 50rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,72 +1,119 @@
|
||||
<template>
|
||||
<view class="youhq">
|
||||
<view class="top">
|
||||
<text>全部优惠券</text>
|
||||
<text>查看更多></text>
|
||||
</view>
|
||||
<view class="label">
|
||||
<text>sda</text>
|
||||
<text>asda</text>
|
||||
<text>dsad</text>
|
||||
<text>asdas</text>
|
||||
</view>
|
||||
<scroll-view style="width:100%;margin-top: 21rpx;" scroll-x="true">
|
||||
<view class="list">
|
||||
<sitem></sitem>
|
||||
<sitem></sitem>
|
||||
<sitem></sitem>
|
||||
<sitem></sitem>
|
||||
<sitem></sitem>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
|
||||
</view>
|
||||
<view class="coupon-swiper">
|
||||
<view class="top">
|
||||
<view class="title">全部优惠券</view>
|
||||
<view class="view-more" @click="toCouponPage">查看更多></view>
|
||||
</view>
|
||||
<u-tabs-swiper ref="coupon" :list="couponGroupList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="couponCurrent" font-size="24" :show-bar="false" @change="couponTabsChange" height="88" ></u-tabs-swiper>
|
||||
<!-- :style="{ height: swiperHeight }" -->
|
||||
<swiper :current="swiperCouponCurrent" @animationfinish="couponAnimationFinish">
|
||||
<swiper-item class="swiper-coupon-item" v-for="(_, i) in couponGroupList" :key="i">
|
||||
<!-- <scroll-view scroll-y style="height: 100%;"> -->
|
||||
<view v-for="(coupon, index) in couponList.slice(0, 4)" :key="index" class="coupon-item">
|
||||
<Coupon :couponInfo="coupon" :status='0' :type="0"></Coupon>
|
||||
</view>
|
||||
<u-empty text="暂无优惠券" mode="coupon" color="#000" v-if="!couponList.length"></u-empty>
|
||||
<!-- </scroll-view> -->
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import sitem from "./item"
|
||||
import Coupon from "@/components/mine/coupon/index";
|
||||
export default {
|
||||
name:"youhq",
|
||||
components:{
|
||||
sitem
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
data() {
|
||||
return {
|
||||
swiperHeight: '',
|
||||
couponCurrent: 0,
|
||||
swiperCouponCurrent: 0,
|
||||
couponGroupList: [],
|
||||
couponList: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
Coupon
|
||||
},
|
||||
watch: {
|
||||
couponCurrent(index) {
|
||||
const id = this.couponGroupList[index].gc_id;
|
||||
this.getCouponList(id);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.setViewHeight();
|
||||
this.getGoodsClass();
|
||||
},
|
||||
methods: {
|
||||
getGoodsClass() {
|
||||
this.$u.api.getGoodsClass().then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.couponGroupList = res.data;
|
||||
this.getCouponList(this.couponGroupList[0].gc_id);
|
||||
}
|
||||
})
|
||||
},
|
||||
getCouponList(gc_id) {
|
||||
this.$u.api.getCouponList({
|
||||
page: 0,
|
||||
gc_id: gc_id,
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.couponList = res.data;
|
||||
} else {
|
||||
this.couponList = [];
|
||||
}
|
||||
})
|
||||
},
|
||||
couponTabsChange(index) {
|
||||
this.couponCurrent = index;
|
||||
},
|
||||
couponAnimationFinish(e) {
|
||||
const current = e.detail.current;
|
||||
this.swiperCouponCurrent = current;
|
||||
this.couponCurrent = current;
|
||||
},
|
||||
setViewHeight() {
|
||||
const res = uni.getSystemInfoSync();
|
||||
// this.swiperHeight = res.windowHeight - ((88 + 10 + 88) / 2) + 'px';
|
||||
this.swiperHeight = '450px';
|
||||
},
|
||||
toCouponPage() {
|
||||
this.$u.route({
|
||||
url: '/pageE/mine/MemberServe',
|
||||
params: {
|
||||
current: 1
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.youhq{
|
||||
.top{
|
||||
height: 90rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
>text:first-child{
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
>text:last-child{
|
||||
font-size: 18rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
.label{
|
||||
display: flex;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
>text{
|
||||
margin-right: 34rpx;
|
||||
}
|
||||
}
|
||||
.list{
|
||||
display: flex;
|
||||
// justify-content: space-between;
|
||||
width: auto;
|
||||
|
||||
}
|
||||
.coupon-swiper {
|
||||
.top {
|
||||
padding-top: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(51,51,51,1);
|
||||
}
|
||||
.view-more {
|
||||
font-size: 18rpx;
|
||||
color: rgba(153,153,153,1);
|
||||
}
|
||||
}
|
||||
.swiper-coupon-item {
|
||||
box-sizing: border-box;
|
||||
background-color: #ffffff;
|
||||
// padding: 30rpx {
|
||||
// top: 0;
|
||||
// };
|
||||
.coupon-item {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,83 +0,0 @@
|
||||
<template>
|
||||
<view class="item">
|
||||
<view class="top">
|
||||
<view class="pic">
|
||||
<text>¥</text>
|
||||
<text>12</text>
|
||||
</view>
|
||||
<view class="man">
|
||||
<text></text>
|
||||
<text></text>
|
||||
</view>
|
||||
<text class="button">
|
||||
立即<br />领取
|
||||
</text>
|
||||
</view>
|
||||
<view class="time">
|
||||
使用时间:2020.01.24-2020.05.08
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name:"item"
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.item{
|
||||
padding: 10rpx;
|
||||
|
||||
width: 254rpx;
|
||||
height: 94rpx;
|
||||
border: 2rpx solid #FDD360;
|
||||
border-radius: 20rpx;
|
||||
flex-shrink: 0;
|
||||
margin-right: 16rpx;
|
||||
.top{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.pic{
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
color:#FDD360;
|
||||
>text:first-child{
|
||||
font-size: 24rpx;
|
||||
}
|
||||
>text:last-child{
|
||||
font-size: 48rpx;
|
||||
}
|
||||
}
|
||||
.man{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
color: #FDD360;
|
||||
>text:first-child{
|
||||
font-size: 14rpx;
|
||||
|
||||
}
|
||||
>text:last-child{
|
||||
font-size: 18rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.button{
|
||||
width: 61rpx;
|
||||
height: 61rpx;
|
||||
border-radius: 50%;
|
||||
font-size: 18rpx;
|
||||
background-color: #FDD360;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
.time{
|
||||
font-size: 12rpx;
|
||||
color: #FDD360;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
</style>
|
8
main.js
8
main.js
@ -1,12 +1,18 @@
|
||||
import Vue from 'vue'
|
||||
import App from './App'
|
||||
|
||||
import uView from "uview-ui";
|
||||
Vue.config.productionTip = false
|
||||
Vue.use(uView);
|
||||
App.mpType = 'app'
|
||||
|
||||
import store from '@/common/store/index.js'
|
||||
|
||||
Vue.prototype.$store = store;
|
||||
|
||||
const app = new Vue({
|
||||
...App
|
||||
...App,
|
||||
store
|
||||
})
|
||||
// http拦截器,将此部分放在new Vue()和app.$mount()之间,才能App.vue中正常使用
|
||||
import httpInterceptor from '@/common/http.interceptor.js'
|
||||
|
5
package-lock.json
generated
5
package-lock.json
generated
@ -8,6 +8,11 @@
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-1.5.0.tgz",
|
||||
"integrity": "sha512-1UdMUGJqWx60ALbXXXs3rQHKUNBARDIV5XHc06mKFxpccO/i0tzoSqS6RuPdmYwXU1q59wnIU+NLABvcU5u4vw=="
|
||||
},
|
||||
"vuex": {
|
||||
"version": "3.5.1",
|
||||
"resolved": "https://registry.npmjs.org/vuex/-/vuex-3.5.1.tgz",
|
||||
"integrity": "sha512-w7oJzmHQs0FM9LXodfskhw9wgKBiaB+totOdb8sNzbTB2KDCEEwEs29NzBZFh/lmEK1t5tDmM1vtsO7ubG1DFw=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,8 +11,9 @@
|
||||
"url": "http://git.luyuan.tk/luyuan/deming.git"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"uview-ui": "^1.5.0"
|
||||
"uview-ui": "^1.5.0",
|
||||
"vuex": "^3.5.1"
|
||||
}
|
||||
}
|
||||
|
@ -418,7 +418,7 @@
|
||||
// line-height: 36px;
|
||||
}
|
||||
|
||||
.pact>view:first-child {
|
||||
.pact>view:first-child {
|
||||
float: left;
|
||||
|
||||
}
|
||||
|
@ -67,15 +67,16 @@ export default {
|
||||
this.id = id;
|
||||
this.$u.api.getGoodsDetails({ id: id }).then((res)=>{
|
||||
if (res.errCode == 0) {
|
||||
this.goodsInfo = res.data;
|
||||
this.goodsInfo.goods_image_mobile.forEach(item => {
|
||||
this.goodsInfo = res.data.goods;
|
||||
let list = [];
|
||||
res.data.goods_image[0].forEach(item => {
|
||||
let temp = {
|
||||
image: item
|
||||
}
|
||||
this.list.push(temp);
|
||||
list.push(temp);
|
||||
})
|
||||
this.list = list;
|
||||
// console.log(this.goodsInfo.mobile_body);
|
||||
|
||||
}
|
||||
})
|
||||
this.$u.api.goodsInfo({id}).then((res)=>{
|
||||
|
@ -26,7 +26,8 @@
|
||||
<view class="name u-line-2">{{ goods.goods_name }}</view>
|
||||
<view class="cart-info">
|
||||
<view class="price">¥{{ goods.goods_price }}</view>
|
||||
<u-number-box :input-width="38" :input-height="39" :size="22" bg-color="#FFFFFF" color="#FF780F" :index="g_index" v-model="goods.goods_num"></u-number-box>
|
||||
<!-- <u-number-box :input-width="38" :input-height="39" :size="22" bg-color="#FFFFFF" color="#FF780F" :index="g_index" v-model="goods.goods_num" :disabled="true"></u-number-box> -->
|
||||
<view>×{{ goods.goods_num }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -36,17 +37,17 @@
|
||||
<view>
|
||||
<view class="title">优惠券折扣</view>
|
||||
<view class="value">
|
||||
<view>-¥10.00</view>
|
||||
<view>{{ index }}</view>
|
||||
<image src="../static/image/1.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view>
|
||||
<view class="title">支付方式</view>
|
||||
<view>
|
||||
<view class="title">运费</view>
|
||||
<view class="value">
|
||||
<view>微信</view>
|
||||
<image src="../static/image/1.png"></image>
|
||||
<view v-if="freight">¥{{ freight | setFreight(index) }}</view>
|
||||
<!-- <image src="../static/image/1.png"></image> -->
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -58,10 +59,10 @@
|
||||
<image src="../static/image/1.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view @click="showDelivery=true">
|
||||
<view class="title">配送方式</view>
|
||||
<view class="value">
|
||||
<view>快递</view>
|
||||
<view>{{ delivery.text }}</view>
|
||||
<image src="../static/image/1.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
@ -69,70 +70,145 @@
|
||||
<view class="bottom">
|
||||
<view class="left">
|
||||
<view class="title">合计:</view>
|
||||
<view class="price">¥{{ orderInfo.store_goods_total | showTotalPrice }}</view>
|
||||
<view class="price">¥{{ totalPrice }}</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="num">共件{{ orderInfo.store_cart_list | setTotalNumber }}商品</view>
|
||||
<view class="btn" @click="settlement">结算</view>
|
||||
<view class="btn" @click="sendOrder">结算</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-action-sheet :list="deliveryList" @click="setDelivery" border-radius="10" v-model="showDelivery"></u-action-sheet>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
showDelivery: false,
|
||||
orderInfo: {},
|
||||
totalPrice: '0.00',
|
||||
addressInfo: {},
|
||||
freight: '',
|
||||
freight: {}, // 运费
|
||||
isTakeawayer: '', // 是否支持骑手
|
||||
deliveryList: [{
|
||||
text: '快递',
|
||||
value: 'express',
|
||||
}, {
|
||||
text: '骑手',
|
||||
value: 'takeawayer',
|
||||
}],
|
||||
delivery: {
|
||||
text: '快递',
|
||||
value: 'express',
|
||||
}, // 配送方式
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
showTotalPrice(object) {
|
||||
let price = 0;
|
||||
for (const key in object) {
|
||||
if (object.hasOwnProperty(key)) {
|
||||
const element = object[key];
|
||||
price += Number(element);
|
||||
}
|
||||
}
|
||||
return price.toFixed(2);
|
||||
},
|
||||
setTotalNumber(data) {
|
||||
let num = 0;
|
||||
for (const key in data) {
|
||||
if (data.hasOwnProperty(key)) {
|
||||
const element = data[key][0];
|
||||
console.log(element);
|
||||
num += element.goods_num;
|
||||
const element = data[key];
|
||||
element.forEach(item => {
|
||||
num += item.goods_num;
|
||||
})
|
||||
}
|
||||
}
|
||||
return num;
|
||||
},
|
||||
setFreight(freight, index) {
|
||||
return freight[index];
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
console.log(JSON.parse(option.info));
|
||||
this.orderInfo = JSON.parse(option.info);
|
||||
this.addressInfo = this.orderInfo.address_info;
|
||||
this.showTotalPrice();
|
||||
this.getFreight();
|
||||
this.orderInfo = this.$store.state.cartInfo;
|
||||
},
|
||||
onShow() {
|
||||
// 判断是不是从选择地址页面返回
|
||||
if(JSON.stringify(this.$store.state.orderAddress) == '{}') {
|
||||
this.$store.commit('updateAddress', this.orderInfo.address_info);
|
||||
} else {
|
||||
this.addressInfo = this.$store.state.orderAddress;
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$store.commit('updateAddress', {});
|
||||
},
|
||||
watch: {
|
||||
'$store.state.orderAddress'(value) {
|
||||
this.addressInfo = value;
|
||||
this.getFreight();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showTotalPrice() {
|
||||
|
||||
sendOrder() {
|
||||
// 拼接后端需要的数据形式
|
||||
let id = [], temp = '';
|
||||
const object = this.orderInfo.store_cart_list;
|
||||
for (const key in object) {
|
||||
if (object.hasOwnProperty(key)) {
|
||||
const element = object[key];
|
||||
element.forEach(item => {
|
||||
temp = item.cart_id + '|' + item.goods_num;
|
||||
id.push(temp);
|
||||
temp = '';
|
||||
})
|
||||
}
|
||||
}
|
||||
this.$u.api.sendOrder({
|
||||
ifcart: 1,
|
||||
cart_id: id,
|
||||
address_id: this.addressInfo.address_id,
|
||||
buy_city_id: this.addressInfo.city_id,
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.$u.route({
|
||||
url: '/pageC/cart/cashier',
|
||||
params: {
|
||||
pay_sn: res.data.pay_sn,
|
||||
price: res.data.order_total_amount,
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getFreight() {
|
||||
this.$u.api.getFreight({
|
||||
freight_hash: this.orderInfo.freight_hash,
|
||||
city_id: this.addressInfo.city_id,
|
||||
area_id: this.addressInfo.area_id,
|
||||
delivery: this.delivery.value,
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
// this.freight = res.
|
||||
this.freight = res.data.content;
|
||||
this.isTakeawayer = res.data.delivery.takeawayer;
|
||||
this.setTotalPrice(); // 计算总价
|
||||
}
|
||||
})
|
||||
},
|
||||
setTotalPrice(object) {
|
||||
const goods = this.orderInfo.store_goods_total;
|
||||
const freight = this.freight;
|
||||
let price = 0;
|
||||
[goods, freight].forEach(object => {
|
||||
for (const key in object) {
|
||||
if (object.hasOwnProperty(key)) {
|
||||
const element = object[key];
|
||||
price += Number(element);
|
||||
}
|
||||
}
|
||||
})
|
||||
// console.log(price);
|
||||
this.totalPrice = price.toFixed(2);
|
||||
},
|
||||
setDelivery(index) {
|
||||
if(index == 1) {
|
||||
if(!this.isTakeawayer) this.$u.toast('此地区不支持骑手配送');
|
||||
return false;
|
||||
}
|
||||
this.delivery = this.deliveryList[index];
|
||||
this.getFreight();
|
||||
},
|
||||
settlement() {
|
||||
uni.navigateTo({
|
||||
url: '/pageE/order/Details'
|
||||
@ -140,7 +216,7 @@ export default {
|
||||
},
|
||||
changeAddress() {
|
||||
uni.navigateTo({
|
||||
url: '/pageE/more/Address'
|
||||
url: '/pageE/more/Address?type=choose'
|
||||
});
|
||||
}
|
||||
},
|
||||
@ -191,6 +267,7 @@ export default {
|
||||
.main {
|
||||
margin-bottom: 50rpx;
|
||||
> view {
|
||||
margin-bottom: 20rpx;
|
||||
.goods-info {
|
||||
background-color: #ffffff;
|
||||
padding: 30rpx;
|
||||
|
188
pageC/cart/cashier.vue
Normal file
188
pageC/cart/cashier.vue
Normal file
@ -0,0 +1,188 @@
|
||||
<template>
|
||||
<view class="cashier">
|
||||
<view class="top">
|
||||
<view class="title">支付金额</view>
|
||||
<view class="price">¥{{ price }}</view>
|
||||
</view>
|
||||
<view class="pay-view">
|
||||
<u-radio-group v-model="pay_way" @change="radioGroupChange" size="16">
|
||||
<view v-for="(item, index) in payLiat" :key="index" class="pay-item">
|
||||
<view class="pay-way">
|
||||
<image :src="item.icon"></image>
|
||||
<text class="name">{{ item.pay_way }}</text>
|
||||
</view>
|
||||
<view class="radio-view" :class="pay_way == item.name ? 'active' : 'default'">
|
||||
<u-radio :name="item.name" active-color="#FF780F" :disabled="item.disabled"></u-radio>
|
||||
</view>
|
||||
</view>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
<view class="pay-btn" @click="sendPay">去支付</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
payLiat: [
|
||||
{
|
||||
name: 'wxpay_app',
|
||||
icon: '/static/image/common/14.png',
|
||||
pay_way: '微信支付',
|
||||
disabled: false,
|
||||
},
|
||||
{
|
||||
name: 'alipay_app',
|
||||
icon: '/static/image/common/13.png',
|
||||
pay_way: '支付宝',
|
||||
disabled: false,
|
||||
}
|
||||
],
|
||||
pay_way: '',
|
||||
pay_sn: '',
|
||||
price: '',
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.pay_sn = option.pay_sn;
|
||||
this.price = option.price;
|
||||
},
|
||||
methods: {
|
||||
radioGroupChange(e) {
|
||||
// console.log(e);
|
||||
},
|
||||
// getProvider() {
|
||||
// uni.getProvider({service: 'payment'})
|
||||
// },
|
||||
// 支付宝支付
|
||||
payByAlipay (orderInfo) {
|
||||
uni.requestPayment({
|
||||
provider: 'alipay',
|
||||
orderInfo: orderInfo, //支付宝订单数据
|
||||
success: function (res) {
|
||||
console.log('success:' + JSON.stringify(res));
|
||||
},
|
||||
fail: function (err) {
|
||||
console.log('fail:' + JSON.stringify(err));
|
||||
}
|
||||
});
|
||||
},
|
||||
// 微信支付
|
||||
payByWxpay (orderInfo) {
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
orderInfo: orderInfo, //微信订单数据
|
||||
success: function (res) {
|
||||
console.log('success:' + JSON.stringify(res));
|
||||
},
|
||||
fail: function (err) {
|
||||
console.log('fail:' + JSON.stringify(err));
|
||||
}
|
||||
});
|
||||
},
|
||||
sendPay() {
|
||||
this.$u.api.sendPay({
|
||||
pay_sn: this.pay_sn,
|
||||
payment_code: this.pay_way,
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
// this.$u.toast(res.message);
|
||||
// uni.navigateBack();
|
||||
const orderInfo = JSON.parse(res.data.content);
|
||||
console.log(orderInfo);
|
||||
this.pay_way == 'wxpay_app' ? this.payByWxpay(orderInfo) : this.payByAlipay(orderInfo);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.cashier {
|
||||
min-height: calc(100vh - var(--window-top));
|
||||
background-color: #ECECEC;
|
||||
padding-top: 1rpx;
|
||||
.top {
|
||||
margin-bottom: 20rpx;
|
||||
height: 240rpx;
|
||||
background:rgba(255,255,255,1);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
color: rgba(51,51,51,1);
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
.price {
|
||||
font-size: 42rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(243,13,13,1);
|
||||
}
|
||||
}
|
||||
.pay-view {
|
||||
/deep/ .u-radio-group {
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
.radio-view {
|
||||
padding: 6rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.active {
|
||||
border: 2rpx solid rgba(255,120,15,1);
|
||||
}
|
||||
.default {
|
||||
border: 2rpx solid rgba(219,219,219,1);
|
||||
}
|
||||
.u-radio {
|
||||
.u-icon {
|
||||
border-color: rgba(219,219,219,1);
|
||||
background-color: rgba(219,219,219,1);
|
||||
.u-icon__icon::before {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
.pay-item {
|
||||
height: 98rpx;
|
||||
background: rgba(255,255,255,1);
|
||||
padding: 24rpx 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 2rpx;
|
||||
.pay-way {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
> image {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.name {
|
||||
font-size: 30rpx;
|
||||
color: rgba(51,51,51,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.pay-btn {
|
||||
z-index: 9;
|
||||
position: fixed;
|
||||
bottom: 200rpx;
|
||||
left: 30rpx;
|
||||
width: 690rpx;
|
||||
height: 98rpx;
|
||||
background: rgba(255,120,15,1);
|
||||
border-radius: 49rpx;
|
||||
font-size: 36rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(255,255,255,1);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -26,6 +26,9 @@
|
||||
</view>
|
||||
</view>
|
||||
</u-checkbox-group>
|
||||
<view class="empty-view">
|
||||
<u-empty mode="car" v-if="!list.length" :margin-top="240"></u-empty>
|
||||
</view>
|
||||
<view class="balance">
|
||||
<u-checkbox-group>
|
||||
<u-checkbox v-model="checkedAll" shape="circle" active-color="#FF780F" icon-size="35" label-size="30" @change="totalChange">
|
||||
@ -85,6 +88,7 @@ export default {
|
||||
},
|
||||
// 结算
|
||||
settlementOrder() {
|
||||
if(!this.checkedGoods.length) return false;
|
||||
// 拼接后端需要的数据形式
|
||||
let id = [], temp = '';
|
||||
this.checkedGoods.forEach(item => {
|
||||
@ -96,11 +100,9 @@ export default {
|
||||
// ifcart 结算方式 1:购物车 0:直接结算(立即购买/拼团/秒杀)
|
||||
this.$u.api.settlementOrder({ ifcart: 1, cart_id: id }).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.$store.commit('updateCart', res.data)
|
||||
this.$u.route({
|
||||
url: '/pageC/cart/ConfirmOrder',
|
||||
params: {
|
||||
info: JSON.stringify(res.data),
|
||||
}
|
||||
url: '/pageC/cart/ConfirmOrder'
|
||||
})
|
||||
}
|
||||
})
|
||||
@ -193,6 +195,13 @@ export default {
|
||||
},
|
||||
onNavigationBarButtonTap(btn) {
|
||||
// console.log(btn);
|
||||
// #ifdef H5
|
||||
if(this.status == '编辑'){
|
||||
this.status = "完成";
|
||||
}else{
|
||||
this.status = "编辑";
|
||||
}
|
||||
// #endif
|
||||
if(btn.index == 0){
|
||||
let pages = getCurrentPages();
|
||||
let page = pages[pages.length - 1];
|
||||
@ -213,13 +222,14 @@ export default {
|
||||
});
|
||||
this.status = titleObj.buttons[0].text;
|
||||
// #endif
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.cart {
|
||||
min-height: calc(100vh - var(--window-top));
|
||||
position: relative;
|
||||
padding-bottom: 100rpx;
|
||||
.cart-main {
|
||||
display: block;
|
||||
@ -329,6 +339,12 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.empty-view {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -100%);
|
||||
}
|
||||
.balance {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
|
63
pageC/groupBuy/index.vue
Normal file
63
pageC/groupBuy/index.vue
Normal file
@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<view class="group">
|
||||
<view>
|
||||
<u-tabs-swiper ref="uTabs" :list="tabList" :current="current" @change="tabsChange" :is-scroll="false"
|
||||
swiperWidth="750"></u-tabs-swiper>
|
||||
</view>
|
||||
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" >
|
||||
<swiper-item class="swiper-item" v-for="(_, index) in tabList" :key="index">
|
||||
<scroll-view scroll-y style="height: 800rpx;width: 100%;" @scrolltolower="onreachBottom">
|
||||
{{ index }}
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import SpecialGoods from "../../components/shop/special-shop/index"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tabList: [{name: '推荐'}, {name: '推荐'}, {name: '推荐'}],
|
||||
current: 0,
|
||||
swiperCurrent: 0,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
SpecialGoods
|
||||
},
|
||||
onShow() {
|
||||
this.getPinTuanList();
|
||||
},
|
||||
methods: {
|
||||
getPinTuanList() {
|
||||
this.$u.api.getPinTuanList().then(res => {
|
||||
|
||||
})
|
||||
},
|
||||
// tabs通知swiper切换
|
||||
tabsChange(index) {
|
||||
this.swiperCurrent = index;
|
||||
},
|
||||
// swiper-item左右移动,通知tabs的滑块跟随移动
|
||||
transition(e) {
|
||||
let dx = e.detail.dx;
|
||||
this.$refs.uTabs.setDx(dx);
|
||||
},
|
||||
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
|
||||
// swiper滑动结束,分别设置tabs和swiper的状态
|
||||
animationfinish(e) {
|
||||
let current = e.detail.current;
|
||||
this.$refs.uTabs.setFinishCurrent(current);
|
||||
this.swiperCurrent = current;
|
||||
this.current = current;
|
||||
},
|
||||
// scroll-view到底部加载更多
|
||||
onreachBottom() {
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
85
pageC/spike/index.vue
Normal file
85
pageC/spike/index.vue
Normal file
@ -0,0 +1,85 @@
|
||||
<template>
|
||||
<view class="spike">
|
||||
<view class="title">
|
||||
<view class="name">全部秒杀</view>
|
||||
<view class="time">
|
||||
<text class="num">{{ seckillTime.littleHour }}</text>
|
||||
<text class="mah">:</text>
|
||||
<text class="num">00</text>
|
||||
<text class="mah">:</text>
|
||||
<text class="num">00</text>
|
||||
<text>-</text>
|
||||
<text class="num">{{ seckillTime.bigHour }}</text>
|
||||
<text class="mah">:</text>
|
||||
<text class="num">00</text>
|
||||
<text class="mah">:</text>
|
||||
<text class="num">00</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="spike-list">
|
||||
<SpecialGoods v-for="(item, index) in spikeList" :key="index" :item="item" type='spike'></SpecialGoods>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import SpecialGoods from "../../components/shop/special-shop/index"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
spikeList: [],
|
||||
page: 0,
|
||||
seckillTime: {}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
SpecialGoods
|
||||
},
|
||||
onShow() {
|
||||
this.getSpikeList();
|
||||
},
|
||||
methods: {
|
||||
// 全部秒杀
|
||||
getSpikeList() {
|
||||
this.$u.api.getSpikeList({ page: this.page }).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.spikeList = res.data.list;
|
||||
this.seckillTime = {
|
||||
bigHour: res.data.bigHour,
|
||||
littleHour: res.data.littleHour,
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.spike{
|
||||
min-height: calc(100vh - var(--window-top));
|
||||
padding: 30rpx;
|
||||
border-top: 1rpx solid rgba(236,236,236,1);
|
||||
.title{
|
||||
margin-bottom: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.name{
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
.time{
|
||||
margin-left: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 20rpx;
|
||||
.num{
|
||||
box-sizing: content-box;
|
||||
width: 25rpx;
|
||||
height: 25rpx;
|
||||
background-color: #bfbfbf;
|
||||
margin: 0 10rpx;
|
||||
padding: 2rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -61,6 +61,7 @@ export default {
|
||||
birthday: '',
|
||||
phoneNumber: '',
|
||||
avatar: '',
|
||||
uploadPath: '', // 上传时的路径
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
@ -83,7 +84,10 @@ export default {
|
||||
name: 'avatar',
|
||||
filePath: res.tempFilePaths[0]
|
||||
}).then(result => {
|
||||
this.avatar = result;
|
||||
// console.log(result);
|
||||
this.$set(this, 'avatar', result.file_path);
|
||||
// this.avatar = result.file_path;
|
||||
this.uploadPath = result.file_name;
|
||||
}, error => {
|
||||
this.$u.toast(error);
|
||||
})
|
||||
@ -108,7 +112,7 @@ export default {
|
||||
this.$u.api.updateMemberInfo({
|
||||
nickname: this.nickname,
|
||||
gender: this.gender,
|
||||
avatar: this.avatar,
|
||||
avatar: this.uploadPath,
|
||||
birthday: this.birthday,
|
||||
}).then(res => {
|
||||
if (res.errCode == 0) {
|
||||
|
@ -37,11 +37,11 @@
|
||||
<scroll-view scroll-y class="details">
|
||||
<view v-for="(item, index) in pointslogList" :key="index" class="details-item">
|
||||
<view class="item-left">
|
||||
<view class="item-title">{{ item.pl_desc }}</view>
|
||||
<view class="item-title u-line-1">{{ item.pl_desc }}</view>
|
||||
<view class="item-date">{{ item.pl_addtime }}</view>
|
||||
</view>
|
||||
<view class="item-right" :class="[item.pl_addtime < 0 ? 'negative' : 'positive']">
|
||||
{{ item.pl_addtime > 0 ? item.pl_addtime : '+' + 10.00 }}
|
||||
<view class="item-right" :class="[item.pl_points < 0 ? 'negative' : 'positive']">
|
||||
{{ Number(item.pl_points) > 0 ? '+' + item.pl_points : item.pl_points }}
|
||||
</view>
|
||||
</view>
|
||||
<u-empty text="暂无明细" mode="data" color="#000" v-if="!pointslogList.length"></u-empty>
|
||||
@ -75,6 +75,14 @@ export default {
|
||||
components: {
|
||||
CouponView
|
||||
},
|
||||
onLoad(option) {
|
||||
if(option.current) this.current = option.current;
|
||||
},
|
||||
watch: {
|
||||
current(value) {
|
||||
this.swiperCurrent = value;
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getMemberPointsStat();
|
||||
this.getPointslogList();
|
||||
@ -186,6 +194,7 @@ export default {
|
||||
justify-content: space-between;
|
||||
.item-left {
|
||||
.item-title {
|
||||
width: 450rpx;
|
||||
font-size: 32rpx;
|
||||
color: rgba(51,51,51,1);
|
||||
margin-bottom: 23rpx;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="coupon-swiper">
|
||||
<u-tabs-swiper ref="coupon" :list="couponGroupList" :is-scroll="true" active-color="#FF780F" :current="couponCurrent" font-size="24" :show-bar="false" @change="couponTabsChange" height="88" ></u-tabs-swiper>
|
||||
<u-tabs-swiper ref="coupon" :list="couponGroupList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="couponCurrent" font-size="24" :show-bar="false" @change="couponTabsChange" height="88" ></u-tabs-swiper>
|
||||
<swiper :current="swiperCouponCurrent" @animationfinish="couponAnimationFinish" :style="{ height: swiperHeight }">
|
||||
<swiper-item class="swiper-coupon-item" v-for="(_, i) in couponGroupList" :key="i">
|
||||
<scroll-view scroll-y style="height: 100%;">
|
||||
@ -31,43 +31,9 @@ export default {
|
||||
swiperHeight: '',
|
||||
couponCurrent: 0,
|
||||
swiperCouponCurrent: 0,
|
||||
couponGroupList: [
|
||||
{
|
||||
name: '平台'
|
||||
}, {
|
||||
name: '分类名称'
|
||||
}, {
|
||||
name: '分类名称'
|
||||
}, {
|
||||
name: '分类名称'
|
||||
}, {
|
||||
name: '分类名称'
|
||||
}, {
|
||||
name: '分类名称'
|
||||
}, {
|
||||
name: '分类名称'
|
||||
}, {
|
||||
name: '分类名称'
|
||||
}, {
|
||||
name: '分类名称'
|
||||
}, {
|
||||
name: '分类名称'
|
||||
}, {
|
||||
name: '分类名称'
|
||||
}, {
|
||||
name: '分类名称'
|
||||
}, {
|
||||
name: '分类名称'
|
||||
}
|
||||
],
|
||||
couponList: [
|
||||
{
|
||||
index: 0
|
||||
},
|
||||
{
|
||||
index: 1
|
||||
},
|
||||
],
|
||||
couponGroupList: [],
|
||||
couponList: [],
|
||||
page: 0,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@ -75,8 +41,35 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.setViewHeight();
|
||||
this.getGoodsClass();
|
||||
},
|
||||
watch: {
|
||||
couponCurrent(index) {
|
||||
const id = this.couponGroupList[index].gc_id;
|
||||
this.getCouponList({ gc_id: id });
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getGoodsClass() {
|
||||
this.$u.api.getGoodsClass().then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.couponGroupList = res.data;
|
||||
this.getCouponList(this.couponGroupList[0].gc_id);
|
||||
}
|
||||
})
|
||||
},
|
||||
getCouponList({ gc_id }) {
|
||||
this.$u.api.getCouponList({
|
||||
page: this.page,
|
||||
gc_id: gc_id,
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.couponList = res.data;
|
||||
} else {
|
||||
this.couponList = [];
|
||||
}
|
||||
})
|
||||
},
|
||||
exchangeCoupon(id) {
|
||||
console.log(id);
|
||||
|
||||
|
@ -51,7 +51,8 @@ export default {
|
||||
getUserInfo() {
|
||||
this.$u.api.getMemberInfo().then(res => {
|
||||
if (res.errCode == 0) {
|
||||
this.userInfo = res.data.MemberArray;
|
||||
// this.userInfo = res.data.MemberArray;
|
||||
this.$set(this, 'userInfo', res.data.MemberArray);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -3,7 +3,7 @@
|
||||
<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">
|
||||
<AddressItem :item="item" :current='current' @getAddressList="getAddressList"></AddressItem>
|
||||
<AddressItem :item="item" :current='current' @getAddressList="getAddressList" :state="state"></AddressItem>
|
||||
</view>
|
||||
</u-radio-group>
|
||||
<view class="address-btn" @click="addAddress">添加地址</view>
|
||||
@ -16,12 +16,16 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
current: -1, // radio 标记
|
||||
addressList: []
|
||||
addressList: [],
|
||||
state: '', // 页面状态 是否进页面选择地址
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddressItem
|
||||
},
|
||||
onLoad(option) {
|
||||
if(option.type) this.state = option.type;
|
||||
},
|
||||
onShow() {
|
||||
this.getAddressList();
|
||||
},
|
||||
|
@ -67,9 +67,15 @@ export default {
|
||||
fb_images: this.imageList,
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.$u.route({
|
||||
type: "redirect",
|
||||
url: '/pageE/more/Complaints',
|
||||
this.$refs.uToast.show({
|
||||
title: res.message,
|
||||
duration: 2000,
|
||||
callback:() => {
|
||||
this.$u.route({
|
||||
type: "navigateBack",
|
||||
url: '/pageE/more/Complaints',
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$u.toast(res.message);
|
||||
|
@ -12,10 +12,10 @@
|
||||
<image src="../static/mine/28.png"></image>
|
||||
<view class="address-right">
|
||||
<view class="user-info">
|
||||
<view>胖胖</view>
|
||||
<view>18220171014</view>
|
||||
<view>{{ orderInfo.extend_order_common.reciver_name }}</view>
|
||||
<view>{{ orderInfo.extend_order_common.reciver_info.mob_phone }}</view>
|
||||
</view>
|
||||
<view class="address-text u-line-2">山东省泰安市泰山区东岳大街与克山路交汇口银山店四楼橙天影视南邻山东省泰安市泰山区东岳大街与克山路交汇口银山店四楼橙天影视南邻</view>
|
||||
<view class="address-text u-line-2">{{ orderInfo.extend_order_common.reciver_info.address }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="info-goods">
|
||||
@ -41,19 +41,19 @@
|
||||
<view class="goods-others">
|
||||
<view>
|
||||
<view class="title">运费(快递/骑手)</view>
|
||||
<view class="price">¥0.00</view>
|
||||
<view class="price">¥{{ orderInfo.shipping_fee }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="title">店铺优惠</view>
|
||||
<view class="price">¥0.00</view>
|
||||
<view class="price">¥{{ orderInfo.extend_order_common.voucher_price || '0.00' }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="title">订单总价</view>
|
||||
<view class="price">¥{{ orderInfo.order_amount }}</view>
|
||||
<view class="price">¥{{ orderInfo.goods_amount }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="title">实付费(含运费)</view>
|
||||
<view class="price">¥{{ orderInfo.goods_amount }}</view>
|
||||
<view class="price">¥{{ orderInfo.order_amount }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="title">支付方式</view>
|
||||
@ -70,10 +70,10 @@
|
||||
<view class="btn" v-if="['1', '2', '6'].indexOf(state) >= 0">
|
||||
<view class="logistics" v-if="state == '1'" @click="toOtherPage('Logistics')">查看物流</view>
|
||||
<view class="comment" v-if="state == '2'" @click="toOtherPage('Comment')">立即评价</view>
|
||||
<view class="cancel" v-if="state == '6'">取消支付</view>
|
||||
<view class="cancel" v-if="state == '6'" @click="cancelOrder">取消支付</view>
|
||||
<view class="payment" v-if="state == '6'">立即支付</view>
|
||||
<view class="service" v-if="current == 6">联系官方客服</view>
|
||||
<view class="submit" v-if="current == 6">提交官方审核</view>
|
||||
<view class="service" v-if="state == '7'">联系官方客服</view>
|
||||
<view class="submit" v-if="state == '7'">提交官方审核</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -81,7 +81,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
state: '', // 1: 待收货 2: 待评价 3: 交易成功 4: 已取消 5: 已退款 6: 待支付
|
||||
state: '', // 1: 待收货 2: 待评价 3: 交易成功 4: 已取消 5: 已退款 6: 待支付 7: 待退款 8: 已退款
|
||||
s_object: {
|
||||
'1': {
|
||||
text: '待收货',
|
||||
@ -107,6 +107,10 @@ export default {
|
||||
text: '待支付',
|
||||
image: '../static/mine/31.png',
|
||||
},
|
||||
'7': {
|
||||
text: '待退款',
|
||||
image: '../static/mine/34.png',
|
||||
},
|
||||
},
|
||||
current: 0,
|
||||
orderInfo: {}
|
||||
@ -114,7 +118,7 @@ export default {
|
||||
},
|
||||
onLoad(option) {
|
||||
this.setTitle();
|
||||
this.getOrderInfo(option.id);
|
||||
this.getOrderInfo(option.oid);
|
||||
},
|
||||
methods: {
|
||||
viewState(value) {
|
||||
@ -139,6 +143,14 @@ export default {
|
||||
break;
|
||||
}
|
||||
if(this.orderInfo.refund_state) state = '5';
|
||||
// 申请退款
|
||||
if(this.orderInfo.refund_list) {
|
||||
const refund = this.orderInfo.refund_list[this.orderInfo.extend_order_common.order_id];
|
||||
if(this.orderInfo.refund_list) {
|
||||
if([1, 2].indexOf(refund.refund_state) >= 0) state = '7';
|
||||
if(refund.refund_state == 3) state = '8';
|
||||
}
|
||||
}
|
||||
this.state = state;
|
||||
},
|
||||
getOrderInfo(id) {
|
||||
@ -151,6 +163,15 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
cancelOrder() {
|
||||
this.$u.api.cancelOrder({
|
||||
order_id: this.orderInfo.order_id,
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
uni.navigateBack();
|
||||
}
|
||||
})
|
||||
},
|
||||
setTitle(){
|
||||
let title = '';
|
||||
switch (this.current) {
|
||||
|
@ -8,7 +8,7 @@
|
||||
<scroll-view scroll-y style="height: 100%;" @scrolltolower="reachBottom">
|
||||
<view>
|
||||
<view class="item-container" v-for="order in orderList" :key="order.order_id">
|
||||
<OrderItem :order="order"></OrderItem>
|
||||
<OrderItem :order="order" @refreshOrderList="getOrderList"></OrderItem>
|
||||
</view>
|
||||
</view>
|
||||
<u-empty text="暂无订单" mode="order" color="#000000" v-if="!orderList.length"></u-empty>
|
||||
@ -53,7 +53,8 @@ export default {
|
||||
watch: {
|
||||
current(value) {
|
||||
this.page = 0;
|
||||
this.getOrderList({ reload: 'again' });
|
||||
// again 重新请求列表 不然往列表里添加
|
||||
value == 6 ? this.getAfterSaleList({ reload: 'again' }): this.getOrderList({ reload: 'again' });
|
||||
},
|
||||
},
|
||||
onLoad(option) {
|
||||
@ -63,7 +64,7 @@ export default {
|
||||
this.setViewHeight();
|
||||
},
|
||||
methods: {
|
||||
async getOrderList({ reload = '' } = {}) {
|
||||
setOrderType() {
|
||||
let type;
|
||||
// state_type 订单状态:0:已取消 10:未付款 20:已付款 30:已发货 40:已收货
|
||||
switch (this.current) {
|
||||
@ -82,17 +83,28 @@ export default {
|
||||
case 5:
|
||||
type = 'state_noeval'; // 待评价
|
||||
break;
|
||||
case 6:
|
||||
type = 40; // 售后
|
||||
break;
|
||||
default:
|
||||
type = -1;
|
||||
break;
|
||||
}
|
||||
return type;
|
||||
},
|
||||
async getOrderList({ reload = '' } = {}) {
|
||||
const type = this.setOrderType();
|
||||
const res = await this.$u.api.getOrderList({
|
||||
page: this.page,
|
||||
type: type,
|
||||
refund_state: this.current == 6 ? '1' : 0, // 判断是不是售后列表
|
||||
})
|
||||
this.timer = true;
|
||||
if(res.errCode == 0) {
|
||||
if(reload) this.orderList = res.data;
|
||||
else this.orderList.push(...res.data);
|
||||
}
|
||||
return res;
|
||||
},
|
||||
async getAfterSaleList({ reload = '' } = {}) {
|
||||
const res = await this.$u.api.getAfterSaleList({
|
||||
page: this.page,
|
||||
})
|
||||
this.timer = true;
|
||||
if(res.errCode == 0) {
|
||||
@ -108,7 +120,10 @@ export default {
|
||||
this.timer = false;
|
||||
this.loadStatus.splice(this.current, 1, "loading");
|
||||
this.page++;
|
||||
this.getOrderList().then(res => {
|
||||
let promise;
|
||||
if(this.current == 6) promise = this.getAfterSaleList();
|
||||
else promise = this.getOrderList();
|
||||
promise.then(res => {
|
||||
this.loadStatus.splice(this.current, 1, "nomore");
|
||||
if(res.data.length == 0) this.page--;
|
||||
}).catch(() => {
|
||||
|
@ -1,19 +1,37 @@
|
||||
<template>
|
||||
<view class="shield">
|
||||
<view class="shield-list" v-for="(item, index) in 5" :key="index">
|
||||
<view class="shield-list" v-for="(item, index) in userList" :key="index">
|
||||
<view class="infomation">
|
||||
<u-avatar :src="src" size="80"></u-avatar>
|
||||
<view class="nickname u-line-1">神的温柔</view>
|
||||
<u-avatar :src="item.member_avatar" size="80"></u-avatar>
|
||||
<view class="nickname u-line-1">{{ item.member_nickname }}</view>
|
||||
</view>
|
||||
<view class="btn">取消屏蔽</view>
|
||||
<view class="btn" @click="cancelArticleShield(item.member_id)">取消屏蔽</view>
|
||||
</view>
|
||||
<u-empty text="暂无屏蔽用户" mode="list" v-if="!userList.length" margin-top="280" color="#333"></u-empty>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
src: 'https://dmmall.sdbairui.com/uploads/home/avatar/avatar_19.jpg'
|
||||
src: 'https://dmmall.sdbairui.com/uploads/home/avatar/avatar_19.jpg',
|
||||
userList: [],
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.articlShieldList();
|
||||
},
|
||||
methods: {
|
||||
articlShieldList() {
|
||||
this.$u.api.articlShieldList().then(res => {
|
||||
this.userList = res.data;
|
||||
})
|
||||
},
|
||||
// 取消屏蔽
|
||||
cancelArticleShield(id) {
|
||||
this.$u.api.articleDelShield({ id: id }).then(res => {
|
||||
this.articlShieldList();
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -4,7 +4,7 @@
|
||||
<swiper :current="swiperCurrent" @animationfinish="animationfinish" :style="{ height: swiperHeight }">
|
||||
<swiper-item class="swiper-item" v-for="(_, index) in list" :key="index">
|
||||
<scroll-view scroll-y class="scroll-coupon">
|
||||
<view class="coupon-item" v-for="(coupon, c_index) in test" :key="c_index">
|
||||
<view class="coupon-item" v-for="(coupon, c_index) in couponList" :key="c_index">
|
||||
<Coupon :couponInfo="coupon" :status='index' :type="1" @use="useCoupon($event)"></Coupon>
|
||||
</view>
|
||||
</scroll-view>
|
||||
@ -24,35 +24,10 @@ export default {
|
||||
}, {
|
||||
name: '已过期'
|
||||
}],
|
||||
current: 0,
|
||||
current: Number,
|
||||
swiperCurrent: 0,
|
||||
swiperHeight: '',
|
||||
test: [
|
||||
{
|
||||
index: 0
|
||||
},
|
||||
{
|
||||
index: 1
|
||||
},
|
||||
{
|
||||
index: 2
|
||||
},
|
||||
{
|
||||
index: 3
|
||||
},
|
||||
{
|
||||
index: 4
|
||||
},
|
||||
{
|
||||
index: 5
|
||||
},
|
||||
{
|
||||
index: 6
|
||||
},
|
||||
{
|
||||
index: 7
|
||||
}
|
||||
]
|
||||
couponList: []
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@ -61,7 +36,25 @@ export default {
|
||||
onLoad() {
|
||||
this.setViewHeight();
|
||||
},
|
||||
onShow() {
|
||||
this.current = 0;
|
||||
},
|
||||
watch: {
|
||||
current(value) {
|
||||
let status = value + 1;
|
||||
this.getMemberCouponList(status);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getMemberCouponList(current) {
|
||||
this.$u.api.getMemberCouponList({
|
||||
status: current
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.couponList = res.data;
|
||||
}
|
||||
})
|
||||
},
|
||||
useCoupon(id) {
|
||||
console.log(id);
|
||||
},
|
||||
|
42
pages.json
42
pages.json
@ -189,7 +189,19 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
"path": "cart/cashier",
|
||||
"style": {
|
||||
"navigationBarTitleText": "收银台",
|
||||
"app-plus": {
|
||||
"titleSize": "36px",
|
||||
"titleNView": {
|
||||
"titleColor": "#333333",
|
||||
"backgroundColor": "#FFFFFF"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "merchant/index",
|
||||
@ -237,7 +249,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
"path": "cart/ConfirmOrder",
|
||||
@ -251,7 +262,32 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
"path": "spike/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "全部秒杀",
|
||||
"app-plus": {
|
||||
"titleSize": "36px",
|
||||
"titleNView": {
|
||||
"titleColor": "#333333",
|
||||
"backgroundColor": "#FFFFFF"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "groupBuy/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "全部拼团",
|
||||
"app-plus": {
|
||||
"titleSize": "36px",
|
||||
"titleNView": {
|
||||
"titleColor": "#333333",
|
||||
"backgroundColor": "#FFFFFF"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -1,234 +1,269 @@
|
||||
<template>
|
||||
<view class="index">
|
||||
<view class="top">
|
||||
<view class="sosuo"></view>
|
||||
<view class="tabs">
|
||||
<u-tabs :is-scroll="false" bar-width="70" ref="tabs" :list="list" :current="num" :bar-style="{
|
||||
<view class="index">
|
||||
<view class="top">
|
||||
<view class="sosuo"></view>
|
||||
<view class="tabs">
|
||||
<u-tabs :is-scroll="false" bar-width="70" ref="tabs" :list="list" :current="num" :bar-style="{
|
||||
'background-color':'#FF780F',
|
||||
'bottom':'10rpx'
|
||||
}"
|
||||
inactive-color="#333"
|
||||
:active-item-style="{
|
||||
inactive-color="#333" :active-item-style="{
|
||||
'color':'#333'
|
||||
}"
|
||||
:bold="false"
|
||||
@change="dianji"></u-tabs>
|
||||
</view>
|
||||
<view class="sosuo"></view>
|
||||
</view>
|
||||
<swiper class="card" @change="dianji" :current="num">
|
||||
<swiper-item>
|
||||
<scroll-view style="width:100%;height:100%" scroll-y="true">
|
||||
<view class="box">
|
||||
<indexad style="width:690rpx"></indexad>
|
||||
<view class="list">
|
||||
<view >
|
||||
<videoItem v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem>
|
||||
</view>
|
||||
<view style="margin-left:20rpx">
|
||||
<videoItem v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
<swiper-item>
|
||||
<scroll-view style="width:100%;height:100%" scroll-y="true">
|
||||
<view class="box">
|
||||
<indexad style="width:690rpx"></indexad>
|
||||
<view class="list">
|
||||
<view >
|
||||
<zhiboItem v-for="item in 10"></zhiboItem>
|
||||
</view>
|
||||
<view style="margin-left:20rpx">
|
||||
<zhiboItem v-for="item in 10"></zhiboItem>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
<swiper-item>
|
||||
<scroll-view style="width:100%;height:100%" scroll-y="true">
|
||||
<view class="box">
|
||||
<view class="tuijian">
|
||||
<view class="title" @click="toSearchPage">
|
||||
<view class="left">
|
||||
<view></view>
|
||||
<text>推荐达人</text>
|
||||
</view>
|
||||
<image class="right" src="/static/image/common/1.png"></image>
|
||||
</view>
|
||||
<view class="tuijianlist">
|
||||
<!-- <darenItem style="margin-right:23rpx"></darenItem>
|
||||
}" :bold="false"
|
||||
@change="dianji"></u-tabs>
|
||||
</view>
|
||||
<view class="sosuo"></view>
|
||||
</view>
|
||||
<swiper class="card" @change="dianji" :current="num">
|
||||
<swiper-item>
|
||||
<scroll-view style="width:100%;height:100%" scroll-y="true">
|
||||
<view class="box">
|
||||
<!-- <indexad style="width:690rpx"></indexad> -->
|
||||
<u-swiper mode="dot" :list="indexImageSwiper" name="adv_code"></u-swiper>
|
||||
<view class="list">
|
||||
<view>
|
||||
<videoItem v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" :item="item"
|
||||
@getArticlelist="getArticlelist"></videoItem>
|
||||
</view>
|
||||
<view style="margin-left:20rpx">
|
||||
<videoItem v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id" :item="item"
|
||||
@getArticlelist="getArticlelist"></videoItem>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
<swiper-item>
|
||||
<scroll-view style="width:100%;height:100%" scroll-y="true">
|
||||
<view class="box">
|
||||
<u-swiper mode="dot" :list="zhiboImageSwiper" name="adv_code"></u-swiper>
|
||||
<view class="list">
|
||||
<view>
|
||||
<zhiboItem v-for="item in 10"></zhiboItem>
|
||||
</view>
|
||||
<view style="margin-left:20rpx">
|
||||
<zhiboItem v-for="item in 10"></zhiboItem>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
<swiper-item>
|
||||
<scroll-view style="width:100%;height:100%" scroll-y="true">
|
||||
<view class="box">
|
||||
<view class="tuijian">
|
||||
<view class="title" @click="toSearchPage">
|
||||
<view class="left">
|
||||
<view></view>
|
||||
<text>推荐达人</text>
|
||||
</view>
|
||||
<image class="right" src="/static/image/common/1.png"></image>
|
||||
</view>
|
||||
<view class="tuijianlist">
|
||||
<!-- <darenItem style="margin-right:23rpx"></darenItem>
|
||||
<darenItem style="margin-right:23rpx"></darenItem> -->
|
||||
<darenItem v-for="item in recommendList.slice(0,3)" :key="item.id" :info="item"></darenItem>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view >
|
||||
<!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> -->
|
||||
<videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem>
|
||||
</view>
|
||||
<view style="margin-left:20rpx">
|
||||
<!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> -->
|
||||
<videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id" :item="item" @getArticlelist="getArticlelist"></videoItem>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<darenItem v-for="item in recommendList.slice(0,3)" :key="item.id" :info="item"></darenItem>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view>
|
||||
<!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> -->
|
||||
<videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id"
|
||||
:item="item" @getArticlelist="getArticlelist"></videoItem>
|
||||
</view>
|
||||
<view style="margin-left:20rpx">
|
||||
<!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> -->
|
||||
<videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => index&1)" :key="item.article_id"
|
||||
:item="item" @getArticlelist="getArticlelist"></videoItem>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
.index{
|
||||
width: 750rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
.top{
|
||||
padding: 0 30rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
.sosuo{
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
.index {
|
||||
width: 750rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
|
||||
.top {
|
||||
padding: 0 30rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
|
||||
.sosuo {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
|
||||
}
|
||||
.tabs{
|
||||
width: 334rpx;
|
||||
/deep/ .u-tab-item{
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
.card{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
.box{
|
||||
width: 100%;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.list{
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
.tuijian{
|
||||
width: 750rpx;
|
||||
margin-left: -30rpx;
|
||||
height: 400rpx;
|
||||
background-color: #ececec;
|
||||
padding: 30rpx;
|
||||
.title{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.left{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
>view{
|
||||
width: 6rpx;
|
||||
height: 30rpx;
|
||||
background-color: #FF780F;
|
||||
}
|
||||
>text{
|
||||
font-size: 30rpx;
|
||||
color: 30rpx;
|
||||
margin-left: 14rpx;
|
||||
}
|
||||
}
|
||||
.right{
|
||||
width: 14rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
}
|
||||
.tuijianlist{
|
||||
width: 100%;
|
||||
height: 282rpx;
|
||||
margin-top: 30rpx;
|
||||
display: flex;
|
||||
> view:not(:last-child) {
|
||||
margin-right: 23rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tabs {
|
||||
width: 334rpx;
|
||||
|
||||
/deep/ .u-tab-item {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
.box {
|
||||
width: 100%;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
|
||||
.list {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
.tuijian {
|
||||
width: 750rpx;
|
||||
margin-left: -30rpx;
|
||||
height: 400rpx;
|
||||
background-color: #ececec;
|
||||
padding: 30rpx;
|
||||
|
||||
.title {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
>view {
|
||||
width: 6rpx;
|
||||
height: 30rpx;
|
||||
background-color: #FF780F;
|
||||
}
|
||||
|
||||
>text {
|
||||
font-size: 30rpx;
|
||||
color: 30rpx;
|
||||
margin-left: 14rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 14rpx;
|
||||
height: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.tuijianlist {
|
||||
width: 100%;
|
||||
height: 282rpx;
|
||||
margin-top: 30rpx;
|
||||
display: flex;
|
||||
|
||||
>view:not(:last-child) {
|
||||
margin-right: 23rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import videoItem from "@/components/index/video-item/index"
|
||||
import zhiboItem from "@/components/index/zhibo-item/index"
|
||||
import indexad from "@/components/index/ad/index"
|
||||
import darenItem from "@/components/index/daren-item/index"
|
||||
import videoItem from "@/components/index/video-item/index"
|
||||
import zhiboItem from "@/components/index/zhibo-item/index"
|
||||
import indexad from "@/components/index/ad/index"
|
||||
import darenItem from "@/components/index/daren-item/index"
|
||||
|
||||
export default {
|
||||
name:"index",
|
||||
data(){
|
||||
return {
|
||||
list:[
|
||||
{
|
||||
export default {
|
||||
name: "index",
|
||||
data() {
|
||||
return {
|
||||
list: [{
|
||||
name: '发现'
|
||||
}, {
|
||||
name: '直播'
|
||||
}, {
|
||||
name: '关注'
|
||||
}],
|
||||
num: 0,
|
||||
page: 0, // 0即第一页
|
||||
articleList: [],
|
||||
recommendList: [], // 推荐达人
|
||||
indexImageSwiper: [],
|
||||
zhiboImageSwiper: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
videoItem,
|
||||
zhiboItem,
|
||||
indexad,
|
||||
darenItem
|
||||
},
|
||||
onShow() {
|
||||
this.getArticlelist();
|
||||
this.getRecommendList();
|
||||
this.getSwiper();
|
||||
this.getZhiBoSwiper();
|
||||
},
|
||||
methods: {
|
||||
getSwiper() {
|
||||
this.$u.api.getIndexSwiper().then(res => {
|
||||
if (res.errCode == 0) {
|
||||
this.indexImageSwiper = res.data;
|
||||
}
|
||||
})
|
||||
},
|
||||
getZhiBoSwiper() {
|
||||
this.$u.api.getZhiBoSwiper().then(res => {
|
||||
if (res.errCode == 0) {
|
||||
this.zhiboImageSwiper = res.data;
|
||||
}
|
||||
})
|
||||
},
|
||||
dianji(a) {
|
||||
// console.log(a)
|
||||
if (typeof a == "object") {
|
||||
this.num = a.detail.current
|
||||
} else {
|
||||
this.num = a
|
||||
}
|
||||
],
|
||||
num:0,
|
||||
page: 0, // 0即第一页
|
||||
articleList: [],
|
||||
recommendList: [], // 推荐达人
|
||||
}
|
||||
},
|
||||
components:{
|
||||
videoItem,
|
||||
zhiboItem,
|
||||
indexad,
|
||||
darenItem
|
||||
},
|
||||
onShow(){
|
||||
this.getArticlelist();
|
||||
this.getRecommendList();
|
||||
},
|
||||
methods:{
|
||||
dianji(a){
|
||||
// console.log(a)
|
||||
if(typeof a == "object"){
|
||||
this.num = a.detail.current
|
||||
}else{
|
||||
this.num = a
|
||||
}
|
||||
},
|
||||
getArticlelist() {
|
||||
this.$u.api.getArticlelist({
|
||||
page: this.page,
|
||||
is_video_img: 0, // 查询视频1 图文2 都查0
|
||||
}).then(res => {
|
||||
console.log('37647744ghj',res)
|
||||
if (res.errCode == 0) {
|
||||
this.articleList = res.data.list;
|
||||
}
|
||||
})
|
||||
},
|
||||
getRecommendList() {
|
||||
this.$u.api.getRecommendList().then(res => {
|
||||
console.log(res)
|
||||
if (res.errCode == 0) {
|
||||
this.recommendList = res.data.list;
|
||||
}
|
||||
})
|
||||
},
|
||||
toSearchPage() {
|
||||
uni.navigateTo({
|
||||
url: '/pageB/follow/index'
|
||||
})
|
||||
},
|
||||
},
|
||||
getArticlelist () {
|
||||
this.$u.api.getArticlelist({
|
||||
page: this.page,
|
||||
is_video_img: 0, // 查询视频1 图文2 都查0
|
||||
}).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.articleList = res.data.list;
|
||||
}
|
||||
})
|
||||
},
|
||||
getRecommendList() {
|
||||
this.$u.api.getRecommendList().then(res => {
|
||||
console.log(res)
|
||||
if(res.errCode == 0) {
|
||||
this.recommendList = res.data.list;
|
||||
}
|
||||
})
|
||||
},
|
||||
toSearchPage() {
|
||||
uni.navigateTo({
|
||||
url: '/pageB/follow/index'
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
}
|
||||
</script>
|
||||
|
@ -145,7 +145,8 @@ export default {
|
||||
getUserInfo() {
|
||||
this.$u.api.getMemberInfo().then(res => {
|
||||
if (res.errCode == 0) {
|
||||
this.userInfo = res.data.MemberArray;
|
||||
// this.userInfo = res.data.MemberArray;
|
||||
this.$set(this, 'userInfo', res.data.MemberArray);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
@ -37,17 +37,17 @@
|
||||
<shopitem v-for="item in goodsClassify" :key="item.gc_id" :info="item" class="item"></shopitem>
|
||||
</view>
|
||||
<view class="hr" style="margin-top:80rpx"></view>
|
||||
<recommend></recommend>
|
||||
<view class="hr" style="margin-top:40rpx"></view>
|
||||
<seckill></seckill>
|
||||
<view class="hr" style="margin-top:40rpx"></view>
|
||||
<recommend></recommend>
|
||||
<view class="hr" style="margin-top:40rpx"></view>
|
||||
<recommend v-if="JSON.stringify(recommendedSpike) != '{}'" :recommendData="recommendedSpike" type="spike"></recommend>
|
||||
<view v-if="JSON.stringify(recommendedSpike) != '{}'" class="hr" style="margin-top:40rpx"></view>
|
||||
<seckill v-if="spikeList.length" :list="spikeList" :time="seckillTime"></seckill>
|
||||
<view v-if="spikeList.length" class="hr" style="margin-top:40rpx"></view>
|
||||
<recommend v-if="JSON.stringify(pinTuanPush) != '{}'" :recommendData="pinTuanPush" type='group'></recommend>
|
||||
<view class="hr" style="margin-top:40rpx" v-if="JSON.stringify(pinTuanPush) != '{}'"></view>
|
||||
<group></group>
|
||||
<image class="lingquan"></image>
|
||||
<youhq></youhq>
|
||||
<view class="hr" style="margin-top:40rpx"></view>
|
||||
<list :classifyList="classifyList" :goodsList="goodsList"></list>
|
||||
<list v-if="couponGroupList.length" :classifyList="couponGroupList"></list>
|
||||
<view class="cart" @click="toCartPage">
|
||||
<image src="/static/image/common/3.png"></image>
|
||||
</view>
|
||||
@ -85,12 +85,22 @@ export default {
|
||||
list:[],
|
||||
goodsClassify: [], // 商品分类
|
||||
classifyList: [],
|
||||
goodsList: []
|
||||
recommendedSpike: {}, // 秒杀推荐
|
||||
spikeList: [], // 全部秒杀列表
|
||||
seckillTime: {}, // 秒杀时间
|
||||
couponGroupList: [], // 优惠券拼团分类
|
||||
pinTuanList: [], // 拼团商品
|
||||
pinTuanPush: {}, // 拼团推荐
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getShopTopList();
|
||||
this.getGoodsRecommend();
|
||||
},
|
||||
onShow() {
|
||||
this.getRecommendedSpike();
|
||||
this.getSpikeList();
|
||||
this.getGoodsClass();
|
||||
this.getPinTuanPush();
|
||||
},
|
||||
methods: {
|
||||
sousuo(){
|
||||
@ -115,18 +125,50 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
getGoodsRecommend() {
|
||||
this.$u.api.getGoodsRecommend({
|
||||
page: 1,
|
||||
}).then((res)=>{
|
||||
if (res.errCode == 0) {
|
||||
this.classifyList = res.data.classifyList;
|
||||
this.goodsList = res.data.goodsList;
|
||||
// console.log(this.classifyList);
|
||||
|
||||
getRecommendedSpike() {
|
||||
this.$u.api.recommendedSpike().then(res => {
|
||||
if(res.errCode == 0) this.recommendedSpike = res.data;
|
||||
// console.log(this.recommendedSpike);
|
||||
})
|
||||
},
|
||||
// 拼团推荐
|
||||
getPinTuanPush() {
|
||||
this.$u.api.getPinTuanPush().then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.pinTuanPush = res.data;
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取优惠券拼团分类
|
||||
getGoodsClass() {
|
||||
this.$u.api.getGoodsClass().then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.couponGroupList = res.data;
|
||||
this.getPinTuanList(this.couponGroupList[0].gc_id);
|
||||
}
|
||||
})
|
||||
},
|
||||
// 全部秒杀
|
||||
getSpikeList() {
|
||||
this.$u.api.getSpikeList({ page: 0 }).then(res => {
|
||||
if(res.errCode == 0) {
|
||||
this.spikeList = res.data.list;
|
||||
this.seckillTime = {
|
||||
bigHour: res.data.bigHour,
|
||||
littleHour: res.data.littleHour,
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 拼团列表
|
||||
getPinTuanList(id) {
|
||||
this.$u.api.getPinTuanList({
|
||||
page: 0,
|
||||
gc_id: id,
|
||||
}).then(res => {
|
||||
this.pinTuanList = res.data;
|
||||
})
|
||||
},
|
||||
clickImage(index) {
|
||||
console.log(index);
|
||||
console.log(this.list[index]);
|
||||
|
BIN
static/image/common/13.png
Normal file
BIN
static/image/common/13.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.9 KiB |
BIN
static/image/common/14.png
Normal file
BIN
static/image/common/14.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.2 KiB |
BIN
static/image/common/15.png
Normal file
BIN
static/image/common/15.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
Loading…
Reference in New Issue
Block a user