Compare commits

..

No commits in common. "720af35b11cae5a6bca0d2e52521fb6a0e9cacc3" and "b0f224d79bae663ac9316275b4ca087121435829" have entirely different histories.

35 changed files with 259 additions and 992 deletions

21
App.vue
View File

@ -1,9 +1,6 @@
<script> <script>
import { mapMutations, mapState } from 'vuex'; import { mapMutations } from 'vuex';
export default { export default {
computed: {
...mapState(["hasLogin"])
},
onLaunch() { onLaunch() {
// token // token
uni.getStorage({ uni.getStorage({
@ -12,23 +9,9 @@
this.loginIn(res.data); this.loginIn(res.data);
} }
}) })
// token
if (this.hasLogin) {
this.refreshToken_function();
}
}, },
methods: { methods: {
...mapMutations(['loginIn']), ...mapMutations(['loginIn'])
// token
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
}
})
},
} }
} }
</script> </script>

View File

@ -173,17 +173,10 @@ export default {
goods_id: id goods_id: id
}); });
}, },
getStoreGoodsList({ id, page, order, gc_id }){ getStoreGoodsList({ id, page = 0}){
return vm.$u.post('Store/getStoreGoodsList', { return vm.$u.post('Store/getStoreGoodsList', {
id: id, id: id,
page: page, page:page
order: order,
gc_id: gc_id,
});
},
getStoreClassifyList({ id }) {
return vm.$u.post('Store/getStoreClassifyList', {
id: id
}); });
}, },
getStoreImgVideoList({id}){ getStoreImgVideoList({id}){
@ -313,11 +306,7 @@ export default {
// 达人上架商品 // 达人上架商品
goodsShelves({live_id}){ goodsShelves({live_id}){
return vm.$u.post('Specialci/goodsShelves',{live_id}) return vm.$u.post('Specialci/goodsShelves',{live_id})
}, }
//
addFavoriteStore({ id }) {
return vm.$u.post('member/addFavoriteStore',{ fid: id })
},
} }
} }

View File

@ -175,10 +175,9 @@ export default {
return vm.$u.post('Member/getFavoritesList', params); return vm.$u.post('Member/getFavoritesList', params);
}, },
// 取消收藏(商品/店铺) // 取消收藏(商品/店铺)
removeFavorite({ id, type }) { removeFavorite({ id }) {
return vm.$u.post('Member/removeFavorite', { return vm.$u.post('Member/removeFavorite', {
fav_id: id, id: id,
type: type,
}); });
}, },
// 设置-用户信息 // 设置-用户信息

View File

@ -3,8 +3,8 @@ const install = (Vue, vm) => {
Vue.prototype.$u.http.setConfig({ Vue.prototype.$u.http.setConfig({
baseUrl: 'https://dmmall.sdbairui.com/api', baseUrl: 'https://dmmall.sdbairui.com/api',
loadingText: '努力加载中~', loadingText: '努力加载中~',
loadingTime: 800, loadingTime: 800
// originalData: true
}); });
// 请求拦截配置Token等参数 // 请求拦截配置Token等参数
@ -17,28 +17,6 @@ const install = (Vue, vm) => {
return config; return config;
} }
// 响应拦截,如配置,每次请求结束都会执行本方法
Vue.prototype.$u.http.interceptor.response = (res) => {
if(parseInt(res.errCode) == 0) {
// res为服务端返回值可能有errCoderesult等字段
// 这里对res.result进行返回将会在this.$u.post(url).then(res => {})的then回调中的res的到
// 如果配置了originalData为true请留意这里的返回值
return res;
} else if(res.errCode == 401) {
// 假设201为token失效这里跳转登录
vm.$u.toast('验证失败,请重新登录');
setTimeout(() => {
// 此为uView的方法详见路由相关文档
vm.$u.route('/pageA/login/login')
}, 1500)
return false;
} else {
// 如果返回false则会调用Promise的reject回调
// 并将进入this.$u.post(url).then().catch(res=>{})的catch回调中res为服务端的返回值
return false;
}
}
} }

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="daren-item"> <view class="daren-item" @click="toDetailsPage">
<image class="head" @click="toDetailsPage" :src="info.member_avatar"></image> <image class="head" :src="info.member_avatar"></image>
<text class="name">{{ info.member_nickname }}</text> <text class="name">{{ info.member_nickname }}</text>
<text class="zhuangtai">状态: {{ info.live_status == 1 ? '正在直播' : '未开播' }}</text> <text class="zhuangtai">状态: {{ info.live_status == 1 ? '正在直播' : '未开播' }}</text>
<view class="guanzhu action" @tap="changeType(info.member_id)" v-if="info.is_attention == 1">已关注</view> <view class="guanzhu action" @tap="changeType(info.member_id)" v-if="info.is_attention == 1">已关注</view>
@ -8,31 +8,17 @@
</view> </view>
</template> </template>
<script> <script>
import { mapState } from 'vuex';
export default { export default {
name:"daren-item", name:"daren-item",
props: { props: {
info: Object, info: Object,
}, },
computed: {
...mapState(["login","hasLogin"]),
},
watch: {
info(newVal, old) {
// console.log(newVal);
},
deep: true
},
methods: { methods: {
toDetailsPage() { toDetailsPage() {
// console.log(); //
if (this.hasLogin) { const toke = uni.getStorageSync('token');
this.$u.route({ if (toke) {
url: "/pageB/details/index", console.log(toke);
params: {
id: this.info.member_id
}
});
}else{ }else{
uni.navigateTo({ uni.navigateTo({
url: '/pageA/login/login' url: '/pageA/login/login'
@ -46,8 +32,8 @@ export default {
// }) // })
}, },
changeType:function(type){ changeType:function(type){
// console.log("111") console.log("111")
this.$emit("pChangeType",type); this.$emit("pChangeType",type)
}, },
}, },

View File

@ -37,13 +37,12 @@
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.video-item{ .video-item{
flex-shrink: 0;
width: 335rpx;
padding-bottom: 20rpx;
margin-top: 20rpx; margin-top: 20rpx;
overflow: hidden; width: 335rpx;
border-radius: 20rpx;
box-shadow:0 3rpx 7rpx 0 rgba(153, 153, 153, 0.35); box-shadow:0 3rpx 7rpx 0 rgba(153, 153, 153, 0.35);
padding-bottom: 20rpx;
border-radius: 20rpx;
overflow: hidden;
.head{ .head{
width: 100%; width: 100%;
height: 334rpx; height: 334rpx;
@ -196,40 +195,29 @@ export default {
// console.log(this.item); // console.log(this.item);
this.show = -1; this.show = -1;
}, },
watch: {
item(newVal, old) {
// console.log(newVal);
this.item = newVal;
},
deep: true
},
methods: { methods: {
showAction() { showAction() {
this.show = this.show > 0 ? -1 : this.item.article_id; this.show = this.show > 0 ? -1 : this.item.article_id;
}, },
//
articleLike() { articleLike() {
this.item.is_like = !this.item.is_like;
this.$u.api.articleLike({ this.$u.api.articleLike({
article_id: this.item.article_id, article_id: this.item.article_id,
}).then(res => { }).then(res => {
console.log(res) console.log(res)
if(res.errCode == 0) { if(res.errCode == 0) {
this.$u.toast(res.message); this.$u.toast(res.message);
// this.$emit("getArticlelist"); this.$emit("getArticlelist");
} }
}) })
}, },
//
articleCollect() { articleCollect() {
this.item.is_collect = !this.item.is_collect;
this.$u.api.articleCollect({ this.$u.api.articleCollect({
article_id: this.item.article_id, article_id: this.item.article_id,
}).then(res => { }).then(res => {
console.log(res); console.log(res);
if(res.errCode == 0) { if(res.errCode == 0) {
this.$u.toast(res.message); this.$u.toast(res.message);
// this.$emit("getArticlelist"); this.$emit("getArticlelist");
} }
}) })
}, },

View File

@ -1,7 +1,7 @@
<template> <template>
<view id="info_title"> <view id="info_title">
<view> <view>
<view class="url_info" v-for="(item,index) in information" :key="index" @click="route_skip(index)"> <view class="url_info" v-for="(item,index) in list" :key="index" @click="route_skip(index)">
<image :src="item.url"></image> <image :src="item.url"></image>
<text>{{item.text}}</text> <text>{{item.text}}</text>
</view> </view>
@ -56,15 +56,33 @@
props:['information'], props:['information'],
name: "info_title", name: "info_title",
data() { data() {
return { return {
list: [{
id: 0,
url: '../../static/pageD/info(11).png',
text: '公告/资讯'
},
{
id: 0,
url: '../../static/pageD/info(6).png',
text: '活动消息'
},
{
id: 0,
url: '../../static/pageD/info(14).png',
text: '交易物流'
},
{
id: 0,
url: '../../static/pageD/info(15).png',
text: '关注消息'
},
],
} }
}, },
watch: {
information(newVal, old) {
console.log(newVal);
},
deep: true
},
methods: { methods: {
// //
route_skip(index) { route_skip(index) {

View File

@ -187,9 +187,19 @@
rgb.push(color) rgb.push(color)
} }
return '#' + rgb.join('') return '#' + rgb.join('')
},
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() { mounted() {
this.refreshToken_function();
// 3 // 3
this.remaining_time(); this.remaining_time();
this.apiwelcome(); this.apiwelcome();

View File

@ -7,7 +7,7 @@
<view class="label"> <view class="label">
<u-tabs-swiper ref="group" :list="classifyList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="current" font-size="24" :show-bar="false" @change="tabsChange" height="88"></u-tabs-swiper> <u-tabs-swiper ref="group" :list="classifyList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="current" font-size="24" :show-bar="false" @change="tabsChange" height="88"></u-tabs-swiper>
</view> </view>
<swiper :current="swiperCurrent" @animationfinish="animationfinish" style="height: 260rpx"> <swiper :current="swiperCurrent" @animationfinish="animationfinish" style="height: 130px">
<swiper-item class="swiper-item list" v-for="(_, i) in classifyList" :key="i"> <swiper-item class="swiper-item list" v-for="(_, i) in classifyList" :key="i">
<!-- 最多显示3个 --> <!-- 最多显示3个 -->
<sitem :info="info" v-for="(info, index) in groupList.slice(0, 3)" :key="index"></sitem> <sitem :info="info" v-for="(info, index) in groupList.slice(0, 3)" :key="index"></sitem>
@ -97,8 +97,8 @@ export default {
box-sizing: border-box; box-sizing: border-box;
padding: 0 30rpx; padding: 0 30rpx;
display: flex; display: flex;
> view { &:not(:nth-child(3n)) {
&:not(:nth-child(3n)) { > view {
margin-right: 20rpx; margin-right: 20rpx;
} }
} }

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="item" @click="toDetailsPage"> <view class="item" @click="toDetailsPage">
<image class="head" :src="info.pintuan_image" mode="widthFix"></image> <image class="head" :src="info.pintuan_image"></image>
<text class="title u-line-1">{{ info.pintuan_goods_name }}</text> <text class="title u-line-1">{{ info.pintuan_goods_name }}</text>
<view class="price"> <view class="price">
<view>{{ info.pintuan_goods_price }}</view> <view>{{ info.pintuan_goods_price }}</view>
@ -47,9 +47,9 @@ export default {
width: 210rpx; width: 210rpx;
overflow: hidden; overflow: hidden;
.head{ .head{
width: 150rpx; width: 210rpx;
height: 150rpx; height: 131rpx;
border-radius: 10rpx; border-radius: 6rpx;
} }
.title{ .title{
display: inline-block; display: inline-block;

View File

@ -2,7 +2,7 @@
<view class="list"> <view class="list">
<view class="top">商品推荐</view> <view class="top">商品推荐</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> <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> </view>
<swiper class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" :style="{height: swiperHeight}"> <swiper class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" :style="{height: swiperHeight}">
<swiper-item class="swiper-item" v-for="(_, index) in classifyList" :key="index"> <swiper-item class="swiper-item" v-for="(_, index) in classifyList" :key="index">
@ -39,7 +39,6 @@ export default {
watch: { watch: {
current(index) { current(index) {
this.page = 1; this.page = 1;
this.goodsList = [];
const id = this.classifyList[index].gc_id; const id = this.classifyList[index].gc_id;
this.getGoodsRecommend({gc_id: id}); this.getGoodsRecommend({gc_id: id});
} }
@ -69,7 +68,7 @@ export default {
this.page--; this.page--;
}) })
}, },
getGoodsClassRecommend() { getGoodsClassRecommend(gc_id) {
this.$u.api.getGoodsClassRecommend().then(res => { this.$u.api.getGoodsClassRecommend().then(res => {
if (res.errCode == 0) { if (res.errCode == 0) {
// current // current
@ -83,7 +82,6 @@ export default {
page: page, page: page,
gc_id: gc_id, gc_id: gc_id,
}) })
// this.swiperCurrent = this.current;
if (res.errCode == 0) { if (res.errCode == 0) {
this.timer = true; this.timer = true;
if(reload) this.goodsList = res.data.goodsList; if(reload) this.goodsList = res.data.goodsList;
@ -95,14 +93,13 @@ export default {
}, },
setSwiperHeight() { setSwiperHeight() {
// height: 230px, margin-bottom: 13 // height: 230px, margin-bottom: 13
const height = Math.ceil(this.goodsList.length / 2) * (540 + 26); // const height = Math.ceil(this.goodsList.length / 2) * (510 + 26);
this.swiperHeight = height == 0 ? '230rpx' : height + 'rpx'; // this.swiperHeight = height == 0 ? '230rpx' : height + 'rpx';
// this.swiperHeight = Math.ceil(this.goodsList.length / 2) * (270 + 13) + 'px'; this.swiperHeight = Math.ceil(this.goodsList.length / 2) * (270 + 13) + 'px';
}, },
// tabsswiper // tabsswiper
tabsChange(index) { tabsChange(index) {
this.current = index; this.swiperCurrent = index;
// this.getGoodsRecommend({ gc_id: this.classifyList[this.current].gc_id });
}, },
// swiper-itemtabs // swiper-itemtabs
transition(e) { transition(e) {
@ -114,9 +111,8 @@ export default {
animationfinish(e) { animationfinish(e) {
let current = e.detail.current; let current = e.detail.current;
this.$refs.uTabs.setFinishCurrent(current); this.$refs.uTabs.setFinishCurrent(current);
this.current = current;
this.swiperCurrent = current; this.swiperCurrent = current;
// this.getGoodsRecommend({ gc_id: this.classifyList[this.current].gc_id }); this.current = current;
}, },
} }
} }

View File

@ -18,7 +18,7 @@
</view> </view>
<!-- 服务协议 --> <!-- 服务协议 -->
<view class="pact" v-if="0"> <view class="pact">
<view> <view>
<view></view> <view></view>
<text>我已详细阅读并同意</text> <text>我已详细阅读并同意</text>

View File

@ -19,7 +19,7 @@ export default {
console.log(option) console.log(option)
// //
let typeIindex = option.index; let typeIindex = option.index;
this.typeIndexRquest(typeIindex); this.typeIndexRquest(typeIindex)
}, },
methods: { methods: {
typeIndexRquest(typeIindex){ typeIndexRquest(typeIindex){
@ -28,22 +28,16 @@ export default {
this.$u.api.documentInfo({ this.$u.api.documentInfo({
document_code: 'agreement' document_code: 'agreement'
}).then((res)=>{ }).then((res)=>{
// console.log(res.data.document_title); console.log(res)
uni.setNavigationBarTitle({
title: res.data.document_title
})
let data = common.unescapeHTML(res.data.document_content); let data = common.unescapeHTML(res.data.document_content);
this.document_content = data; this.document_content = data
}) })
} }
if(typeIindex == 1){ if(typeIindex == 1){
this.$u.api.documentInfo({ this.$u.api.documentInfo({
document_code: 'privacy' document_code: 'privacy'
}).then((res)=>{ }).then((res)=>{
// console.log(res.data.document_title); console.log(res)
uni.setNavigationBarTitle({
title: res.data.document_title
})
let data = common.unescapeHTML(res.data.document_content); let data = common.unescapeHTML(res.data.document_content);
this.document_content = data this.document_content = data
}) })
@ -52,10 +46,7 @@ export default {
this.$u.api.documentInfo({ this.$u.api.documentInfo({
document_code: 'use' document_code: 'use'
}).then((res)=>{ }).then((res)=>{
// console.log(res.data.document_title); console.log(res)
uni.setNavigationBarTitle({
title: res.data.document_title
})
let data = common.unescapeHTML(res.data.document_content); let data = common.unescapeHTML(res.data.document_content);
this.document_content = data this.document_content = data
}) })

View File

@ -1,29 +1,27 @@
<template> <template>
<view class="userinfo"> <view class="userinfo">
<view class="user"> <view class="user">
<view class="info"> <view class="info">
<view class="avatar"> <image></image>
<image :src="item.member_avatar"></image> <view>
</view> <text>达人昵称</text>
<view class="box"> <text>关注数量</text>
<view class="name">{{ item.member_nickname }}</view>
<view class="num">
<text>粉丝数{{ item.fans_num }}</text>
<text>评论数{{ item.comment_num }}</text>
</view>
</view> </view>
</view> </view>
<view class="btn" :class="[ is_follow ? 'btn-follow' : 'btn-unfollow' ]" @click="following">{{ is_follow ? "已关注" : "关注" }}</view> <view class="guanzhu">关注</view>
</view> </view>
<view class="profile" :class="{'u-line-2': is_open }" @click="openPro"> <view class="profile">个性签名</view>
个性签名{{ item.recommend ? item.recommend : "对方很懒没有留下任何东西~~" }}
</view>
</view> </view>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
image{
background-color: #0f0;
}
.userinfo{ .userinfo{
height: 261rpx;
width: 100%; width: 100%;
// height: 261rpx;
padding: 30rpx; padding: 30rpx;
.user{ .user{
display: flex; display: flex;
@ -33,92 +31,53 @@
.info{ .info{
display: flex; display: flex;
align-items: center; align-items: center;
.avatar { >image{
&>image{ width: 140rpx;
width: 140rpx; height: 140rpx;
height: 140rpx; border-radius: 50%;
border-radius: 50%;
}
} }
.box { >view{
margin-left: 40rpx;
display: flex; display: flex;
height: 79rpx;
justify-content: space-between; justify-content: space-between;
flex-direction: column; flex-direction: column;
height: 79rpx; >text:first-child{
margin-left: 40rpx;
color: #333;
.name {
font-size: 28rpx; font-size: 28rpx;
color:#333;
} }
.num { >text:last-child{
font-size: 24rpx; font-size: 24rpx;
& > :first-child { color: #333;
margin-right: 20rpx;
}
} }
} }
} }
.btn{ .guanzhu{
width: 140rpx; width: 140rpx;
height: 60rpx; height: 60rpx;
font-size: 26rpx; font-size: 26rpx;
line-height: 60rpx;
text-align: center;
color:#fff; color:#fff;
line-height: 60rpx;
border-radius: 30rpx; border-radius: 30rpx;
}
.btn-follow {
background-color: #007AFF;
}
.btn-unfollow {
background-color: #FF780F; background-color: #FF780F;
text-align: center;
} }
} }
.profile{ .profile{
margin-top: 20rpx; margin-top: 19rpx;
font-size: 24rpx; font-size: 24rpx;
color: #333; color: #333;
line-height: 1.2; margin-left: 14rpx;
} }
} }
</style> </style>
<script> <script>
export default { export default {
name:"userinfo", name:"userinfo",
props: ["list"],
data(){ data(){
return { return {
item: {},
is_open: true,
is_follow: false,
}
},
watch: {
list(newVal, old) {
// console.log(newVal);
this.item = newVal;
this.is_follow = newVal.is_attention;
},
deep: true
},
methods: {
//
openPro() {
this.is_open = !this.is_open;
},
//
following() {
this.$u.api.attentionMember({
member_id: this.item.member_id
}).then(res => {
console.log(res);
if (res.errCode == 0) {
this.is_follow = !this.is_follow;
this.$u.toast(res.message);
} else {
this.$u.toast(res.message);
}
})
} }
} }
} }

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="details"> <view class="details">
<view style="border-top: 1rpx solid #ececec;"></view> <view style="border-top: 1rpx solid #ececec;"></view>
<userinfo :list="userInfo"></userinfo> <userinfo></userinfo>
<view style="border-top: 20rpx solid #ececec;"></view> <view style="border-top: 20rpx solid #ececec;"></view>
<u-tabs :is-scroll="false" bar-width="70" ref="tabs" :list="list" :current="num" :bar-style="{ <u-tabs :is-scroll="false" bar-width="70" ref="tabs" :list="list" :current="num" :bar-style="{
'background-color':'#FF780F', 'background-color':'#FF780F',
@ -13,15 +13,39 @@
}" }"
:bold="false" :bold="false"
@change="dianji" @change="dianji"
:show-bar="false"> :show-bar="false"></u-tabs>
</u-tabs> <swiper class="card" @change="dianji" :current="num">
<scroll-view class="scroll-box" scroll-y="true"> <swiper-item>
<view class="box"> <scroll-view style="width:100%;height:100%" scroll-y="true">
<videoItem v-for="item in listInfo" :key="item.article_id" :item="item" <view class="box">
@getArticlelist="getArticlelist"></videoItem> <view class="list">
<view class="no-data" v-show="!listInfo && !page">暂无数据</view> <view >
</view> <videoItem v-for="item in 10" :key="index"></videoItem>
</scroll-view> </view>
<view style="margin-left:20rpx">
<videoItem v-for="item in 10" :key="index"></videoItem>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
<swiper-item>
<scroll-view style="width:100%;height:100%" scroll-y="true">
<view class="box">
<view class="list">
<view >
<zhiboItem v-for="item in 10" :key="index"></zhiboItem>
</view>
<view style="margin-left:20rpx">
<zhiboItem v-for="item in 10" :key="index"></zhiboItem>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
</swiper>
</view> </view>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -37,85 +61,39 @@
display: flex; display: flex;
} }
} }
.scroll-box {
// display: flex;
padding: 20rpx;
box-sizing: border-box;
.box {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.no-data {
margin: 100rpx auto 0;
}
}
}
} }
</style> </style>
<script> <script>
import videoItem from "@/components/index/video-item/index"
import zhiboItem from "@/components/index/zhibo-item/index"
import userinfo from "../components/details/userinfo" import userinfo from "../components/details/userinfo"
import videoItem from "@/components/index/video-item/index"
export default { export default {
// name:"details", name:"details",
components:{ components:{
userinfo, userinfo,
videoItem videoItem,
zhiboItem
}, },
data(){ data(){
return { return {
list:[ list:[
{ {
name: '图文'
}, {
name: '短视频' name: '短视频'
}, {
name: '图文'
} }
], ],
num: 0, num:0
userInfo: {}, //
listInfo: [], //
member_id: 0,
page: 0,
} }
}, },
onLoad(option) {
// console.log(option);
this.member_id = option.id;
this.getUserInfo(option.id);
this.getArticlelist();
},
methods:{ methods:{
//
getUserInfo(id) {
this.$u.post("MemberExpert/expertInfo",{member_id: id}).then(res => {
// console.log(res);
this.userInfo = res.data.info;
// console.log(this.userInfo);
})
},
//
getArticlelist() {
this.$u.api.getArticlelist({
page: this.page,
is_video_img: this.num + 1,
member_id: this.member_id,
}).then(res => {
if (res.errCode == 0) {
// console.log(res);
this.listInfo = res.data.list;
console.log(this.listInfo);
} else {
console.log(res.message);
}
})
},
dianji(a){ dianji(a){
console.log(a); console.log(a)
if(typeof a == "object"){ if(typeof a == "object"){
this.num = a.detail.current this.num = a.detail.current
}else{ }else{
this.num = a this.num = a
} }
this.getArticlelist();
} }
} }
} }

View File

@ -14,7 +14,7 @@
<text>图片</text> <text>图片</text>
<view v-for="(item,index) in list.photo" :key="index" :style="{'background-color':index == swiper_id ? '#fff' : '#ede8e8'}"></view> <view v-for="(item,index) in list.photo" :key="index" :style="{'background-color':index == swiper_id ? '#fff' : '#ede8e8'}"></view>
</view> </view>
<view class="username">@{{ list.member_nickname }}</view> <view class="username">{{ list.member_nickname }}</view>
<view class="title">{{ list.article_title }}</view> <view class="title">{{ list.article_title }}</view>
<view class="info">{{ list.article_content }}</view> <view class="info">{{ list.article_content }}</view>
<view class="box"> <view class="box">
@ -29,7 +29,7 @@
<text>评论</text> <text>评论</text>
<u-icon name="arrow-down" color="#333" size="28" @click="is_comment=false"></u-icon> <u-icon name="arrow-down" color="#333" size="28" @click="is_comment=false"></u-icon>
</view> </view>
<scroll-view class="scroll-box" scroll-y="true" @scrolltolower="scrollBottom"> <scroll-view class="scroll-box" scroll-y="true" >
<block v-for="(item,index) in commentList" :key="index" v-if="commentList.length"> <block v-for="(item,index) in commentList" :key="index" v-if="commentList.length">
<view class="box"> <view class="box">
<image :src="item.member_avatar" mode="aspectFill"></image> <image :src="item.member_avatar" mode="aspectFill"></image>
@ -373,7 +373,6 @@ export default {
return { return {
list:{}, list:{},
swiper_id: "", swiper_id: "",
page: 1, //
cart_type: false, // cart_type: false, //
is_comment: false, // is_comment: false, //
is_focus: false, // is_focus: false, //
@ -490,10 +489,6 @@ export default {
current: e.currentTarget.dataset.url, current: e.currentTarget.dataset.url,
}) })
}, },
//
scrollBottom(e) {
console.log(e);
},
// //
gotoInfo(id) { gotoInfo(id) {
console.log(id); console.log(id);

View File

@ -135,7 +135,7 @@
</u-popup> </u-popup>
<!-- 普通商品 tool --> <!-- 普通商品 tool -->
<view class="tloos" v-if="type == 1"> <view class="tloos" v-if="type == 1">
<view class="navs" @click="toOthersPage('pageC/merchant/index?id=' + storeInfo.store_id)"> <view class="navs">
<image src="/static/image/common/18.png"></image> <image src="/static/image/common/18.png"></image>
店铺 店铺
</view> </view>
@ -155,7 +155,7 @@
<!-- 秒杀 tool --> <!-- 秒杀 tool -->
<view class="spike-tool" v-if="type==3"> <view class="spike-tool" v-if="type==3">
<view class="left"> <view class="left">
<view @click="toOthersPage('pageC/merchant/index?id=' + storeInfo.store_id)"> <view>
<image src="/static/image/common/18.png"></image> <image src="/static/image/common/18.png"></image>
<text>店铺</text> <text>店铺</text>
</view> </view>
@ -183,8 +183,7 @@ export default {
data() { data() {
return { return {
list: [], // list: [], //
goodsInfo: {}, // goodsInfo: {}, //
storeInfo: {},
glist: [], // glist: [], //
id: 0, // id/id/ id id: 0, // id/id/ id
type: '', // 1 2 3 4 type: '', // 1 2 3 4
@ -312,7 +311,6 @@ export default {
if (res.errCode == 0) { if (res.errCode == 0) {
this.evaluate = res.data.goods_evaluate_info; this.evaluate = res.data.goods_evaluate_info;
this.goodsInfo = res.data.goods; this.goodsInfo = res.data.goods;
this.storeInfo = res.data.store;
this.setSwiperList(res.data.goods_image); this.setSwiperList(res.data.goods_image);
this.glist = res.data.spec_list; this.glist = res.data.spec_list;
// console.log(this.goodsInfo.mobile_body); // console.log(this.goodsInfo.mobile_body);
@ -454,9 +452,6 @@ export default {
title: title title: title
}); });
}, },
toOthersPage(url) {
this.$u.route(url);
},
viewComment() { viewComment() {
this.$u.route({ this.$u.route({
url: 'pageB/comment/index', url: 'pageB/comment/index',

View File

@ -200,13 +200,11 @@ export default {
if(!this.debounce) return; if(!this.debounce) return;
this.debounce = false; this.debounce = false;
if(this.orderType == 2) { if(this.orderType == 2) {
// this.sendOrder(0);
this.withImmediate(); this.withImmediate();
} else if(this.orderType == 1) { } else if(this.orderType == 1) {
this.sendOrder(0); this.sendOrder(0);
} else {
this.sendOrder(1);
} }
else this.sendOrder(1);
}, },
// @params {Number} ifcart // @params {Number} ifcart
sendOrder(ifcart) { sendOrder(ifcart) {
@ -256,7 +254,6 @@ export default {
// console.log(params); // console.log(params);
this.$u.api.sendOrder(params).then(res => { this.$u.api.sendOrder(params).then(res => {
if(res.errCode == 0) { if(res.errCode == 0) {
// this.withImmediate();
this.$u.route({ this.$u.route({
type: 'redirect', type: 'redirect',
url: '/pageC/cart/cashier', url: '/pageC/cart/cashier',

View File

@ -1,215 +0,0 @@
<template>
<view class="classify-goods">
<view class="tab-container">
<view class="overall" :class="{ 'current' : current == 0 }" @click="switchCurrent(0)">综合</view>
<view class="salenum" :class="{ 'current' : current == 1 }" @click="switchCurrent(1)">销量</view>
<view class="new" :class="{ 'current' : current == 2 }" @click="switchCurrent(2)">新品</view>
<view class="price" :class="{ 'current' : current == 3 }" @click="switchCurrent(3)">
<view class="text">价格</view>
<view class="icon">
<u-icon name="arrow-up-fill" :color="(current == 3 && priceOrderAsc) ? '#FF780F' : '#333333'" size="22"></u-icon>
<u-icon name="arrow-down-fill" :color="(current == 3 && !priceOrderAsc) ? '#FF780F' : '#333333'" size="22"></u-icon>
</view>
</view>
</view>
<scroll-view scroll-y class="scroll-container" :style="{ height: scrollHeight }" @scrolltolower="loadMore">
<view class="goods-container">
<view v-for="goods in goodsList" :key="goods.goods_id" class="goods-view" @click="toDetailsPage(goods.goods_id)">
<goodsItem :info="goods"></goodsItem>
</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>
import goodsItem from "@/components/shop/list/item"
export default {
data() {
return {
pageSize: 15,
cid: '',
page: 1,
current: 0,
priceOrderAsc: true, //
goodsList: [],
scrollHeight: '',
loadStatus: 'loadmore',
timer: true, //
}
},
components: {
goodsItem
},
watch: {
current(value) {
this.page = 1;
this.goodsList = [];
this.getStoreGoodsList({ laod: 'reload' });
},
priceOrderAsc(value) {
this.page = 1;
this.getStoreGoodsList({ laod: 'reload' });
}
},
onLoad(option) {
if(option.cid == 'all') {
this.current = 0;
this.cid = 0;
} else if(option.cid == 'new') {
this.current = 2;
this.cid = 0;
} else {
this.cid = option.cid;
}
this.setTitle(option.name);
this.sid = option.sid;
this.setViewHeight();
this.getStoreGoodsList({ load: 'reload' });
},
methods: {
setOrderSort() {
let sort = '';
if(this.current == 0) {
sort = 'goods_sort';
} else if(this.current == 1) {
sort = 'goods_salenum';
} else if(this.current == 2) {
sort = 'goods_addtime';
} else if(this.current == 3) {
if(this.priceOrderAsc) sort = 'goods_price_asc';
else sort = 'goods_price_desc';
}
return sort;
},
// goods_salenum evaluation_count goods_price_asc goods_price_desc
async getStoreGoodsList({ load = 'reload' } = {}) {
const sort = this.setOrderSort();
let params = {
id: this.sid,
page: this.page,
order: sort,
};
console.log(this.cid);
if(this.cid) Object.assign(params, { gc_id: this.cid })
const res = await this.$u.api.getStoreGoodsList(params);
this.timer = true;
if(res.errCode == 0) {
this.pageSize = res.data.per_page;
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.getStoreGoodsList({ 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 == 3 && this.current == 3) this.priceOrderAsc = !this.priceOrderAsc;
this.current = current;
},
setViewHeight() {
const res = uni.getSystemInfoSync();
this.scrollHeight = res.windowHeight - 90 / 2 + 'px';
// console.log(this.scrollHeight);
},
toDetailsPage(id) {
this.$u.route('/pageB/sdetails/index', {
id: id,
type: 1 // 1 2 3 4
});
},
setTitle(title){
uni.setNavigationBarTitle({
title: title
});
},
}
};
</script>
<style lang="scss" scoped>
.classify-goods {
width: 100%;
background-color: #FFFFFF;
.tab-container {
box-sizing: border-box;
padding: 30rpx 40rpx;
display: flex;
justify-content: space-between;
> view {
height: 30rpx;
line-height: 30rpx;
font-size: 32rpx;
color: rgba(51,51,51,1);
}
.price {
display: flex;
align-items: center;
justify-content: flex-end;
.text {
margin-right: 5rpx;
}
.icon {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
}
.current {
color: rgba(255,120,15,1);
}
}
.scroll-container {
box-sizing: border-box;
padding: 0 30rpx;
.goods-container {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
// .goods-view {
// margin: 0 auto;
// width: 690rpx;
// display: flex;
// background-color: #F5F5F5;
// margin-bottom: 30rpx;
// align-items: center;
// > image {
// width: 220rpx;
// height: 170rpx;
// 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: 36rpx;
// }
// }
// }
}
}
</style>

View File

@ -3,14 +3,14 @@
<view class="top"> <view class="top">
<image :src="info.store_avatar"></image> <image :src="info.store_avatar"></image>
<view class="name">{{info.store_name}}</view> <view class="name">{{info.store_name}}</view>
<view class="info">创建时间{{ info.store_addtime | date('yyyy年mm月dd日') }} | {{ info.live_store_address || '暂无地址' }}</view> <view class="info">创建时间{{store_addtime|date}} | {{info.live_store_address}}</view>
<view class="num"> <view class="num">
<view> <view>
<view class="value">{{info.store_collect}}</view> <view class="value">{{info.store_collect}}</view>
<view class="title">粉丝数</view> <view class="title">粉丝数</view>
</view> </view>
<view> <view>
<view class="value">{{ info.evaluatecount }}</view> <view class="value">23435</view>
<view class="title">评价</view> <view class="title">评价</view>
</view> </view>
<view> <view>
@ -22,9 +22,9 @@
<view class="bottom"> <view class="bottom">
<view class="title"> <view class="title">
<view>工商执照</view> <view>工商执照</view>
<u-icon name="arrow-down" color="#999999" size="28"></u-icon> <image></image>
</view> </view>
<view class="image-list" v-if="info.business_licence_number_electronic"> <view class="image-list">
<image :src="info.business_licence_number_electronic"></image> <image :src="info.business_licence_number_electronic"></image>
</view> </view>
</view> </view>
@ -37,9 +37,9 @@ export default {
info:{} info:{}
} }
}, },
onLoad(option){ onLoad(){
this.$u.api.getStoreInfo({id: option.id}).then((res)=>{ this.$u.api.getStoreInfo({id:1}).then((res)=>{
// console.log(res) console.log(res)
this.info = res.data this.info = res.data
}) })
} }
@ -113,6 +113,11 @@ export default {
font-weight: 500; font-weight: 500;
color: rgba(51,51,51,1); color: rgba(51,51,51,1);
} }
> image {
width: 24rpx;
height: 14rpx;
background-color: aqua;
}
} }
.image-list { .image-list {
background-color: #ffffff; background-color: #ffffff;

View File

@ -1,200 +0,0 @@
<template>
<view class="classify-goods">
<view class="tab-container">
<view class="overall" :class="{ 'current' : current == 0 }" @click="switchCurrent(0)">综合</view>
<view class="salenum" :class="{ 'current' : current == 1 }" @click="switchCurrent(1)">销量</view>
<view class="new" :class="{ 'current' : current == 2 }" @click="switchCurrent(2)">新品</view>
<view class="price" :class="{ 'current' : current == 3 }" @click="switchCurrent(3)">
<view class="text">价格</view>
<view class="icon">
<u-icon name="arrow-up-fill" :color="(current == 3 && priceOrderAsc) ? '#FF780F' : '#333333'" size="22"></u-icon>
<u-icon name="arrow-down-fill" :color="(current == 3 && !priceOrderAsc) ? '#FF780F' : '#333333'" size="22"></u-icon>
</view>
</view>
</view>
<scroll-view scroll-y class="scroll-container" :style="{ height: scrollHeight }" @scrolltolower="loadMore">
<view class="goods-container">
<view v-for="goods in goodsList" :key="goods.goods_id" class="goods-view" @click="toDetailsPage(goods.goods_id)">
<goodsItem :info="goods"></goodsItem>
</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>
import goodsItem from "@/components/shop/list/item"
export default {
data() {
return {
pageSize: 15,
cid: '',
page: 1,
current: 0,
priceOrderAsc: true, //
goodsList: [],
scrollHeight: '',
loadStatus: 'loadmore',
timer: true, //
}
},
components: {
goodsItem
},
props: {
sid: String
},
watch: {
current(value) {
this.page = 1;
this.goodsList = [];
this.getStoreGoodsList({ laod: 'reload' });
},
priceOrderAsc(value) {
this.page = 1;
this.getStoreGoodsList({ laod: 'reload' });
}
},
created() {
this.setViewHeight();
this.getStoreGoodsList({ load: 'reload' });
},
methods: {
setOrderSort() {
let sort = '';
if(this.current == 0) {
sort = 'goods_sort';
} else if(this.current == 1) {
sort = 'goods_salenum';
} else if(this.current == 2) {
sort = 'goods_addtime';
} else if(this.current == 3) {
if(this.priceOrderAsc) sort = 'goods_price_asc';
else sort = 'goods_price_desc';
}
return sort;
},
// goods_salenum evaluation_count goods_price_asc goods_price_desc
async getStoreGoodsList({ load = 'reload' } = {}) {
const sort = this.setOrderSort();
const res = await this.$u.api.getStoreGoodsList({
id: this.sid,
page: this.page,
order: sort,
})
this.timer = true;
if(res.errCode == 0) {
this.pageSize = res.data.per_page;
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.getStoreGoodsList({ 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();
const otherHeight = 347 + 140 + 20 + 98;
this.scrollHeight = res.windowHeight - otherHeight / 2 + 'px';
// console.log(this.scrollHeight);
},
toDetailsPage(id) {
this.$u.route('/pageB/sdetails/index', {
id: id,
type: 1 // 1 2 3 4
});
}
}
};
</script>
<style lang="scss" scoped>
.classify-goods {
width: 100%;
background-color: #FFFFFF;
.tab-container {
box-sizing: border-box;
padding: 30rpx 40rpx;
display: flex;
justify-content: space-between;
> view {
height: 30rpx;
line-height: 30rpx;
font-size: 32rpx;
color: rgba(51,51,51,1);
}
.price {
display: flex;
align-items: center;
justify-content: flex-end;
.text {
margin-right: 5rpx;
}
.icon {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
}
.current {
color: rgba(255,120,15,1);
}
}
.scroll-container {
box-sizing: border-box;
padding: 0 30rpx;
.goods-container {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
// .goods-view {
// margin: 0 auto;
// width: 690rpx;
// display: flex;
// background-color: #F5F5F5;
// margin-bottom: 30rpx;
// align-items: center;
// > image {
// width: 220rpx;
// height: 170rpx;
// 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: 36rpx;
// }
// }
// }
}
}
</style>

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="merchant"> <view class="merchant">
<!-- <view v-if="show" class="show-hide"> <view v-if="show">
<view> <view>
<image></image> <image></image>
<view>消息</view> <view>消息</view>
@ -13,70 +13,67 @@
<image></image> <image></image>
<view>我的</view> <view>我的</view>
</view> </view>
</view> --> </view>
<view class="top" :style="{'background-image':'url(' + info.store_banner + ')'}"> <view class="top" :style="{'background-image':'url(' + info.store_banner + ')'}">
<image :src="info.store_avatar"></image> <image :src="info.store_avatar"></image>
<view class="info"> <view class="info">
<view class="name u-line-1">{{info.store_name}}</view> <view class="name u-line-1">{{info.store_name}}</view>
<view class="num">粉丝数{{info.store_collect}}</view> <view class="num">粉丝数{{info.store_collect}}</view>
</view> </view>
<view class="btn" @click="attentionMember"> <view class="btn">
<image src="/static/image/shop/8.png"></image> <image></image>
<view>{{ info.is_attention == 0 ? "关注" : "已关注" }}</view> <view>{{ 0 ? "关注" : "已关注" }}</view>
</view> </view>
</view> </view>
<view class="follow" v-if="info.attention_member && info.attention_member.length"> <view class="follow">
<view class="title">关注</view> <view class="title">关注</view>
<scroll-view scroll-x class="list"> <scroll-view scroll-x class="list">
<view class="list-items"> <view class="list-items">
<view v-for="(item, index) in info.attention_member" :key="index" class="item"> <view v-for="(item, index) in 9" :key="index" class="item">
<image :src="item.friend_frommavatar"></image> <image></image>
<view class="nickname u-line-1">{{ item.friend_frommname }}</view> <view class="nickname u-line-1">用户昵称</view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<view class="main"> <view class="main">
<view class="video-image" v-if="cur==0 && indextop.length"> <view class="classify" v-if="cur==0">
<view v-for="item in indextop" :key="item.id"> <view v-for="item in indextop" :key="item.id">
<videoTop :url="item.url" v-if="item.type == 2"></videoTop> <videoTop :url="item.url" v-if="item.type == 2"></videoTop>
<imageTop v-else :url="item.url"></imageTop> <imageTop v-else :url="item.url"></imageTop>
</view> </view>
<view style="display: flex;flex-wrap: wrap;" v-if="indexlist.length"> <view style="display: flex;flex-wrap: wrap;">
<listitem :style="{'margin-left': index%2 == 1 ? '20rpx':'0'}" v-for="(item,index) in indexlist" :key="item.id" :type="item.type" :url="item.url"></listitem> <listitem :style="{'margin-left': index%2 == 1 ? '20rpx':'0'}" v-for="(item,index) in indexlist" :key="item.id" :type="item.type" :url="item.url"></listitem>
</view> </view>
</view> </view>
<!-- 商品筛选排序未完成 --> <!-- 商品筛选排序未完成 -->
<view class="item" v-if="cur==1"> <view class="item" v-if="cur==1">
<!-- <item v-for="item in list" :key="item.gc_id" :info="item" class="item"></item> --> <item v-for="item in list" :key="item.gc_id" :info="item" class="item"></item>
<goods :sid="sid"></goods>
</view> </view>
</view> </view>
<view class="tabbar"> <view class="tabbar">
<view @click="switchCurrent(0)"> <view @click="cur=0">
<image src="/static/image/shop/9.png"></image> <image></image>
<view>商品分类</view> <view>商品分类</view>
</view> </view>
<view @click="switchCurrent(1)"> <view @click="cur=1">
<image src="/static/image/shop/10.png" v-if="cur != 1"></image> <image></image>
<image src="/static/image/shop/13.png" v-else></image> <view>商品列表</view>
<view :style="{ color: cur == 1 ? '#FF780F' : '#999999' }">商品列表</view>
</view> </view>
<view @click="switchCurrent(2)"> <view @click="toDetailsPage">
<image src="/static/image/shop/11.png"></image> <image></image>
<view>店铺信息</view> <view>店铺信息</view>
</view> </view>
<view @click="switchCurrent(3)"> <view>
<image src="/static/image/shop/12.png"></image> <image></image>
<view>联系客服</view> <view>联系客服</view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
// import item from "@/components/shop/list/item" import item from "@/components/shop/list/item"
import goods from "./goods"
import videoTop from "../components/merchant/video-top" import videoTop from "../components/merchant/video-top"
import imageTop from "../components/merchant/image-top" import imageTop from "../components/merchant/image-top"
import listitem from "../components/merchant/list-item" import listitem from "../components/merchant/list-item"
@ -84,7 +81,6 @@ import listitem from "../components/merchant/list-item"
export default { export default {
data() { data() {
return { return {
sid: '',
show: false, show: false,
cur: 0, cur: 0,
list:[], list:[],
@ -94,64 +90,38 @@ export default {
} }
}, },
components:{ components:{
goods, item,
videoTop, videoTop,
imageTop, imageTop,
listitem listitem
}, },
onPullDownRefresh() {
this.getStoreInfo();
this.getStoreImgVideoList();
},
onNavigationBarButtonTap(e) {
// console.log(e.index);
if(e.index == 1) this.$u.route('/pageC/cart/index');
// if(e.index == 0) this.show = true;
},
methods: { methods: {
switchCurrent(current) { toDetailsPage() {
this.cur = current; uni.navigateTo({
if(current == 0) { url: './details'
this.$u.route('/pageC/merchant/storeClassify', { id: this.sid }); });
} else if(current == 2) { }
this.$u.route('./details', { id: this.sid });
}
},
getStoreInfo() {
this.$u.api.getStoreInfo({ id: this.sid }).then((res)=>{
this.info = res.data;
uni.stopPullDownRefresh();
})
},
getStoreImgVideoList() {
this.$u.api.getStoreImgVideoList({ id: this.sid }).then((res)=>{
if(res.data.length) {
this.indextop = [res.data[0], res.data[1]];
this.indexlist = res.data.slice(2,);
}
uni.stopPullDownRefresh();
})
},
attentionMember() {
this.$u.api.attentionMember({ member_id: this.info.member_id }).then(res => {
if(res.errCode == 0) {
this.getStoreInfo();
}
this.$u.toast(res.message);
})
},
}, },
onLoad(option){ onLoad(){
this.sid = option.id; this.$u.api.getStoreGoodsList({id:1}).then((res)=>{
console.log(this.sid); // console.log(res.data)
this.getStoreInfo(); this.list= res.data.list
this.getStoreImgVideoList(); })
this.$u.api.getStoreImgVideoList({id:1}).then((res)=>{
console.log(res.data)
this.indextop = [res.data[0],res.data[1]]
this.indexlist = res.data.slice(2,)
})
this.$u.api.getStoreInfo({id:1}).then((res)=>{
console.log(res)
this.info = res.data
})
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.merchant { .merchant {
// min-height: 100vh; min-height: 100vh;
background-color: #ECECEC; background-color: #ECECEC;
padding-top: calc(350rpx - var(--window-top)); padding-top: calc(350rpx - var(--window-top));
.top { .top {
@ -198,6 +168,7 @@ export default {
height: 28rpx; height: 28rpx;
flex-shrink: 0; flex-shrink: 0;
margin-right: 14rpx; margin-right: 14rpx;
background-color: aqua;
} }
> view { > view {
white-space: nowrap; white-space: nowrap;
@ -259,18 +230,13 @@ export default {
} }
} }
.main{ .main{
.video-image { padding-bottom: 98rpx;
padding-bottom: 98rpx;
}
> view {
margin-top: 20rpx;
}
} }
.tabbar { .tabbar {
border-top: 1rpx #DBDADA solid; border-top: 1rpx #DBDADA solid;
width: 100%; width: 100%;
height: 98rpx; height: 98rpx;
background: rgba(251,251,251,1); background: rgb(95, 64, 64);
display: flex; display: flex;
padding: 10rpx 55rpx; padding: 10rpx 55rpx;
position: fixed; position: fixed;
@ -285,6 +251,7 @@ export default {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
margin-bottom: 15rpx; margin-bottom: 15rpx;
background-color: aqua;
} }
> view { > view {
font-size: 24rpx; font-size: 24rpx;
@ -292,5 +259,12 @@ export default {
} }
} }
} }
.item{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
// margin-top: 20rpx;
padding:25rpx;
}
} }
</style> </style>

View File

@ -1,88 +0,0 @@
<template>
<view class="classify">
<view class="item-view" @click="viewGoods({ type: 'all', name: '全部宝贝' })">
<view>全部宝贝</view>
<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
</view>
<view class="item-view" @click="viewGoods({ type: 'new', name: '新品上架' })">
<view>新品上架</view>
<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
</view>
<view class="classify-container">
<view v-for="classifyA in classifyList" :key="classifyA.gc_parent_id" class="classify-view">
<view class="title">{{ classifyA.gc_parent_name }}</view>
<view class="classifyA-view">
<view v-for="classifyB in classifyA.gc_child" :key="classifyB.gc_id" class="classifyB-item u-line-1" @click="viewGoods({ type: classifyB.gc_parent_id, name: classifyB.gc_parent_name })">{{ classifyB.gc_parent_name }}</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
classifyList: [],
}
},
onLoad(option) {
this.sid = option.id;
this.getStoreClassifyList();
},
methods: {
viewGoods({ type, name }) {
console.log(11);
this.$u.route('pageC/merchant/classifyGoods', { sid: this.sid, cid: type, name: name });
},
getStoreClassifyList() {
this.$u.api.getStoreClassifyList({ id: this.sid }).then(res => {
this.classifyList = res.data;
})
},
}
};
</script>
<style lang="scss" scoped>
.classify {
padding-top: 20rpx;
background-color: #ECECEC;
min-height: calc(100vh - var(--window-top));
.item-view {
margin-bottom: 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 35rpx 30rpx;
font-size: 30rpx;
color: rgba(51,51,51,1);
background-color: #FFFFFF;
}
.classify-container {
.classify-view {
padding: 30rpx 35rpx;
background-color: #FFFFFF;
margin-bottom: 20rpx;
.title {
font-size: 30rpx;
color: rgba(51,51,51,1);
margin-bottom: 34rpx;
}
.classifyA-view {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.classifyB-item {
width: 335rpx;
height: 74rpx;
line-height: 74rpx;
background: rgba(255,241,230,1);
padding: 0 20rpx;
font-size: 30rpx;
color: rgba(51,51,51,1);
margin-bottom: 20rpx;
}
}
}
}
}
</style>

View File

@ -3,13 +3,13 @@
<u-empty mode="list" v-if="!list.length" color="#000" img-width="200" font-size="30" margin-top="300"></u-empty> <u-empty mode="list" v-if="!list.length" color="#000" img-width="200" font-size="30" margin-top="300"></u-empty>
<u-swipe-action <u-swipe-action
v-for="(item, index) in list" :key="index" v-for="(item, index) in list" :key="index"
:index='item.store_id' :index='item.favlog_id'
:show="item.show" :show="item.show"
:options="options" :options="options"
@click="removeFavorite" @click="removeFavorite"
@open="open" @open="open"
> >
<view class="item u-border-bottom" @click="toDetailsPage(item.store_id)"> <view class="item u-border-bottom">
<image :src="item.store_avatar"></image> <image :src="item.store_avatar"></image>
<!-- 此层wrap在此为必写的否则可能会出现标题定位错误 --> <!-- 此层wrap在此为必写的否则可能会出现标题定位错误 -->
<view class="title-wrap"> <view class="title-wrap">
@ -46,15 +46,12 @@ export default {
getStoreFavoritesList() { getStoreFavoritesList() {
this.$u.api.getFavoritesList({ this.$u.api.getFavoritesList({
type: 2 // type: 2 type: 2 // type: 2
}).then(res => {
this.list = res.data;
}) })
}, },
removeFavorite(id) { removeFavorite(id) {
console.log(id); console.log(id);
this.$u.api.removeFavorite({ this.$u.api.removeFavorite({
id: id, id: id
type: 'store'
}).then(res => { }).then(res => {
this.$u.toast(res.message); this.$u.toast(res.message);
if(res.errCode == 0) { if(res.errCode == 0) {
@ -62,11 +59,6 @@ export default {
} }
}) })
}, },
toDetailsPage(id) {
this.$u.route('pageC/merchant/index', {
id: id
});
},
open(index) { open(index) {
// swipeActionprops // swipeActionprops
// 'false''false' // 'false''false'

View File

@ -84,7 +84,7 @@
{ {
"path": "follow/index", "path": "follow/index",
"style": { "style": {
"navigationBarTitleText": "推荐达人", "navigationBarTitleText": "推荐达人列表",
"app-plus":{ "app-plus":{
"titleNView":{ "titleNView":{
"backgroundColor":"#ffffff" "backgroundColor":"#ffffff"
@ -95,7 +95,7 @@
{ {
"path": "details/index", "path": "details/index",
"style": { "style": {
"navigationBarTitleText": "达人详情", "navigationBarTitleText": "",
"app-plus":{ "app-plus":{
"titleNView":{ "titleNView":{
"backgroundColor":"#ffffff" "backgroundColor":"#ffffff"
@ -301,28 +301,23 @@
{ {
"path": "merchant/index", "path": "merchant/index",
"style": { "style": {
"enablePullDownRefresh": true,
"app-plus": { "app-plus": {
"titleSize": "36px", "titleSize": "36px",
"titleNView": { "titleNView": {
"titleColor": "#333333", "titleColor": "#333333",
"backgroundColor": "rgba(255,255,255,0)", "backgroundColor": "rgba(255,255,255,0)",
"buttons": [ "buttons": [
// { {
// "type":"none", "type":"none",
// "text":"\ue62b", "text":"...",
// "float":"right", "float":"right",
// "fontSize":"20", "fontSize":"16"
// "fontSrc": "/static/fonts/more.ttf", },
// "color": "#FFFFFF"
// },
{ {
"type":"none", "type":"none",
"text":"\ue636", "text":"\ue582",
"float":"right", "float":"right",
"fontSize":"22", "fontSize":"16"
"fontSrc": "/static/fonts/cart.ttf",
"color": "#FFFFFF"
} }
], ],
"searchInput": { "searchInput": {
@ -350,32 +345,6 @@
} }
} }
}, },
{
"path": "merchant/storeClassify",
"style": {
"navigationBarTitleText": "商品分类",
"app-plus": {
"titleSize": "36px",
"titleNView": {
"titleColor": "#333333",
"backgroundColor": "#FFFFFF"
}
}
}
},
{
"path": "merchant/classifyGoods",
"style": {
"navigationBarTitleText": "",
"app-plus": {
"titleSize": "36px",
"titleNView": {
"titleColor": "#333333",
"backgroundColor": "#FFFFFF"
}
}
}
},
{ {
"path": "cart/ConfirmOrder", "path": "cart/ConfirmOrder",
"style": { "style": {

View File

@ -61,7 +61,7 @@
<view></view> <view></view>
<text>推荐达人</text> <text>推荐达人</text>
</view> </view>
<u-icon name="arrow-right" color="#666" size="28"></u-icon> <image class="right" src="/static/image/common/1.png"></image>
</view> </view>
<view class="tuijianlist"> <view class="tuijianlist">
<!-- <darenItem style="margin-right:23rpx"></darenItem> <!-- <darenItem style="margin-right:23rpx"></darenItem>
@ -69,12 +69,16 @@
<darenItem v-for="item in recommendList.slice(0,3)" :key="item.id" :info="item" v-on:pChangeType="changeType"></darenItem> <darenItem v-for="item in recommendList.slice(0,3)" :key="item.id" :info="item" v-on:pChangeType="changeType"></darenItem>
</view> </view>
</view> </view>
<view class="rec-list"> <view class="list">
<view class="rec-box"> <view>
<!-- {{ fansList }} --> <!-- <videoItem isguanzhu="true" v-for="item in 10"></videoItem> -->
<videoItem isguanzhu="true" v-for="item in fansList" :key="item.article_id" <videoItem isguanzhu="true" v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id"
:item="item"></videoItem> :item="item" @getArticlelist="getArticlelist"></videoItem>
<view class="no-data" v-show="!fansList.length">您还没有关注哦赶紧去点点关注</view> </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> </view>
</view> </view>
@ -177,17 +181,6 @@
} }
} }
} }
.rec-list {
width: 100%;
.rec-box {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.no-data {
margin: 200rpx auto 0;
}
}
}
} }
</style> </style>
<script> <script>
@ -213,8 +206,7 @@
recommendList: [], // recommendList: [], //
indexImageSwiper: [], indexImageSwiper: [],
zhiboImageSwiper: [], zhiboImageSwiper: [],
tabLiveLists: [], tabLiveLists: []
fansList: [], //
} }
}, },
components: { components: {
@ -229,21 +221,18 @@
this.getSwiper(); this.getSwiper();
this.getZhiBoSwiper(); this.getZhiBoSwiper();
this.tabLiveList(); this.tabLiveList();
this.getFollowList();
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getArticlelist(); this.getArticlelist();
// this.getManicureList({ load: 'reload' }); // this.getManicureList({ load: 'reload' });
}, },
methods: { methods: {
//
tabLiveList() { tabLiveList() {
this.$u.api.tabLiveList().then((res) => { this.$u.api.tabLiveList().then((res) => {
console.log(res) console.log(res)
this.tabLiveLists = res.data; this.tabLiveLists = res.data
}) })
}, },
//
getSwiper() { getSwiper() {
this.$u.api.getIndexSwiper().then(res => { this.$u.api.getIndexSwiper().then(res => {
if (res.errCode == 0) { if (res.errCode == 0) {
@ -251,16 +240,14 @@
} }
}) })
}, },
//
changeType(member_id) { changeType(member_id) {
console.log(member_id); console.log(member_id);
// this.$emit("pChangeType"); this.$emit("pChangeType")
this.$u.api.attentionMember({ this.$u.api.attentionMember({
member_id: member_id member_id: member_id
}).then((res) => { }).then((res) => {
console.log(res) console.log(res)
this.getRecommendList(); this.getRecommendList();
this.getFollowList(); //
}) })
}, },
getZhiBoSwiper() { getZhiBoSwiper() {
@ -270,29 +257,26 @@
} }
}) })
}, },
//
dianji(a) { dianji(a) {
console.log(a); // console.log(a)
if (typeof a == "object") { if (typeof a == "object") {
this.num = a.detail.current this.num = a.detail.current
} else { } else {
this.num = a this.num = a
} }
}, },
//
getArticlelist() { getArticlelist() {
this.$u.api.getArticlelist({ this.$u.api.getArticlelist({
page: this.page, page: this.page,
is_video_img: 0, // 1 2 0 is_video_img: 0, // 1 2 0
}).then(res => { }).then(res => {
// uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
// console.log('37647744ghj', res) console.log('37647744ghj', res)
if (res.errCode == 0) { if (res.errCode == 0) {
this.articleList = res.data.list; this.articleList = res.data.list;
} }
}) })
}, },
//
getRecommendList() { getRecommendList() {
this.$u.api.getRecommendList().then(res => { this.$u.api.getRecommendList().then(res => {
console.log(res) console.log(res)
@ -301,17 +285,6 @@
} }
}) })
}, },
//
getFollowList() {
this.$u.post("article/attentionArticleList",{
page: 0,
}).then(res => {
if (res.errCode == 0) {
this.fansList = res.data.list;
}
// console.log(res);
})
},
toSearchPage() { toSearchPage() {
console.log("22"); console.log("22");
uni.navigateTo({ uni.navigateTo({

View File

@ -31,12 +31,8 @@
</template> </template>
<script> <script>
import { mapState } from 'vuex';
import titles from "@/components/informations/titles/titles" import titles from "@/components/informations/titles/titles"
export default { export default {
computed: {
...mapState(["hasLogin,token"])
},
data() { data() {
return { return {
information_dles : [{ information_dles : [{
@ -53,6 +49,7 @@
id: 0, id: 0,
url: '../../static/pageD/info(14).png', url: '../../static/pageD/info(14).png',
text: '交易物流' text: '交易物流'
}, },
{ {
id: 0, id: 0,
@ -97,9 +94,7 @@
}, },
onLoad() { onLoad() {
// / // /
if (this.hasLogin) { this.messageIndex()
this.messageIndex();
}
if(this.$store.state.hasLogin){ if(this.$store.state.hasLogin){
const user = uni.getStorageSync('user_info'); const user = uni.getStorageSync('user_info');
console.log(user) console.log(user)

View File

@ -22,8 +22,8 @@
<!-- <view @click="toOtherPage('/mine/GoodsCollection')"> <!-- <view @click="toOtherPage('/mine/GoodsCollection')">
<view>{{ userInfo.member_fav_goods_num || 0 }}</view> <view>{{ userInfo.member_fav_goods_num || 0 }}</view>
<view>商品收藏</view> <view>商品收藏</view>
</view> --> </view>
<!-- <view @click="toOtherPage('/mine/StoreCollection')"> <view @click="toOtherPage('/mine/StoreCollection')">
<view>{{ userInfo.member_fav_store_num || 0 }}</view> <view>{{ userInfo.member_fav_store_num || 0 }}</view>
<view>店铺收藏</view> <view>店铺收藏</view>
</view> --> </view> -->
@ -248,8 +248,8 @@ export default {
box-sizing: border-box; box-sizing: border-box;
padding: 0 30rpx; padding: 0 30rpx;
display: flex; display: flex;
// justify-content: space-between; justify-content: space-around;
justify-content: flex-start; // justify-content: flex-start;
> view { > view {
margin-right: 80rpx; margin-right: 80rpx;
text-align: center; text-align: center;

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB