Compare commits

...

9 Commits

26 changed files with 794 additions and 285 deletions

View File

@ -69,7 +69,7 @@ const install = (Vue, vm) => {
return false; return false;
} else if (res.errCode == 1) { } else if (res.errCode == 1) {
console.log(res.message); console.log(res.message);
return res; return res.data;
} else { } else {
// 如果返回false则会调用Promise的reject回调 // 如果返回false则会调用Promise的reject回调
// 并将进入this.$u.post(url).then().catch(res=>{})的catch回调中res为服务端的返回值 // 并将进入this.$u.post(url).then().catch(res=>{})的catch回调中res为服务端的返回值

View File

@ -1,5 +1,5 @@
<template> <template>
<view class="video-item" v-if="item" @click="toDetailsPage(item.article_id)"> <view class="video-item" v-if="item" @click="toDetailsPage(item.article_id,item.video_path)">
<image class="head" :src="item.article_pic" v-if="item.type == 1" ></image> <image class="head" :src="item.article_pic" v-if="item.type == 1" ></image>
<view class="header_fist" v-else> <view class="header_fist" v-else>
<view class="backes"></view> <view class="backes"></view>
@ -245,10 +245,16 @@ export default {
} }
}) })
}, },
toDetailsPage(id) { toDetailsPage(id,type) {
uni.navigateTo({ if (type) {
url: '/pageB/photo/index?id=' + id uni.navigateTo({
}); url: '/pageB/video/video?id=' + id
});
} else {
uni.navigateTo({
url: '/pageB/photo/index?id=' + id
});
}
}, },
}, },
} }

View File

@ -5,7 +5,7 @@
<view class="notice_view"> <view class="notice_view">
<image :src="item.picture" mode="aspectFill" ></image> <image :src="item.picture" mode="aspectFill" ></image>
<view class="text_view u-line-2">{{ item.content }}</view> <view class="text_view u-line-2">{{ item.content }}</view>
<view class="notice_list"> <view class="notice_list" @click="gotoInfo(index)">
<text>查看详情</text> <text>查看详情</text>
<u-icon name="arrow-right" color="#666"></u-icon> <u-icon name="arrow-right" color="#666"></u-icon>
</view> </view>
@ -87,7 +87,15 @@
} }
}, },
methods: { methods: {
gotoInfo(index) {
console.log(index);
this.$u.route({
url: "/pageD/notice/info",
params: {
index: index
},
})
}
} }
} }
</script> </script>

View File

@ -34,8 +34,9 @@ export default {
this.$u.route({ this.$u.route({
url: 'pageB/sdetails/index', url: 'pageB/sdetails/index',
params: { params: {
id: this.info.pintuan_id, // id: this.info.pintuan_id,
type: 2, id: this.info.pintuan_goods_id,
// type: 2,
} }
}) })
} }

View File

@ -1,9 +1,9 @@
<template> <template>
<view class="special"> <view class="special">
<view v-if="type == 'spike'"> <view v-if="type == 'spike'">
<image :src="item.groupbuy_image1"></image> <image :src="item.groupbuy_image1" @click="spikeGoods"></image>
<view class="right"> <view class="right">
<view class="name u-line-1">{{ item.goods_name }}</view> <view class="name u-line-1" @click="spikeGoods">{{ item.goods_name }}</view>
<view class="price"> <view class="price">
<view class="groupbuy-price">{{ item.groupbuy_price }}</view> <view class="groupbuy-price">{{ item.groupbuy_price }}</view>
<view class="goods-price">{{ item.goods_price }}</view> <view class="goods-price">{{ item.goods_price }}</view>
@ -15,9 +15,9 @@
</view> </view>
</view> </view>
<view v-if="type == 'group'"> <view v-if="type == 'group'">
<image :src="item.pintuan_image"></image> <image :src="item.pintuan_image" @click="toDetailsPage"></image>
<view class="right"> <view class="right">
<view class="name u-line-1">{{ item.pintuan_goods_name }}</view> <view class="name u-line-1" @click="toDetailsPage">{{ item.pintuan_goods_name }}</view>
<view class="price group"> <view class="price group">
<view class="groupbuy-price">{{ item.pintuan_goods_price }}</view> <view class="groupbuy-price">{{ item.pintuan_goods_price }}</view>
<view class="btn" @click="toDetailsPage">立即拼团</view> <view class="btn" @click="toDetailsPage">立即拼团</view>
@ -85,7 +85,7 @@ export default {
this.$u.route({ this.$u.route({
url: 'pageB/sdetails/index', url: 'pageB/sdetails/index',
params: { params: {
id: this.item.goods_id, id: this.item.pintuan_goods_id,
// type: 2, // type: 2,
} }
}) })

View File

@ -0,0 +1,22 @@
<template>
<view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>

View File

@ -57,7 +57,7 @@ export default {
props:['item','title'], props:['item','title'],
watch:{ watch:{
select(){ select(){
// console.log(this.select) console.log(this.select)
this.$emit("sel", this.select); this.$emit("sel", this.select);
} }
} }

View File

@ -5,7 +5,7 @@
<text>输入达人名称</text> <text>输入达人名称</text>
</view> </view>
<view class="list"> <view class="list">
<darenItem style="margin-top:20rpx;margin-right:23rpx" v-for="item in recommendList" :key="item.id" :info="item" v-on:pChangeType="changeType" ></darenItem> <darenItem style="margin-top:20rpx;margin-right:23rpx" v-for="item in recommendList" :key="item.id" :info="item" v-on:pChangeType="changeType"></darenItem>
</view> </view>
</view> </view>
</template> </template>
@ -76,7 +76,7 @@ export default {
}, },
searchValue() { searchValue() {
uni.navigateTo({ uni.navigateTo({
url: '/pageB/search/index' url: '/pageB/search/index?type=1'
}) })
}, },
}, },

View File

@ -58,7 +58,7 @@
<view class="no-data" v-if="!commentList.length">还没有评论快来评论吧</view> <view class="no-data" v-if="!commentList.length">还没有评论快来评论吧</view>
<u-loadmore v-else :status="status" icon-type="iconType" margin-top="50" margin-bottom="50" :load-text="loadText" /> <u-loadmore v-else :status="status" icon-type="iconType" margin-top="50" margin-bottom="50" :load-text="loadText" />
</scroll-view> </scroll-view>
<view class="editing" @click="openKeyInput"> <view class="editing" @touchend.prevent="openKeyInput">
<input type="text" value="" :placeholder="edit_text" disabled="disabled" /> <input type="text" value="" :placeholder="edit_text" disabled="disabled" />
<text>发送</text> <text>发送</text>
</view> </view>
@ -66,7 +66,7 @@
<!-- 评论box --> <!-- 评论box -->
<u-popup v-model="is_edit" mode="bottom" border-radius="10" height="100rpx"> <u-popup v-model="is_edit" mode="bottom" border-radius="10" height="100rpx">
<view class="edit-box"> <view class="edit-box">
<input type="text" :placeholder="edit_text_other" :focus="is_focus" @focus="focus" v-model="send_value" autofocus> <input type="text" :focus="is_focus" :placeholder="edit_text_other" @focus="focus" v-model="send_value">
<text @click="sendComment">发送</text> <text @click="sendComment">发送</text>
</view> </view>
</u-popup> </u-popup>
@ -437,10 +437,10 @@ export default {
onBackPress() { onBackPress() {
if (this.cart_type) { if (this.cart_type) {
this.cart_type = !this.cart_type; this.cart_type = !this.cart_type;
} else if (this.is_comment) {
this.is_comment = !this.is_comment;
} else if (this.is_edit) { } else if (this.is_edit) {
this.is_edit = !this.is_edit; this.is_edit = !this.is_edit;
} else if (this.is_comment) {
this.is_comment = !this.is_comment;
} else { } else {
return false; return false;
} }
@ -495,9 +495,11 @@ export default {
}, },
// //
openKeyInput(data,index) { openKeyInput(data,index) {
console.log(data); // console.log(data);
this.is_edit = true; this.is_edit = true;
this.is_focus = true; setTimeout(() => {
this.is_focus = true;
}, 200)
this.comment_id = index; this.comment_id = index;
if (data.id) { if (data.id) {
this.edit_text_other = "回复@" + data.member_nickname; this.edit_text_other = "回复@" + data.member_nickname;
@ -520,6 +522,7 @@ export default {
}).then(res => { }).then(res => {
// console.log(res.data.data); // console.log(res.data.data);
if (res.errCode == 0) { if (res.errCode == 0) {
this.send_value = "";
this.comment_num = res.data.num; this.comment_num = res.data.num;
// console.log(this.comment_num); // console.log(this.comment_num);
this.is_edit = false; this.is_edit = false;

View File

@ -9,8 +9,8 @@
</view> </view>
<view class="num">剩余数量{{ groupbuyInfo.inventory - groupbuyInfo.groupbuy_buy_quantity }}</view> <view class="num">剩余数量{{ groupbuyInfo.inventory - groupbuyInfo.groupbuy_buy_quantity }}</view>
</view> </view>
<view class="right" v-if="!isSpike"> <view class="right" v-if="!isSrartSpike || !isEndSpike">
<view class="title">秒杀倒计时</view> <view class="title">{{ isSrartSpike ? '结束倒计时' : '秒杀倒计时' }}</view>
<view class="time">{{ spikeTime }}</view> <view class="time">{{ spikeTime }}</view>
</view> </view>
<view class="right" v-else> <view class="right" v-else>
@ -171,10 +171,11 @@
<text>客服</text> <text>客服</text>
</view> </view>
</view> </view>
<view class="btn" v-if="groupbuyInfo.groupbuy_state == 20 && groupbuyInfo.inventory > groupbuyInfo.groupbuy_buy_quantity" @click="spikeGoods">立即秒杀</view> <!-- <view class="btn" v-if="isSrartSpike && !isEndSpike && groupbuyInfo.inventory > groupbuyInfo.groupbuy_buy_quantity" @click="spikeGoods">立即秒杀</view> -->
<view class="btn" :class="{'cannot': groupbuyInfo.groupbuy_state == 32 || groupbuyInfo.inventory == groupbuyInfo.groupbuy_buy_quantity}" v-else> <view class="btn cannot" v-if="!isSrartSpike">秒杀未开始</view>
{{ groupbuyInfo.groupbuy_state == 32 ? '时间已结束' : (groupbuyInfo.inventory > groupbuyInfo.groupbuy_buy_quantity ? '立即秒杀' : '已售空') }} <view class="btn cannot" v-else-if="isEndSpike">时间已结束</view>
</view> <view class="btn cannot" v-else-if="groupbuyInfo.inventory == groupbuyInfo.groupbuy_buy_quantity">已售空</view>
<view class="btn" v-else @click="spikeGoods">立即秒杀</view>
</view> </view>
<!-- <tloos @buy="buy" @xuanze="xuanze" :id="id" :info="goodsInfo" :type="type"></tloos> --> <!-- <tloos @buy="buy" @xuanze="xuanze" :id="id" :info="goodsInfo" :type="type"></tloos> -->
<u-toast ref="uToast" /> <u-toast ref="uToast" />
@ -191,7 +192,7 @@ export default {
return { return {
list: [], // list: [], //
goodsInfo: {}, // goodsInfo: {}, //
storeInfo: {}, storeInfo: {}, //
glist: [], // glist: [], //
id: 0, // id/id/ id id: 0, // id/id/ id
type: '', // 1 2 3 4 type: '', // 1 2 3 4
@ -201,16 +202,17 @@ export default {
showInvolvementUser: false, // showInvolvementUser: false, //
involvemenGroupInfo: [], // involvemenGroupInfo: [], //
groupbuyInfo: {}, // groupbuyInfo: {}, //
spikeTime: '00:00:00', spikeTime: '00:00:00', // (/)
isSpike: false, // isSrartSpike: false, //
isEndSpike: false, //
timer: '', // timer: '', //
spec_id: '', // id, spec_id: '', // id,
evaluate: {}, // evaluate: {}, //
showSpec: false, // showSpec: false, //
goodsNumber: 1, goodsNumber: 1, //
sel: "", // sel: "", //
quanxuan: false, // quanxuan: false, //
debounce: true, debounce: true, //
storeid:0 //id storeid:0 //id
} }
}, },
@ -224,6 +226,11 @@ export default {
sel(value){ sel(value){
this.xuanze(value); this.xuanze(value);
}, },
showSpec(value) {
if(!value) {
this.quanxuan = false;
}
}
}, },
onLoad(option) { onLoad(option) {
// this.init(); // this.init();
@ -289,11 +296,26 @@ export default {
spikeGoods() { spikeGoods() {
this.settlementOrder() this.settlementOrder()
}, },
setSpikeTime(time) { setSpikeTime() {
// const time = this.groupbuyInfo.groupbuy_endtime; const startTime = this.groupbuyInfo.groupbuy_starttime;
const endTime = this.groupbuyInfo.groupbuy_endtime;
let time = startTime;
this.timer = setInterval(() => { this.timer = setInterval(() => {
//
if(startTime * 1000 - new Date().getTime() > 0) {
this.isSrartSpike = false;
} else {
this.isSrartSpike = true;
time = endTime;
}
//
if(endTime * 1000 - new Date().getTime() <= 0) {
this.isEndSpike = true;
}
let spikeTime = time * 1000 - new Date().getTime(); let spikeTime = time * 1000 - new Date().getTime();
if(spikeTime <= 0) this.isSpike = true;
// //
const days = Math.floor(spikeTime/(24*3600*1000)); const days = Math.floor(spikeTime/(24*3600*1000));
// //
@ -312,6 +334,10 @@ export default {
}, 1000) }, 1000)
}, },
addCart() { addCart() {
if(!this.showSpec) {
this.showSpec = true;
return false;
}
this.$u.api.addCart({ this.$u.api.addCart({
goods_id: this.id, goods_id: this.id,
quantity: this.goodsNumber, quantity: this.goodsNumber,
@ -393,12 +419,16 @@ export default {
this.evaluate = res.data.goodsInfo.goods_evaluate_info; this.evaluate = res.data.goodsInfo.goods_evaluate_info;
this.goodsInfo = res.data.goodsInfo.goods; this.goodsInfo = res.data.goodsInfo.goods;
this.setSwiperList(res.data.goodsInfo.goods_image); this.setSwiperList(res.data.goodsInfo.goods_image);
this.setSpikeTime(res.data.groupbuyInfo.groupbuy_starttime); this.setSpikeTime();
} }
}) })
}, },
// 穿 // 穿
tryDress() { tryDress() {
if(!this.showSpec) {
this.showSpec = true;
return false;
}
this.$u.route({ this.$u.route({
url: '/pageB/triedDress/index', url: '/pageB/triedDress/index',
params: { params: {
@ -413,6 +443,26 @@ export default {
* @params {Number} ifcart 结算方式 1:购物车 0:直接结算立即购买/拼团/秒杀 * @params {Number} ifcart 结算方式 1:购物车 0:直接结算立即购买/拼团/秒杀
**/ **/
settlementOrder({type, num = this.goodsNumber, ifcart = 0} = {}) { settlementOrder({type, num = this.goodsNumber, ifcart = 0} = {}) {
if(type != 'involvement') {
if(!this.showSpec) {
this.showSpec = true;
return false;
}
if(!this.showSpec) {
this.showSpec = true;
return false;
}
//
if(this.goodsInfo.spec_value == null) {
this.quanxuan = true;
}
if(!this.quanxuan) {
this.$refs.uToast.show({
title: '请选择规格'
})
return false;
}
}
if(!this.debounce) return; if(!this.debounce) return;
this.debounce = false; this.debounce = false;
let params = { let params = {
@ -466,15 +516,18 @@ export default {
arr.push(sel) arr.push(sel)
} }
} }
// console.log(arr.length) // console.log(arr)
if(arr.length == index){ if(arr.length == index){
this.sel = arr.join("|") this.sel = arr.join("|")
this.quanxuan = true this.quanxuan = true;
// console.log(this.sel) // console.log(this.sel)
} }
// console.log(this.quanxuan);
}, },
xuanze(id){ xuanze(id){
// console.log(id) // console.log(id)
// type = 1
this.type = 1;
this.getGoodsDetails(this.glist[id]) this.getGoodsDetails(this.glist[id])
this.id = this.glist[id]; this.id = this.glist[id];
}, },
@ -609,8 +662,8 @@ export default {
} }
font-size: 26rpx; font-size: 26rpx;
font-weight: 500; font-weight: 500;
.title { .time {
margin-bottom: 18rpx; margin-top: 18rpx;
} }
} }
} }

View File

@ -13,12 +13,15 @@ export default {
name:"search", name:"search",
data(){ data(){
return{ return{
type: '', // 1 2
keyword: "", keyword: "",
searchwordlist: [], searchwordlist: [],
} }
}, },
created() { // type: 2 1:
this.getWordList(); onLoad(option) {
this.type = option.type;
if(option.type == 2) this.getWordList();
}, },
// //
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
@ -44,13 +47,18 @@ export default {
this.$u.toast('搜索内容不可为空'); this.$u.toast('搜索内容不可为空');
return false; return false;
} }
let params = {
value: value,
type: this.type,
}
if(this.type == 2) {
Object.assign(params, {
order: 'goods_salenum'
})
}
this.$u.route({ this.$u.route({
url: "/pageB/search/out", url: "/pageB/search/out",
params: { params: params,
value: value,
type: "shop",
order: 'goods_salenum'
}
}) })
} }
} }

View File

@ -1,193 +1,59 @@
<template> <template>
<view class="out"> <view class="out">
<u-tabs-swiper v-if="type == 'dianpu'" @change="tabsChange" :show-bar="false" :bold="false" :font-size="32" <u-tabs :list="list" :current="current" @change="tabsChange" active-color="#FF780F" :show-bar="false" height="88" font-size="32" inactive-color="#333333"></u-tabs>
active-color="#FF780F" ref="uTabs" :list="list" :is-scroll="false" style="border-bottom: 1px solid #ececec;flex-shrink:0" <swiper :current="swiperCurrent" @animationfinish="animationfinish">
height="88"></u-tabs-swiper> <!-- 店铺 -->
<swiper v-if="type == 'dianpu'" class="swiper" :current="swiperCurrent" @transition="transition" <swiper-item class="swiper-item" v-for="(item, index) in dataList[current]" :key="index">
@animationfinish="animationfinish"> <scroll-view scroll-y style="height: 800rpx;width: 100%;" @scrolltolower="onreachBottom">
<swiper-item> <view class="store"></view>
<scroll-view :scroll-y="true" style="height:100%"> </scroll-view>
<view style="padding-top:30rpx"> </swiper-item>
<shop></shop> <!-- 达人 -->
</view> <swiper-item class="swiper-item" v-for="(item, index) in dataList[current]" :key="index">
</scroll-view> <scroll-view scroll-y style="height: 800rpx;width: 100%;" @scrolltolower="onreachBottom">
</swiper-item> <view class="anchor"></view>
<swiper-item> </scroll-view>
<scroll-view :scroll-y="true" style="height:100%"> </swiper-item>
<view class="list"> <!-- 社区 -->
<!-- <darenItem style="margin-top:20rpx;margin-right:23rpx;box-shadow:0rpx 3rpx 7rpx 0rpx rgba(153, 153, 153, 0.35);" v-for="item in 50"></darenItem> --> <swiper-item class="swiper-item" v-for="(item, index) in dataList[current]" :key="index">
</view> <scroll-view scroll-y style="height: 800rpx;width: 100%;" @scrolltolower="onreachBottom">
</scroll-view> <view class="community"></view>
</swiper-item> </scroll-view>
</swiper> </swiper-item>
<view v-else style=" display: flex;flex-direction: column;height: calc(100vh - 88rpx);"> </swiper>
<view class="select">
<view @click="sx(0)" class="xz" data-type="xl">销量</view>
<view class="xz" @click="sx(1)">
<text>价格</text>
<view class="jiage">
<view class="top topxz"></view>
<view class="bottom bottomxz"></view>
</view>
</view>
<view data-type="hp" @click="sx(2)">好评</view>
</view>
<view class="swiper" :current="swiperCurrent" @change="huadong">
<scroll-view :scroll-y="true" style="height:100%">
<view style="padding-top:30rpx">
<shop v-for="(i,j) in shoplist" :key="j" :name="i.goods_name" :id="i.goods_id" :commonid="i.goods_commonid"
:image="i.goods_image"></shop>
</view>
</scroll-view>
</view>
</view>
</view> </view>
</template> </template>
<style lang="scss" scoped>
.out {
display: flex;
flex-direction: column;
height: 100vh;
.sosuo {
width: 100%;
height: 88rpx;
border-bottom: 1rpx solid #ececec;
display: flex;
align-items: center;
padding: 0 30rpx;
flex-shrink: 0;
>image {
width: 18rpx;
height: 32rpx;
margin-right: 24rpx;
flex-shrink: 0;
}
align-items: center;
}
.swiper {
width: 100%;
height: 100%;
.list {
display: flex;
flex-wrap: wrap;
width: 100%;
padding-left: 30rpx;
}
}
.select {
width: 100%;
height: 89rpx;
border-bottom: 1rpx solid #ececec;
display: flex;
align-items: center;
padding: 0 40rpx;
flex-shrink: 0;
justify-content: space-between;
>view {
font-size: 32rpx;
color: #333;
display: flex;
font-weight: 400;
.jiage {
display: flex;
flex-direction: column;
.top {
width: 12rpx;
border-bottom: 12rpx solid #707070;
border-left: 11rpx solid #fff;
border-right: 11rpx solid #fff;
margin-bottom: 2rpx;
}
.bottom {
width: 12rpx;
border-top: 12rpx solid #707070;
border-left: 11rpx solid #fff;
border-right: 11rpx solid #fff;
}
.topxz {
border-bottom: 12rpx solid #FF780F;
}
.bottomxz {
border-top: 12rpx solid #FF780F;
}
}
}
.xz {
color: #FF780F;
}
}
}
</style>
<script> <script>
import shop from "../components/search/shop" export default {
import darenItem from "@/components/index/daren-item/index" data() {
export default { return {
name: "out", list: [{
components: { name: "店铺"
shop, }, {
darenItem name: "达人"
}, }, {
data() { name: "社区"
return { }],
list: [{ current: 0,
name: "店铺" swiperCurrent: 0,
}, { dataList: [[1],[2],[3]],
name: "达人" }
}], },
current: 0, onLoad(option) {
swiperCurrent: 0, },
keyword: "", methods: {
type: "", tabsChange(index) {
shoplist: [] this.current = Number(index);
} this.swiperCurrent = this.current;
}, },
onLoad(o) { animationfinish(e) {
this.type = o.type const current = Number(e.detail.current);
this.keyword = o.value this.current = current;
this.search() this.swiperCurrent = current;
}, },
methods: { }
tabsChange(index) { }
this.swiperCurrent = index;
},
transition(e) {
let dx = e.detail.dx;
this.$refs.uTabs.setDx(dx);
},
animationfinish(e) {
let current = e.detail.current;
this.$refs.uTabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.current = current;
},
sx(type) {
console.log(type)
},
huadong(e) {
console.log(e.detail.current)
},
search() {
this.$u.api.ShopSearch({
keyword: this.keyword
}).then((res) => {
this.shoplist = res.data.data
})
}
},
}
</script> </script>
<style lang="scss" scoped>
</style>

View File

@ -0,0 +1,193 @@
<template>
<view class="classify-goods">
<view class="tab-container">
<view class="salenum" :class="{ 'current' : current == 0 }" @click="switchCurrent(0)">销量</view>
<view class="price" :class="{ 'current' : current == 1 }" @click="switchCurrent(1)">
<view class="text">价格</view>
<view class="icon">
<u-icon name="arrow-up-fill" :color="(current == 1 && priceOrderAsc) ? '#FF780F' : '#333333'" size="22"></u-icon>
<u-icon name="arrow-down-fill" :color="(current == 1 && !priceOrderAsc) ? '#FF780F' : '#333333'" size="22"></u-icon>
</view>
</view>
<view class="evaluation" :class="{ 'current' : current == 2 }" @click="switchCurrent(2)">好评</view>
</view>
<scroll-view scroll-y class="goods-container" :style="{ height: scrollHeight }" @scrolltolower="loadMore">
<view v-for="goods in goodsList" :key="goods.goods_id" class="goods-item" @click="toDetailsPage(goods.goods_id)">
<image :src="goods.goods_image"></image>
<view class="right">
<view class="name u-line-1">{{ goods.goods_name }}</view>
<view class="briefing u-line-2">{{ goods.goods_advword }}</view>
</view>
</view>
<u-loadmore :status="loadStatus" bgColor="#FFFFFF" margin-top="20" margin-bottom="20" v-if="goodsList.length >= pageSize"></u-loadmore>
<u-empty mode="list" v-if="!goodsList.length"></u-empty>
</scroll-view>
</view>
</template>
<script>
export default {
data() {
return {
pageSize: 12,
cid: '',
page: 1,
current: 0,
priceOrderAsc: true, //
goodsList: [],
scrollHeight: '',
loadStatus: 'loadmore',
timer: true, //
}
},
watch: {
current(value) {
this.page = 1;
this.goodsListByClassId({ laod: 'reload' });
},
priceOrderAsc(value) {
this.page = 1;
this.goodsListByClassId({ laod: 'reload' });
}
},
onLoad(option) {
this.cid = option.cid;
this.goodsListByClassId({ load: 'reload' });
this.setViewHeight();
this.setTitle(option.cname);
},
methods: {
setOrderSort() {
let sort = '';
if(this.current == 0) {
sort = 'goods_salenum';
} else if (this.current == 1) {
if(this.priceOrderAsc) sort = 'goods_price_asc';
else sort = 'goods_price_desc';
} else if (this.current == 2) {
sort = 'evaluation_count';
}
return sort;
},
// goods_salenum evaluation_count goods_price_asc goods_price_desc
async goodsListByClassId({ load = 'reload' } = {}) {
const sort = this.setOrderSort();
const res = await this.$u.api.goodsListByClassId({
gc_id: this.cid,
page: this.page,
order: sort,
})
this.timer = true;
if(res.errCode == 0) {
if(load == 'reload') this.goodsList = res.data.data;
else if(load == 'loadmore') this.goodsList.push(...res.data.data);
}
return res.data.data.length;
},
loadMore() {
if(this.goodsList.length < this.pageSize) return false;
if(!this.timer) return false;
this.loadStatus = "loading";
this.page++;
this.goodsListByClassId({ load: 'loadmore' }).then(length => {
if(length == 0) {
this.page--;
this.loadStatus = 'nomore';
} else {
this.loadStatus = 'loading';
}
}).catch(() => {
this.loadStatus = "nomore";
this.page--;
})
},
switchCurrent(current) {
if(current == 1 && this.current == 1) this.priceOrderAsc = !this.priceOrderAsc;
this.current = current;
},
setViewHeight() {
const res = uni.getSystemInfoSync();
this.scrollHeight = res.windowHeight - (90 / 2) + 'px';
},
setTitle(title) {
uni.setNavigationBarTitle({
title: title
});
},
toDetailsPage(id) {
this.$u.route('/pageB/sdetails/index', {
id: id,
type: 1 // 1 2 3 4
});
}
}
};
</script>
<style lang="scss" scoped>
.classify-goods {
.tab-container {
box-sizing: border-box;
padding: 30rpx 40rpx;
display: flex;
margin-bottom: 30rpx;
> view {
height: 30rpx;
line-height: 30rpx;
flex: 1;
font-size: 32rpx;
color: rgba(51,51,51,1);
}
.salenum {
text-align: left;
}
.price {
display: flex;
align-items: center;
justify-content: center;
.text {
margin-right: 5rpx;
}
.icon {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
}
.evaluation {
text-align: right;
}
.current {
color: rgba(255,120,15,1);
}
}
.goods-container {
.goods-item {
margin: 0 auto;
width: 690rpx;
display: flex;
background-color: #F5F5F5;
margin-bottom: 30rpx;
align-items: center;
> image {
width: 220rpx;
height: 200rpx;
flex-shrink: 0;
margin-right: 30rpx;
}
.right {
width: 418rpx;
.name {
font-size: 30rpx;
color: rgba(51,51,51,1);
margin-bottom: 20rpx;
}
.briefing {
font-size: 28rpx;
color: rgba(102,102,102,1);
line-height: 42rpx;
}
}
}
}
}
</style>

207
pageB/video/video.nvue Normal file
View File

@ -0,0 +1,207 @@
<template>
<view>
<video id="videoId" :style="videoSize" :src="src" autoplay="true" :loop="true" :show-fullscreen-btn="false" @play="playing"
:show-play-btn="false" controls="false" @click="stoping" :enable-progress-gesture="false"></video>
<cover-image class="close" @click="goBack" src="../../static/close.png">
</cover-image>
<cover-view class="" src="../../static/videoPlay.png">
</cover-view>
<cover-view class="info-box">
<view class="video-info-box">
<image class="image-play" src="../../static/videoPlay.png" mode=""></image>
<text class="video-slip">视频</text>
<text class="time">{{ time_count }}s</text>
</view>
<view>
<text class="name">@{{ list.member_nickname }}</text>
</view>
<view>
<text class="title">{{ list.article_title }}</text>
</view>
<view>
<text class="centent">{{ list.article_content }}</text>
</view>
<view class="label-box">
<block v-for="(item,index) in list.label" :key="index">
<text class="label" :style="{ width: item.name.length * 40 + 'rpx' }">{{ item.name }}</text>
</block>
</view>
</cover-view>
</view>
</template>
<script>
export default {
data() {
return {
videoSize: {},
list: {},
src: "",
is_play: true,
timer: null,
alltime: 7,
time_count: 7,
};
},
onLoad(option) {
this.getVideoInfo(option.id);
this.getInfo();
this.aaa();
},
onReady() {
this.videoBox = uni.createVideoContext("videoId", this);
},
methods: {
// 获取信息
getVideoInfo(article_id) {
uni.request({
url: "https://dmmall.sdbairui.com/api/article/articleInfo",
method: "POST",
data: {
article_id: article_id
},
success: (res) => {
this.list = res.data.data.info;
this.src = res.data.data.info.video_path;
}
})
},
// 获取手机信息
getInfo() {
uni.getSystemInfo({
success: (res) => {
this.videoSize = {
width: "750rpx",
height: res.screenHeight + "px"
}
}
})
},
// 播放
playing(e) {
console.log(e);
if (e.type == "play") {
this.alltime = 7;
this.time_count = 7;
this.aaa();
}
},
// 暂停
stoping() {
this.is_play = !this.is_play;
if (this.is_play) {
this.videoBox.play();
this.aaa();
} else {
this.videoBox.pause();
clearInterval(this.timer);
this.temp_time = this.time_count;
console.log(this.temp_time);
}
},
// 倒计时
aaa() {
this.timer = setInterval(() => {
if (this.time_count > 0 && this.time_count <= this.alltime) {
this.time_count--;
} else {
clearInterval(this.timer);
this.timer = null;
}
}, 1000);
},
goBack() {
uni.navigateBack({
delta: 1
})
}
}
}
</script>
<style>
/* 关闭 */
.close {
position: fixed;
top: 80rpx;
right: 60rpx;
width: 30rpx;
height: 30rpx;
}
/* 底部信息 */
.info-box {
position: fixed;
bottom: 0;
left: 0;
padding: 30rpx;
}
.video-info-box {
flex-direction: row;
align-items: center;
width: 160rpx;
height: 40rpx;
padding: 4rpx 10rpx;
margin-bottom: 20rpx;
color: #666666;
border-radius: 10rpx;
background-color: rgba(255, 255, 255, .6);
}
.image-play {
width: 22rpx;
height: 20rpx;
margin-right: 10rpx;
}
.video-slip {
color: #666;
font-size: 24rpx;
margin-right: 20rpx;
}
.time {
color: #666;
font-size: 24rpx;
}
.name {
color: #fff;
font-size: 36rpx;
margin-bottom: 20rpx;
}
.title {
color: #fff;
font-size: 26rpx;
margin-bottom: 20rpx;
}
.centent {
width: 500rpx;
color: #fff;
font-size: 28rpx;
margin-bottom: 20rpx;
lines: 2;
text-overflow: ellipsis;
}
.label-box {
flex-direction: row;
}
.label {
lines: 3;
width: 100rpx;
height: 40rpx;
padding: 4rpx 10rpx;
margin-right: 10rpx;
margin-bottom: 10rpx;
font-size: 26rpx;
text-align: center;
color: #666666;
border-radius: 10rpx;
background-color: rgba(255, 255, 255, .6);
}
</style>

View File

@ -50,15 +50,18 @@
this.getMenuItemTop() this.getMenuItemTop()
}, },
onNavigationBarButtonTap(e) { onNavigationBarButtonTap(e) {
if(e.index == 0) this.$u.route('/pageB/search/index'); if(e.index == 0) this.$u.route('/pageB/search/index',{ type: 2 });
}, },
onNavigationBarSearchInputClicked() { onNavigationBarSearchInputClicked() {
this.$u.route('/pageB/search/index'); this.$u.route('/pageB/search/index', { type: 2 });
}, },
methods: { methods: {
toSearchPage() { toSearchPage() {
this.$u.route({ this.$u.route({
url: "pageB/search/index" url: "pageB/search/index",
prarms: {
type: 2
}
}) })
}, },
// //

View File

@ -1,14 +1,17 @@
<template> <template>
<view class="group"> <view class="group">
<view> <view>
<u-tabs-swiper ref="uTabs" :list="tabList" name="gc_name" :current="current" @change="tabsChange" :is-scroll="true" active-color="#FF780F" swiperWidth="750" height="88" :show-bar="false"></u-tabs-swiper> <!-- <u-tabs-swiper ref="uTabs" :list="tabList" name="gc_name" :current="current" @change="tabsChange" :is-scroll="true" active-color="#FF780F" swiperWidth="750" height="88" :show-bar="false"></u-tabs-swiper> -->
<u-tabs :list="tabList" name="gc_name" :is-scroll="true" :current="current" @change="tabsChange" active-color="#FF780F" :show-bar="false" height="88" font-size="24" inactive-color="#333333"></u-tabs>
</view> </view>
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" :style="{height: swiperHeight}"> <swiper :current="swiperCurrent" @animationfinish="animationfinish" :style="{height: swiperHeight}">
<swiper-item class="swiper-item" v-for="(_, index) in tabList" :key="index"> <swiper-item class="swiper-item" v-for="(_, index) in tabList" :key="index">
<scroll-view scroll-y style="width: 100%;" @scrolltolower="onreachBottom"> <scroll-view scroll-y style="width: 100%;" @scrolltolower="onreachBottom">
<SpecialGoods v-for="(item, index) in pinTuanList" :key="index" :item="item" type='group'></SpecialGoods> <view v-if="pinTuanList[index]">
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20" v-if="pinTuanList.length>=pageSize" @loadmore="onreachBottom"></u-loadmore> <SpecialGoods v-for="(item, index) in pinTuanList[index]" :key="index" :item="item" type='group'></SpecialGoods>
<u-empty text="暂无商品" mode="list" color="#000" v-if="!pinTuanList.length"></u-empty> </view>
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20" v-if="!pinTuanList[index] || pinTuanList[index].length>=pageSize" @loadmore="onreachBottom"></u-loadmore>
<u-empty text="暂无商品" mode="list" color="#000" v-if="!pinTuanList[index] || !pinTuanList[index].length"></u-empty>
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
</swiper> </swiper>
@ -47,8 +50,8 @@ export default {
async getGoodsClass() { async getGoodsClass() {
return await this.$u.api.getGoodsClass().then(res => { return await this.$u.api.getGoodsClass().then(res => {
if(res.errCode == 0) { if(res.errCode == 0) {
this.tabList = res.data;
this.current = 0; this.current = 0;
this.tabList = res.data;
} }
}) })
}, },
@ -60,9 +63,10 @@ export default {
}) })
this.timer = true; this.timer = true;
if (res.errCode == 0) { if (res.errCode == 0) {
if(load == 'reload') this.pinTuanList = res.data; if(load == 'reload') this.pinTuanList[this.current] = res.data;
else if(load == 'loadmore') this.pinTuanList.push(...res.data); else if(load == 'loadmore') this.pinTuanList[this.current].push(...res.data);
} }
this.$forceUpdate();
return res.data.length; return res.data.length;
}, },
// scroll-view // scroll-view
@ -88,13 +92,9 @@ export default {
}, },
// tabsswiper // tabsswiper
tabsChange(index) { tabsChange(index) {
this.current = index;
this.swiperCurrent = index; this.swiperCurrent = index;
}, },
// swiper-itemtabs
transition(e) {
let dx = e.detail.dx;
this.$refs.uTabs.setDx(dx);
},
// swiperswiperdx // swiperswiperdx
// swipertabsswiper // swipertabsswiper
animationfinish(e) { animationfinish(e) {

View File

@ -48,11 +48,13 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
page {
background-color: #ECECEC;
}
uni-page-body{ uni-page-body{
height: 100%; height: 100%;
} }
#actives{ #actives{
background: #ECECEC;
height: 100%; height: 100%;
.time { .time {
padding: 30rpx 0; padding: 30rpx 0;

70
pageD/notice/info.vue Normal file
View File

@ -0,0 +1,70 @@
<template>
<view>
<image :src="list.picture" class="picture" mode=""></image>
<view class="box">
<view class="info">
<text class="title u-line-2">{{ list.title }}</text>
<u-divider class="time">{{ list.addtime }}</u-divider>
<!-- <text class="time"></text> -->
</view>
<view class="content">{{ list.content }}</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
index: 0,
list: [],
};
},
onLoad(option) {
// console.log(option);
this.index = option.index;
//
this.informationList();
},
methods: {
informationList(){
this.$u.api.informationList({}).then((res)=>{
if (res.errCode == 0) {
this.list = res.data[this.index];
console.log(this.list);
}
})
}
}
}
</script>
<style lang="scss">
page {
}
.picture {
width: 100%;
}
.box {
width: 100%;
padding: 20rpx;
.info {
.title {
font-size: 38rpx;
color: rgba(0,0,0,.84);
line-height: 1.2;
}
.time {
padding: 40rpx 0;
}
}
.content {
padding: 0 6rpx;
font-size: 34rpx;
color: rgba(0,0,0,.6);
line-height: 1.4;
letter-spacing: 1rpx;
text-indent: 2rem;
}
}
</style>

View File

@ -21,7 +21,9 @@
}, },
informationList(){ informationList(){
this.$u.api.informationList({}).then((res)=>{ this.$u.api.informationList({}).then((res)=>{
this.list = res.data; if (res.errCode == 0) {
this.list = res.data;
}
}) })
} }
}, },

View File

@ -101,9 +101,9 @@ export default {
}, },
getMemberPointsStat() { getMemberPointsStat() {
this.$u.api.getMemberPointsStat().then((res)=>{ this.$u.api.getMemberPointsStat().then((res)=>{
if (res.errCode == 0) { if(res.errCode == 0) {
this.memberInfo = res.data; this.memberInfo = res.data;
this.nodes = common.unescapeHTML(this.memberInfo.points_rule); this.nodes = common.unescapeHTML(this.memberInfo.points_rule.document_content);
} }
}) })
}, },

View File

@ -5,17 +5,17 @@
<view class="rank-value">lv{{ memberInfo.member_level }}</view> <view class="rank-value">lv{{ memberInfo.member_level }}</view>
<view class="line-box"> <view class="line-box">
<u-line-progress :percent="percent" :show-percent="false" inactive-color="#FFFFFF" active-color="#F1A36B" height="30" :striped="true" :striped-active="true"></u-line-progress> <u-line-progress :percent="percent" :show-percent="false" inactive-color="#FFFFFF" active-color="#F1A36B" height="30" :striped="true" :striped-active="true"></u-line-progress>
<text>{{ memberInfo.member_exppoints }}</text> <text>{{ memberInfo.member_exppoints + '/' + memberInfo.next_member_level_exppoints }}</text>
</view> </view>
<view class="rank-value">lv{{ memberInfo.member_level + 1 }}</view> <view class="rank-value">lv{{ memberInfo.next_member_level }}</view>
</view> </view>
<view class="exp-value">经验值<span>{{ memberInfo.member_exppoints }}</span></view> <view class="exp-value">经验值<span>{{ memberInfo.member_exppoints }}</span></view>
<view class="distance">距离下一级还需要{{ memberInfo.next_grade_exppoints_diff }}经验值</view> <view class="distance">距离下一级还需要 {{ memberInfo.next_member_level_exppoints_diff }} 经验值</view>
</view> </view>
<view class="body"> <view class="body">
<view class="title"> <view class="title">
<image src="/static/image/mine/34.png"></image> <image src="/static/image/mine/34.png"></image>
<text>等级定义</text> <text>{{ memberInfo.level_rule.document_title }}</text>
</view> </view>
<!-- <view class="rank-list"> <!-- <view class="rank-list">
<view v-for="(rank, index) in rank" :key="index" class="list-item"> <view v-for="(rank, index) in rank" :key="index" class="list-item">
@ -40,10 +40,12 @@ export default {
} }
}, },
filters: { filters: {
percentExp(value, rank) { percentExp(value, next) {
// console.log(rank); // console.log(rank);
let result = '0/0'; let result = '0 / 0';
if(rank) result = value + '/' + rank.max; result = typeof(next) == 'Number'
? value + ' / ' + (value + next)
: value + ' / ' + '0'
return result; return result;
}, },
}, },
@ -55,8 +57,9 @@ export default {
this.$u.api.getMemberPointsStat().then((res)=>{ this.$u.api.getMemberPointsStat().then((res)=>{
if (res.errCode == 0) { if (res.errCode == 0) {
this.memberInfo = res.data; this.memberInfo = res.data;
this.nodes = common.unescapeHTML(res.data.points_rule); this.nodes = common.unescapeHTML(res.data.level_rule.document_content);
// console.log(this.percent); // console.log(this.percent);
this.percent = (res.data.member_exppoints / res.data.next_member_level_exppoints) * 100;
} }
}) })
}, },

View File

@ -12,7 +12,7 @@
<text>选择订单:</text> <text>选择订单:</text>
<image src="../../static/image/shop/2.png" mode=""></image> <image src="../../static/image/shop/2.png" mode=""></image>
</view> </view>
<u-icon name="arrow-dwon" color="#2979ff" size="28"></u-icon> <!-- <u-icon name="arrow-dwon" color="#2979ff" size="28"></u-icon> -->
</view> </view>
<view class="choose-info" v-if="choose"> <view class="choose-info" v-if="choose">
<view class="store"> <view class="store">

View File

@ -80,7 +80,6 @@
{ {
"root": "pageB", "root": "pageB",
"pages": [ "pages": [
{ {
"path": "follow/index", "path": "follow/index",
"style": { "style": {
@ -103,6 +102,12 @@
} }
} }
}, },
{
"path" : "video/video",
"style" : {
"navigationStyle":"custom"
}
},
{ {
"path": "sdetails/index", "path": "sdetails/index",
"style": { "style": {
@ -176,7 +181,8 @@
"placeholder": "搜索您需要的商品", "placeholder": "搜索您需要的商品",
"backgroundColor": "rgb(236,236,236)", "backgroundColor": "rgb(236,236,236)",
"placeholderColor": "#999999", "placeholderColor": "#999999",
"disabled": false "disabled": false,
"fontSize": "24"
} }
} }
} }
@ -189,22 +195,34 @@
"titleNView": { "titleNView": {
"titleColor": "#333333", "titleColor": "#333333",
"backgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF",
"buttons": [
{
"type":"none",
"text":"搜索",
"float":"right",
"fontSize":"16",
"color": "#FF780F"
}
],
"searchInput": { "searchInput": {
"align": "left", "align": "left",
"borderRadius": "15px", "borderRadius": "15px",
"placeholder": "搜索您需要的商品", "placeholder": "搜索您需要的商品",
"backgroundColor": "rgb(236,236,236)", "backgroundColor": "rgb(236,236,236)",
"placeholderColor": "#999999", "placeholderColor": "#999999",
"disabled": false "disabled": false,
"fontSize": "24"
}
}
}
}
},
{
"path": "search/searchGoods",
"style": {
"app-plus": {
"titleNView": {
"titleColor": "#333333",
"backgroundColor": "#FFFFFF",
"searchInput": {
"align": "left",
"borderRadius": "15px",
"placeholder": "搜索您需要的商品",
"backgroundColor": "rgb(236,236,236)",
"placeholderColor": "#999999",
"disabled": false,
"fontSize": "24"
} }
} }
} }
@ -481,7 +499,16 @@
} }
} }
} }
} },
{
"path" : "notice/info",
"style" : {
"navigationBarTitleText":"公告详情",
"titleNView": {
"backgroundColor": "#FFFFFF"
}
}
}
] ]
}, },
{ {
@ -1050,7 +1077,11 @@
} }
} }
} }
], ,{
"path" : "pageB/components/nuserinfo/nuserinfo",
"style" : {}
}
],
"tabBar": { "tabBar": {
"color": "#999999", "color": "#999999",
"selectedColor": "#FF780F", "selectedColor": "#FF780F",

View File

@ -441,7 +441,9 @@
}) })
}, },
goSearch() { goSearch() {
this.$u.route("/pageB/search/index"); this.$u.route("/pageB/search/index", {
type: 1,
});
} }
}, },
} }

View File

@ -112,7 +112,10 @@
sousuo() { sousuo() {
// console.log(123) // console.log(123)
this.$u.route({ this.$u.route({
url: "pageB/search/index" url: "pageB/search/index",
params: {
type: 2,
}
}) })
}, },
// //
@ -145,6 +148,8 @@
image: item.adv_code, image: item.adv_code,
adv_link: item.adv_link, adv_link: item.adv_link,
adv_id: item.adv_id, adv_id: item.adv_id,
info_id: item.info_id,
url_type: item.url_type,
}) })
}) })
this.list = temp; this.list = temp;
@ -181,9 +186,33 @@
}) })
}, },
clickImage(index) { clickImage(index) {
console.log(index); // console.log(this.list[index]);
console.log(this.list[index]); let item = this.list[index];
this.activityLink({
type: item.url_type,
id: item.info_id,
});
}, },
activityLink({
type,
id
}) {
console.log(type,id);
if (type == 0) return false;
// type 1 , 2
const url = type == 1 ? 'pageB/sdetails/index' : 'pageC/merchant/index';
let params = {
id: id
};
// type: 1 // 1 2 3 4
if (type == 1) Object.assign(params, {
type: 1
});
this.$u.route({
url: url,
params: params
})
},
// //
onreachBottom() { onreachBottom() {
this.$refs.recommendGoods.loadMore(); this.$refs.recommendGoods.loadMore();

BIN
static/videoPlay.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB