Merge pull request 'xbx' (#75) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/75
This commit is contained in:
		
						commit
						bd604ecec7
					
				
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@ -1,3 +1,4 @@
 | 
			
		||||
.vscode
 | 
			
		||||
/node_modules/*
 | 
			
		||||
unpackage
 | 
			
		||||
unpackage
 | 
			
		||||
manifest.json
 | 
			
		||||
@ -249,6 +249,17 @@ export default {
 | 
			
		||||
					type: type,
 | 
			
		||||
					status: status,
 | 
			
		||||
				});
 | 
			
		||||
			},
 | 
			
		||||
			// 获取直播列表
 | 
			
		||||
			tabLiveList(){
 | 
			
		||||
				return vm.$u.post('Specialci/tabLiveList')
 | 
			
		||||
			},
 | 
			
		||||
			// 获取图文视频详情
 | 
			
		||||
			articleInfo({article_id}){
 | 
			
		||||
				return vm.$u.post('article/articleInfo',{article_id})
 | 
			
		||||
			},
 | 
			
		||||
			getStoreInfo({id}){
 | 
			
		||||
				return vm.$u.post('Store/getStoreInfo',{id})
 | 
			
		||||
			}
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -4,59 +4,20 @@ const install = (Vue, vm) => {
 | 
			
		||||
		baseUrl: 'https://dmmall.sdbairui.com/api',
 | 
			
		||||
		loadingText: '努力加载中~',
 | 
			
		||||
		loadingTime: 800
 | 
			
		||||
		// ......
 | 
			
		||||
 | 
			
		||||
	});
 | 
			
		||||
	
 | 
			
		||||
	// 请求拦截,配置Token等参数
 | 
			
		||||
	Vue.prototype.$u.http.interceptor.request = (config) => {
 | 
			
		||||
		// 引用token
 | 
			
		||||
		// 方式一,存放在vuex的token,假设使用了uView封装的vuex方式
 | 
			
		||||
		// 见:https://uviewui.com/components/globalVariable.html
 | 
			
		||||
		// config.header.token = vm.token;
 | 
			
		||||
		
 | 
			
		||||
		// 方式二,如果没有使用uView封装的vuex方法,那么需要使用$store.state获取
 | 
			
		||||
		// config.header.token = vm.$store.state.token;
 | 
			
		||||
		
 | 
			
		||||
		// 方式三,如果token放在了globalData,通过getApp().globalData获取
 | 
			
		||||
		// config.header.token = getApp().globalData.username;
 | 
			
		||||
		
 | 
			
		||||
		// 方式四,如果token放在了Storage本地存储中,拦截是每次请求都执行的
 | 
			
		||||
		// 所以哪怕您重新登录修改了Storage,下一次的请求将会是最新值
 | 
			
		||||
		const token = uni.getStorageSync('token');
 | 
			
		||||
		// console.log(token);
 | 
			
		||||
		// config.header.token = token;
 | 
			
		||||
		config.header.Authorization = 'Bearer' + " " + token;
 | 
			
		||||
		// config.header.Token = 'xxxxxx';
 | 
			
		||||
		
 | 
			
		||||
		// 可以对某个url进行特别处理,此url参数为this.$u.get(url)中的url值 
 | 
			
		||||
		// if(config.url == '/user/login') config.header.noToken = true;
 | 
			
		||||
		// 最后需要将config进行return
 | 
			
		||||
		return config;
 | 
			
		||||
		// 如果return一个false值,则会取消本次请求
 | 
			
		||||
		// if(config.url == '/user/rest') return false; // 取消某次请求
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	// // 响应拦截,判断状态码是否通过
 | 
			
		||||
	// Vue.prototype.$u.http.interceptor.response = (res) => {
 | 
			
		||||
	// 	if(res.code == 200) {
 | 
			
		||||
	// 		// res为服务端返回值,可能有code,result等字段
 | 
			
		||||
	// 		// 这里对res.result进行返回,将会在this.$u.post(url).then(res => {})的then回调中的res的到
 | 
			
		||||
	// 		// 如果配置了originalData为true,请留意这里的返回值
 | 
			
		||||
	// 		return res.result;
 | 
			
		||||
	// 	} else if(res.code == 201) {
 | 
			
		||||
	// 		// 假设201为token失效,这里跳转登录
 | 
			
		||||
	// 		vm.$u.toast('验证失败,请重新登录');
 | 
			
		||||
	// 		setTimeout(() => {
 | 
			
		||||
	// 			// 此为uView的方法,详见路由相关文档
 | 
			
		||||
	// 			vm.$u.route('/pages/user/login')
 | 
			
		||||
	// 		}, 1500)
 | 
			
		||||
	// 		return false;
 | 
			
		||||
	// 	} else {
 | 
			
		||||
	// 		// 如果返回false,则会调用Promise的reject回调,
 | 
			
		||||
	// 		// 并将进入this.$u.post(url).then().catch(res=>{})的catch回调中,res为服务端的返回值
 | 
			
		||||
	// 		return false;
 | 
			
		||||
	// 	}
 | 
			
		||||
	// }
 | 
			
		||||
		const token = uni.getStorageSync('token');
 | 
			
		||||
 | 
			
		||||
		config.header.Authorization = 'Bearer' + " " + token;
 | 
			
		||||
 | 
			
		||||
		return config;
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
<template>
 | 
			
		||||
    <view class="video-item" v-if="item" @click="toDetailsPage()" data-article_id="item.article_id" >
 | 
			
		||||
    <view class="video-item" v-if="item" @click="toDetailsPage(item.article_id)">
 | 
			
		||||
        <image class="head" :src="item.article_pic" v-if="item.type == 1" ></image>
 | 
			
		||||
		<view class="header_fist"  v-else>
 | 
			
		||||
			<view class="backes"></view>
 | 
			
		||||
@ -15,17 +15,17 @@
 | 
			
		||||
            <image src="/static/image/common/4.png" @click.stop="showAction"></image>
 | 
			
		||||
			<view class="action" v-if="show == item.article_id">
 | 
			
		||||
				<view class="bubble">
 | 
			
		||||
					<view @click="articleLike">
 | 
			
		||||
					<view @click.stop="articleLike">
 | 
			
		||||
						<image src="/static/image/common/5.png" v-if="item.is_like == 0"></image>
 | 
			
		||||
						<image src="/static/image/common/8.png" v-else></image>
 | 
			
		||||
						<text>点赞</text>
 | 
			
		||||
					</view>
 | 
			
		||||
					<view @click="articleCollect">
 | 
			
		||||
					<view @click.stop="articleCollect">
 | 
			
		||||
						<image src="/static/image/common/6.png" v-if="item.is_collect == 0"></image>
 | 
			
		||||
						<image src="/static/image/common/9.png" v-else></image>
 | 
			
		||||
						<text>收藏</text>
 | 
			
		||||
					</view>
 | 
			
		||||
					<view @click="articleAddShield">
 | 
			
		||||
					<view @click.stop="articleAddShield">
 | 
			
		||||
						<image src="/static/image/common/7.png"></image>
 | 
			
		||||
						<text>屏蔽用户</text>
 | 
			
		||||
					</view>
 | 
			
		||||
@ -229,11 +229,9 @@ export default {
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		toDetailsPage(e) {
 | 
			
		||||
			console.log(e)
 | 
			
		||||
			let article_id = '2'
 | 
			
		||||
		toDetailsPage(id) {
 | 
			
		||||
			 uni.navigateTo({
 | 
			
		||||
				url: '/pageB/photo/index?article_id=' + article_id,
 | 
			
		||||
				url: '/pageB/photo/index?id=' + id
 | 
			
		||||
			});
 | 
			
		||||
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
    "name" : "deming",
 | 
			
		||||
    "appid" : "__UNI__10450AF",
 | 
			
		||||
    "appid" : "__UNI__62A680B",
 | 
			
		||||
    "description" : "",
 | 
			
		||||
    "versionName" : "1.0.0",
 | 
			
		||||
    "versionCode" : "100",
 | 
			
		||||
 | 
			
		||||
@ -1,20 +1,20 @@
 | 
			
		||||
<template>
 | 
			
		||||
    <view class="userinfo">
 | 
			
		||||
        <view class="userhead">
 | 
			
		||||
            <image></image>
 | 
			
		||||
            <image :src="list.member_avatar"></image>
 | 
			
		||||
            <text>+</text>
 | 
			
		||||
        </view>
 | 
			
		||||
        <view class="zan">
 | 
			
		||||
            <image></image>
 | 
			
		||||
            <text>123</text>
 | 
			
		||||
            <text>{{list.like_num}}</text>
 | 
			
		||||
        </view>
 | 
			
		||||
        <view class="shoucang">
 | 
			
		||||
            <image></image>
 | 
			
		||||
            <text>123</text>
 | 
			
		||||
            <text>{{list.collect_num}}</text>
 | 
			
		||||
        </view>
 | 
			
		||||
        <view class="pinglun">
 | 
			
		||||
            <image></image>
 | 
			
		||||
            <text>123</text>
 | 
			
		||||
            <text>{{list.comment_num}}</text>
 | 
			
		||||
        </view>
 | 
			
		||||
        <view class="gouwu">
 | 
			
		||||
            <image></image>
 | 
			
		||||
@ -78,6 +78,7 @@ export default {
 | 
			
		||||
        return {
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    },
 | 
			
		||||
    props:['list']
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
@ -5,11 +5,11 @@
 | 
			
		||||
        </view>
 | 
			
		||||
        <swiper class="swiper">
 | 
			
		||||
            <swiper-item>
 | 
			
		||||
                <image></image>
 | 
			
		||||
                <image :src="list.article_pic"></image>
 | 
			
		||||
            </swiper-item>
 | 
			
		||||
            <swiper-item>
 | 
			
		||||
            <!-- <swiper-item>
 | 
			
		||||
                <image></image>
 | 
			
		||||
            </swiper-item>
 | 
			
		||||
            </swiper-item> -->
 | 
			
		||||
            
 | 
			
		||||
        </swiper>
 | 
			
		||||
        <view class="bottom">
 | 
			
		||||
@ -21,7 +21,7 @@
 | 
			
		||||
            <view class="title">hasjdhajskhj</view>
 | 
			
		||||
            <view class="info u-line-2">asdjhasjdkasljdklasjkl</view>
 | 
			
		||||
        </view>
 | 
			
		||||
        <userinfo class="userinfo"></userinfo>
 | 
			
		||||
        <userinfo class="userinfo" :list="list"></userinfo>
 | 
			
		||||
        <shpoone class="shpoone"></shpoone>
 | 
			
		||||
        <shoplist></shoplist>
 | 
			
		||||
    </view>
 | 
			
		||||
@ -120,6 +120,23 @@ export default {
 | 
			
		||||
        userinfo,
 | 
			
		||||
        shpoone,
 | 
			
		||||
        shoplist
 | 
			
		||||
    },
 | 
			
		||||
    data(){
 | 
			
		||||
        return {
 | 
			
		||||
            list:{}
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
    methods:{
 | 
			
		||||
        articleInfo(article_id){
 | 
			
		||||
            this.$u.api.articleInfo({article_id}).then((res)=>{
 | 
			
		||||
                console.log(res)
 | 
			
		||||
                this.list = res.data.info
 | 
			
		||||
            })
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
    onLoad(o){
 | 
			
		||||
        this.id = o.id
 | 
			
		||||
        this.articleInfo(this.id)
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
@ -1,12 +1,12 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<view class="details">
 | 
			
		||||
		<view class="top">
 | 
			
		||||
			<image></image>
 | 
			
		||||
			<view class="name">店铺名称</view>
 | 
			
		||||
			<view class="info">创建时间:2020年04月10日 | 浙江金华市</view>
 | 
			
		||||
			<image :src="info.store_avatar"></image>
 | 
			
		||||
			<view class="name">{{info.store_name}}</view>
 | 
			
		||||
			<view class="info">创建时间:{{store_addtime|date}} | {{info.live_store_address}}</view>
 | 
			
		||||
			<view class="num">
 | 
			
		||||
				<view>
 | 
			
		||||
					<view class="value">23435</view>
 | 
			
		||||
					<view class="value">{{info.store_collect}}</view>
 | 
			
		||||
					<view class="title">粉丝数</view>
 | 
			
		||||
				</view>
 | 
			
		||||
				<view>
 | 
			
		||||
@ -14,7 +14,7 @@
 | 
			
		||||
					<view class="title">评价</view>
 | 
			
		||||
				</view>
 | 
			
		||||
				<view>
 | 
			
		||||
					<view class="value">23435</view>
 | 
			
		||||
					<view class="value">{{info.store_credit}}</view>
 | 
			
		||||
					<view class="title">信用等级</view>
 | 
			
		||||
				</view>
 | 
			
		||||
			</view>
 | 
			
		||||
@ -25,7 +25,7 @@
 | 
			
		||||
				<image></image>
 | 
			
		||||
			</view>
 | 
			
		||||
			<view class="image-list">
 | 
			
		||||
				<image></image>
 | 
			
		||||
				<image :src="info.business_licence_number_electronic"></image>
 | 
			
		||||
			</view>
 | 
			
		||||
		</view>
 | 
			
		||||
	</view>
 | 
			
		||||
@ -33,7 +33,15 @@
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
	data() {
 | 
			
		||||
		return {}
 | 
			
		||||
		return {
 | 
			
		||||
			info:{}
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
	onLoad(){
 | 
			
		||||
		this.$u.api.getStoreInfo({id:1}).then((res)=>{
 | 
			
		||||
			console.log(res)
 | 
			
		||||
			this.info = res.data
 | 
			
		||||
		})
 | 
			
		||||
	}
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
@ -14,11 +14,11 @@
 | 
			
		||||
				<view>我的</view>
 | 
			
		||||
			</view>
 | 
			
		||||
		</view>
 | 
			
		||||
		<view class="top">
 | 
			
		||||
			<image></image>
 | 
			
		||||
		<view class="top" :style="{'background-image':'url(' + info.store_banner + ')'}">
 | 
			
		||||
			<image :src="info.store_avatar"></image>
 | 
			
		||||
			<view class="info">
 | 
			
		||||
				<view class="name u-line-1">小米官方旗舰店</view>
 | 
			
		||||
				<view class="num">粉丝数:234</view>
 | 
			
		||||
				<view class="name u-line-1">{{info.store_name}}</view>
 | 
			
		||||
				<view class="num">粉丝数:{{info.store_collect}}</view>
 | 
			
		||||
			</view>
 | 
			
		||||
			<view class="btn">
 | 
			
		||||
				<image></image>
 | 
			
		||||
@ -85,7 +85,8 @@ export default {
 | 
			
		||||
			cur: 0,
 | 
			
		||||
			list:[],
 | 
			
		||||
			indexlist:[],
 | 
			
		||||
			indextop:[]
 | 
			
		||||
			indextop:[],
 | 
			
		||||
			info:{}
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
	components:{
 | 
			
		||||
@ -111,6 +112,10 @@ export default {
 | 
			
		||||
			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>
 | 
			
		||||
 | 
			
		||||
@ -216,8 +216,14 @@
 | 
			
		||||
			this.getRecommendList();
 | 
			
		||||
			this.getSwiper();
 | 
			
		||||
			this.getZhiBoSwiper();
 | 
			
		||||
			this.tabLiveList();
 | 
			
		||||
		},
 | 
			
		||||
		methods: {
 | 
			
		||||
			tabLiveList(){
 | 
			
		||||
				this.$u.api.tabLiveList().then((res)=>{
 | 
			
		||||
					console.log(res)
 | 
			
		||||
				})
 | 
			
		||||
			},
 | 
			
		||||
			getSwiper() {
 | 
			
		||||
				this.$u.api.getIndexSwiper().then(res => {
 | 
			
		||||
					if (res.errCode == 0) {
 | 
			
		||||
@ -277,4 +283,4 @@
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
</script>
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user