Compare commits
104 Commits
045f6e6e01
...
cmx
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e0162e3ea | ||
| 20259ddf00 | |||
|
|
703689d272 | ||
|
|
282502a8d6 | ||
| 6c724d4f4c | |||
|
|
b3a7b2d032 | ||
|
|
b34ac35821 | ||
| def8f0cf1b | |||
|
6984ea9374
|
|||
| 39b2749ac9 | |||
| c01470b52d | |||
| 6e900dcd3b | |||
| 7956517c4a | |||
| 43e15cc4a7 | |||
|
|
e1c908152a | ||
|
|
aad2bca5c6 | ||
| f79db4aa62 | |||
| 4739ef71a9 | |||
|
a22b3fba71
|
|||
| 003bc07c6b | |||
|
|
e6f73f01cd | ||
| 52bce327cc | |||
|
|
74fcc50696 | ||
| 33b0137c06 | |||
| 7c05459daf | |||
| 610d012e67 | |||
| 8c3121d5ed | |||
|
8df5bc2701
|
|||
|
0c8e81f484
|
|||
|
e3407b1046
|
|||
|
55297a6587
|
|||
|
52508a1098
|
|||
|
22a67d23c4
|
|||
| 39466d3360 | |||
|
|
2e95172a75 | ||
|
|
234f11eeef | ||
| 8b6bf2da03 | |||
| 520fa5497c | |||
| 9a4e4f5efe | |||
| 9b93b6a5a9 | |||
| 199a1d3d96 | |||
|
b9b9a8e829
|
|||
| d00b4a75ac | |||
| 9631e9f827 | |||
| 097f7e3cba | |||
|
|
fe8af80983 | ||
| a9098c3156 | |||
| 228e34d8fc | |||
| e5a322fd35 | |||
| cef9296a78 | |||
| f32f7df14a | |||
| 817c886d84 | |||
|
5abe5620f5
|
|||
|
9e96eeb575
|
|||
| 6d6b1648bc | |||
| 02702bc447 | |||
| 1ee0dd4b25 | |||
|
|
0290189205 | ||
|
|
502e020000 | ||
| a0cb2a668e | |||
| 597c92e9cd | |||
|
07e1661a18
|
|||
| 26254aba84 | |||
|
6bf4fdc7e3
|
|||
|
6eeebf25c0
|
|||
| 83e57ceea6 | |||
| 9d3f8da629 | |||
|
93dbdca573
|
|||
|
57fcf69974
|
|||
|
f4313dce9d
|
|||
| f4ba942870 | |||
| a088c895d2 | |||
|
fc86ad2579
|
|||
|
eb0d648f6a
|
|||
| 71e984b2ed | |||
|
|
2afd55f79e | ||
|
|
090b7cc753 | ||
| c56743765c | |||
| 1a1a0de460 | |||
| 24410d0ee7 | |||
|
9f444ad070
|
|||
|
e11f20885f
|
|||
|
e6b7b50a1e
|
|||
| 201f858833 | |||
| 8bf42a75dd | |||
|
9054432b59
|
|||
|
2c6cdbead9
|
|||
| 2cb8f90281 | |||
| 79d8f91769 | |||
|
2a8ee65a94
|
|||
|
9872770472
|
|||
|
7a7b126fe3
|
|||
| b158080eb7 | |||
|
|
046f2e50c5 | ||
|
|
1313a90d5e | ||
|
|
ed0edbab2f | ||
|
|
361e9a76fd | ||
| 720af35b11 | |||
|
|
1b5bf33166 | ||
|
|
c4c11781fb | ||
| e1519b8d68 | |||
| 0057bcd28e | |||
| 9881ea099d | |||
|
b0f224d79b
|
31
App.vue
@@ -1,7 +1,14 @@
|
|||||||
<script>
|
<script>
|
||||||
import { mapMutations } from 'vuex';
|
import { mapMutations, mapState } from 'vuex';
|
||||||
export default {
|
export default {
|
||||||
|
globalData: {
|
||||||
|
im: {}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["hasLogin"])
|
||||||
|
},
|
||||||
onLaunch() {
|
onLaunch() {
|
||||||
|
getApp().globalData.im = this.imService
|
||||||
// 缓存token
|
// 缓存token
|
||||||
uni.getStorage({
|
uni.getStorage({
|
||||||
key: "token",
|
key: "token",
|
||||||
@@ -9,9 +16,23 @@
|
|||||||
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>
|
||||||
@@ -22,6 +43,12 @@
|
|||||||
.status_bar {
|
.status_bar {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: var(--status-bar-height);
|
height: var(--status-bar-height);
|
||||||
|
}
|
||||||
|
/* 自定义下拉 */
|
||||||
|
.load-size {
|
||||||
|
::v-deep.u-more-text {
|
||||||
|
font-size: 20rpx !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* #endif */
|
/* #endif */
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -173,10 +173,17 @@ export default {
|
|||||||
goods_id: id
|
goods_id: id
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getStoreGoodsList({ id, page = 0}){
|
getStoreGoodsList({ id, page, order, gc_id }){
|
||||||
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}){
|
||||||
@@ -287,8 +294,8 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 搜索发现列表
|
// 搜索发现列表
|
||||||
searchwordlist() {
|
searchwordlist({type}) {
|
||||||
return vm.$u.post('ShopSearch/searchwordlist')
|
return vm.$u.post('ShopSearch/searchWordList',{type})
|
||||||
},
|
},
|
||||||
// 提交试穿订单
|
// 提交试穿订单
|
||||||
saveGoodsTry({ member_name, member_mobile, area_info, address_detail, goods_id, num, store_id, appointment_time }) {
|
saveGoodsTry({ member_name, member_mobile, area_info, address_detail, goods_id, num, store_id, appointment_time }) {
|
||||||
@@ -306,7 +313,37 @@ 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 })
|
||||||
|
},
|
||||||
|
//店家id获取用户信息
|
||||||
|
getAtwillUserInfo({ id }) {
|
||||||
|
return vm.$u.post('Specialci/getAtwillUserInfo',{ store_id: id })
|
||||||
|
},
|
||||||
|
// 收藏商品
|
||||||
|
addFavoriteGoods({ fid }) {
|
||||||
|
return vm.$u.post('member/addFavoriteGoods',{ fid: fid })
|
||||||
|
},
|
||||||
|
// 取消收藏(商品/店铺)
|
||||||
|
removeFavorite({ fid, type }) {
|
||||||
|
return vm.$u.post('Member/removeFavorite',{
|
||||||
|
fav_id: fid,
|
||||||
|
type: type
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//店铺列表
|
||||||
|
storeList({ page, name_search }) {
|
||||||
|
return vm.$u.post('shop/storeList',{
|
||||||
|
page,
|
||||||
|
name_search: name_search
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 是否弹出新人优惠券
|
||||||
|
isNewmembervoucher() {
|
||||||
|
return vm.$u.post('Coupon/isNewmembervoucher')
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -175,9 +175,10 @@ export default {
|
|||||||
return vm.$u.post('Member/getFavoritesList', params);
|
return vm.$u.post('Member/getFavoritesList', params);
|
||||||
},
|
},
|
||||||
// 取消收藏(商品/店铺)
|
// 取消收藏(商品/店铺)
|
||||||
removeFavorite({ id }) {
|
removeFavorite({ id, type }) {
|
||||||
return vm.$u.post('Member/removeFavorite', {
|
return vm.$u.post('Member/removeFavorite', {
|
||||||
id: id,
|
fav_id: id,
|
||||||
|
type: type,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 设置-用户信息
|
// 设置-用户信息
|
||||||
@@ -258,12 +259,13 @@ export default {
|
|||||||
return vm.$u.post('Order/buyer_cancel', params);
|
return vm.$u.post('Order/buyer_cancel', params);
|
||||||
},
|
},
|
||||||
// add_refund
|
// add_refund
|
||||||
refundOrder({ order_id, goods_id, refund_amount, refund_type = 1 } = {}) {
|
refundOrder({ order_id, goods_id, goods_num, reason_info, refund_amount } = {}) {
|
||||||
return vm.$u.post('order/add_refund', {
|
return vm.$u.post('order/add_refund', {
|
||||||
order_id: order_id,
|
order_id: order_id,
|
||||||
goods_id: goods_id,
|
goods_id: goods_id,
|
||||||
refund_amount: refund_amount,
|
refund_amount: refund_amount,
|
||||||
refund_type: refund_type,
|
goods_num: goods_num,
|
||||||
|
reason_info: reason_info,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 删除订单
|
// 删除订单
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
|
var md5 = require("../static/js/md5.min.js")
|
||||||
const install = (Vue, vm) => {
|
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等参数
|
||||||
@@ -12,11 +13,69 @@ const install = (Vue, vm) => {
|
|||||||
|
|
||||||
const token = uni.getStorageSync('token');
|
const token = uni.getStorageSync('token');
|
||||||
|
|
||||||
config.header.Authorization = 'Bearer' + " " + token;
|
config.header.Authorization = 'Bearer' + " " + token;
|
||||||
|
Date.prototype.Format = function (fmt) { // author: meizz
|
||||||
|
var o = {
|
||||||
|
"M+": this.getMonth() + 1, // 月份
|
||||||
|
"d+": this.getDate(), // 日
|
||||||
|
"h+": this.getHours(), // 小时
|
||||||
|
"m+": this.getMinutes(), // 分
|
||||||
|
"s+": this.getSeconds(), // 秒
|
||||||
|
"q+": Math.floor((this.getMonth() + 3) / 3), // 季度
|
||||||
|
"S": this.getMilliseconds() // 毫秒
|
||||||
|
};
|
||||||
|
if (/(y+)/.test(fmt))
|
||||||
|
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
||||||
|
for (var k in o)
|
||||||
|
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
||||||
|
return fmt;
|
||||||
|
}
|
||||||
|
let time = new Date().Format("yyyyMMddhhmmss")
|
||||||
|
config.header.Sign = md5('DBCA4F8DA7BC0BA2' + time) + '-' + time
|
||||||
return config;
|
return config;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 响应拦截,如配置,每次请求结束都会执行本方法
|
||||||
|
Vue.prototype.$u.http.interceptor.response = (res) => {
|
||||||
|
if(parseInt(res.data.errCode) == 0) {
|
||||||
|
// res为服务端返回值,可能有errCode,result等字段
|
||||||
|
// 这里对res.result进行返回,将会在this.$u.post(url).then(res => {})的then回调中的res的到
|
||||||
|
// 如果配置了originalData为true,请留意这里的返回值
|
||||||
|
return res.data;
|
||||||
|
} else if(res.data.errCode == 401) {
|
||||||
|
// 假设201为token失效,这里跳转登录
|
||||||
|
// vm.$u.toast('您还没有登录哦,请先去登录!');
|
||||||
|
if (res.data.data.action != "memberinfo") {
|
||||||
|
uni.showModal({
|
||||||
|
title: "温馨提示",
|
||||||
|
content: "您还未登录,请立即登录",
|
||||||
|
cancelText: "以后再说",
|
||||||
|
confirmText: "立即登录",
|
||||||
|
confirmColor: "#FF780F",
|
||||||
|
success(res) {
|
||||||
|
// console.log(res);
|
||||||
|
if (res.confirm) {
|
||||||
|
setTimeout(() => {
|
||||||
|
// 此为uView的方法,详见路由相关文档
|
||||||
|
vm.$u.route('/pageA/login/login')
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
if (res.cancel) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
} else if (res.errCode == 1) {
|
||||||
|
console.log(res.message);
|
||||||
|
return res.data;
|
||||||
|
} else {
|
||||||
|
// 如果返回false,则会调用Promise的reject回调,
|
||||||
|
// 并将进入this.$u.post(url).then().catch(res=>{})的catch回调中,res为服务端的返回值
|
||||||
|
return res.data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ const store = new Vuex.Store({
|
|||||||
groupbuyInfo: {}, // 秒杀详情
|
groupbuyInfo: {}, // 秒杀详情
|
||||||
loadmore: {}, // 下拉加载返回的数据
|
loadmore: {}, // 下拉加载返回的数据
|
||||||
hasLogin: false, // 登录状态
|
hasLogin: false, // 登录状态
|
||||||
token: "" // 储存token
|
token: "", // 储存token
|
||||||
|
showLoginModel: false, // 登录框
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
getOrderAddress(state) {
|
getOrderAddress(state) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="daren-item" @click="toDetailsPage">
|
<view class="daren-item">
|
||||||
<image class="head" :src="info.member_avatar"></image>
|
<image class="head" @click="toDetailsPage" :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,17 +8,31 @@
|
|||||||
</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();
|
||||||
const toke = uni.getStorageSync('token');
|
if (this.hasLogin) {
|
||||||
if (toke) {
|
this.$u.route({
|
||||||
console.log(toke);
|
url: "/pageB/details/index",
|
||||||
|
params: {
|
||||||
|
id: this.info.member_id
|
||||||
|
}
|
||||||
|
});
|
||||||
}else{
|
}else{
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pageA/login/login'
|
url: '/pageA/login/login'
|
||||||
@@ -32,8 +46,8 @@ export default {
|
|||||||
// })
|
// })
|
||||||
},
|
},
|
||||||
changeType:function(type){
|
changeType:function(type){
|
||||||
console.log("111")
|
// console.log("111")
|
||||||
this.$emit("pChangeType",type)
|
this.$emit("pChangeType",type);
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -54,7 +68,7 @@ export default {
|
|||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
margin-top: 24rpx;
|
margin-top: 24rpx;
|
||||||
background-color: #0f0;
|
background-color: #0077AA;
|
||||||
}
|
}
|
||||||
.name{
|
.name{
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<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>
|
||||||
<image class="head" :src="item.article_pic" ></image>
|
<image class="head" :src="item.article_pic" ></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="title" v-if="!isguanzhu">{{ item.article_title }}</view>
|
<view class="title" v-if="">{{ item.article_title }}</view>
|
||||||
<view class="jianjie">{{ item.article_content }}</view>
|
<view class="jianjie">{{ item.article_content }}</view>
|
||||||
<view class="user">
|
<view class="user">
|
||||||
<view class="info">
|
<view class="info">
|
||||||
@@ -37,23 +37,24 @@
|
|||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.video-item{
|
.video-item{
|
||||||
margin-top: 20rpx;
|
flex-shrink: 0;
|
||||||
width: 335rpx;
|
width: 335rpx;
|
||||||
box-shadow:0 3rpx 7rpx 0 rgba(153, 153, 153, 0.35);
|
|
||||||
padding-bottom: 20rpx;
|
padding-bottom: 20rpx;
|
||||||
border-radius: 20rpx;
|
margin-top: 20rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
box-shadow:0 3rpx 7rpx 0 rgba(153, 153, 153, 0.35);
|
||||||
.head{
|
.head{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 334rpx;
|
height: 334rpx;
|
||||||
}
|
}
|
||||||
.title{
|
.title{
|
||||||
margin:0 auto;
|
margin:0 auto;
|
||||||
margin-top: 20rpx;
|
margin-top: 4rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
line-height: 48rpx;
|
line-height: 40rpx;
|
||||||
width: 300rpx;
|
width: 300rpx;
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
text-overflow:ellipsis;
|
text-overflow:ellipsis;
|
||||||
@@ -63,7 +64,7 @@
|
|||||||
}
|
}
|
||||||
.jianjie{
|
.jianjie{
|
||||||
margin:0 auto;
|
margin:0 auto;
|
||||||
margin-top: 20rpx;
|
margin-top: 10rpx;
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
line-height: 30rpx;
|
line-height: 30rpx;
|
||||||
@@ -173,7 +174,6 @@
|
|||||||
.backes{
|
.backes{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
background: rgba(0,0,0,0.6);
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
@@ -195,32 +195,44 @@ 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");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 屏蔽
|
||||||
articleAddShield() {
|
articleAddShield() {
|
||||||
this.$u.api.articleAddShield({
|
this.$u.api.articleAddShield({
|
||||||
article_id: this.item.article_id,
|
article_id: this.item.article_id,
|
||||||
@@ -229,14 +241,20 @@ export default {
|
|||||||
// 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("updateList");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
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
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="notice">
|
<view class="notice">
|
||||||
<view v-for="(item,index) in notice" :key="index">
|
<view v-for="(item,index) in notice" :key="index" @click="gotoInfo(index)">
|
||||||
<view class="time_notice">2020-05-14 20:11</view>
|
<view class="time_notice">{{ item.addtime }}</view>
|
||||||
<view class="notice_view">
|
<view class="notice_view">
|
||||||
<image :src="item.url" mode="aspectFill" ></image>
|
<image :src="item.picture" mode="aspectFill" ></image>
|
||||||
<view class="text_view">{{item.content}}</view>
|
<view class="text_view u-line-2">{{ item.content }}</view>
|
||||||
<view class="notice_list">
|
<view class="notice_list">
|
||||||
<text>查看详情</text>
|
<text>查看详情</text>
|
||||||
<u-icon name="arrow-right" color="#666"></u-icon>
|
<u-icon name="arrow-right" color="#666"></u-icon>
|
||||||
@@ -74,21 +74,28 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "notice",
|
name: "notice",
|
||||||
|
props: ['list'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
notice : [
|
notice : []
|
||||||
{
|
|
||||||
time : '2020-05-14 20:11',
|
|
||||||
content:'潮牌1折秒杀!杨幂同款小白鞋今日43元送10000元大红包还有明星限量签名照',
|
|
||||||
url : '../../../pageE/static/mine/23.png'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
time : '2020-05-14 20:11',
|
|
||||||
content:'潮牌1折秒杀!杨幂同款小白鞋今日43元送10000元大红包还有明星限量签名照',
|
|
||||||
url : '../../../pageE/static/mine/23.png'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
};
|
||||||
}
|
},
|
||||||
|
watch: {
|
||||||
|
list(newVal,old) {
|
||||||
|
// console.log(newVal);
|
||||||
|
this.notice = newVal;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
gotoInfo(index) {
|
||||||
|
console.log(index);
|
||||||
|
this.$u.route({
|
||||||
|
url: "/pageD/notice/info",
|
||||||
|
params: {
|
||||||
|
index: index
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -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 list" :key="index" @click="route_skip(index)">
|
<view class="url_info" v-for="(item,index) in information" :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,33 +56,15 @@
|
|||||||
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) {
|
||||||
|
|||||||
@@ -44,49 +44,57 @@
|
|||||||
this.$emit('tochange');
|
this.$emit('tochange');
|
||||||
let member_mobile = this.member_mobile;
|
let member_mobile = this.member_mobile;
|
||||||
// 校验手机号
|
// 校验手机号
|
||||||
let type_phone = this.$u.test.mobile(member_mobile)
|
let type_phone = this.$u.test.mobile(member_mobile);
|
||||||
console.log(member_mobile)
|
// console.log(member_mobile);
|
||||||
console.log(this.smslog_type)
|
// console.log(this.smslog_type);
|
||||||
// 判断是否有手机号为空
|
// 判断是否有手机号为空
|
||||||
if (type_phone == false) {
|
if (type_phone == false) {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: '手机号格式不正确',
|
title: "手机号格式不正确"
|
||||||
type: 'error'
|
})
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
// 验证码倒计时
|
// 验证码倒计时
|
||||||
if (this.$refs.uCode.canGetCode) {
|
if (this.$refs.uCode.canGetCode) {
|
||||||
// 模拟向后端请求验证码
|
uni.showLoading({
|
||||||
uni.showLoading({
|
title: '正在获取验证码'
|
||||||
title: '正在获取验证码'
|
})
|
||||||
})
|
// 请求接口
|
||||||
setTimeout(() => {
|
this.$u.api.sendSmsCode({
|
||||||
uni.hideLoading();
|
member_mobile: this.member_mobile,
|
||||||
// 这里此提示会被this.start()方法中的提示覆盖
|
smslog_type: this.smslog_type
|
||||||
this.$u.toast('验证码已发送');
|
}).then((res) => {
|
||||||
// 通知验证码组件内部开始倒计时
|
if (res.errCode == 0) {
|
||||||
this.$refs.uCode.start();
|
console.log(res);
|
||||||
}, 2000);
|
this.$refs.uToast.show({
|
||||||
|
title: res.message,
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
// 这里此提示会被this.start()方法中的提示覆盖
|
||||||
|
// this.$u.toast('验证码已发送');
|
||||||
|
// 通知验证码组件内部开始倒计时
|
||||||
|
this.$refs.uCode.start();
|
||||||
|
}, 100);
|
||||||
|
} else {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: res.message,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
// this.$u.toast('倒计时结束后再发送');
|
// this.$u.toast('倒计时结束后再发送');
|
||||||
console.log("倒计时结束后再发送");
|
// console.log("倒计时结束后再发送");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
end() {
|
end() {
|
||||||
this.$u.toast('倒计时结束');
|
// this.$u.toast('倒计时结束');
|
||||||
},
|
},
|
||||||
start() {
|
start() {
|
||||||
// this.$u.toast('倒计时开始');
|
// this.$u.toast('倒计时开始');
|
||||||
console.log(this.smslog_type)
|
// console.log(this.smslog_type)
|
||||||
// 倒计时请求
|
// 倒计时请求
|
||||||
this.$u.api.sendSmsCode({
|
|
||||||
member_mobile: this.member_mobile,
|
|
||||||
smslog_type: this.smslog_type
|
|
||||||
}).then((res) => {
|
|
||||||
console.log(res)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.fav_id'
|
:index='index'
|
||||||
:show="item.show"
|
:show="item.show"
|
||||||
:options="options"
|
:options="options"
|
||||||
@click="removeFavorite"
|
@click="removeFavorite"
|
||||||
@open="open"
|
@open="open"
|
||||||
>
|
>
|
||||||
<view class="item u-border-bottom">
|
<view class="item u-border-bottom" @click="viewGoodsDetails(item)">
|
||||||
<image :src="item.goods_image"></image>
|
<image :src="item.goods_image"></image>
|
||||||
<!-- 此层wrap在此为必写的,否则可能会出现标题定位错误 -->
|
<!-- 此层wrap在此为必写的,否则可能会出现标题定位错误 -->
|
||||||
<view class="title-wrap">
|
<view class="title-wrap">
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<view class="item-price">¥{{ item.favlog_price }}</view>
|
<view class="item-price">¥{{ item.favlog_price }}</view>
|
||||||
<view class="item-date">
|
<view class="item-date">
|
||||||
<image src="@/pageE/static/mine/26.png"></image>
|
<image src="@/pageE/static/mine/26.png"></image>
|
||||||
<view>{{ item.fav_time }}</view>
|
<view>{{ item.fav_time | date }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -31,7 +31,6 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [],
|
list: [],
|
||||||
show: false,
|
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
text: '删除',
|
text: '删除',
|
||||||
@@ -46,20 +45,38 @@ export default {
|
|||||||
this.getGoodsFavoritesList();
|
this.getGoodsFavoritesList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
viewGoodsDetails(item) {
|
||||||
|
const list = this.list.filter(item => {
|
||||||
|
return item.show;
|
||||||
|
})
|
||||||
|
if(list.length) return false;
|
||||||
|
this.$u.route({
|
||||||
|
url: 'pageB/sdetails/index',
|
||||||
|
params: {
|
||||||
|
id: item.fav_id,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
getGoodsFavoritesList() {
|
getGoodsFavoritesList() {
|
||||||
this.$u.api.getFavoritesList().then(res => {
|
this.$u.api.getFavoritesList().then(res => {
|
||||||
if(res.errCode == 0) {
|
if(res.errCode == 0) {
|
||||||
this.list = res.data;
|
this.list = res.data;
|
||||||
|
this.list.forEach(item => {
|
||||||
|
Object.assign(item, { show: false });
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
removeFavorite(id) {
|
removeFavorite(index) {
|
||||||
|
const id = this.list[index].fav_id;
|
||||||
this.$u.api.removeFavorite({
|
this.$u.api.removeFavorite({
|
||||||
id: id
|
fid: id,
|
||||||
|
type: 'goods'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.$u.toast(res.message);
|
|
||||||
if(res.errCode == 0) {
|
if(res.errCode == 0) {
|
||||||
this.getGoodsFavoritesList();
|
this.getGoodsFavoritesList();
|
||||||
|
} else {
|
||||||
|
this.$u.toast(res.message);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -70,6 +87,7 @@ export default {
|
|||||||
this.list.map((val, idx) => {
|
this.list.map((val, idx) => {
|
||||||
if(index != idx) this.list[idx].show = false;
|
if(index != idx) this.list[idx].show = false;
|
||||||
})
|
})
|
||||||
|
this.$forceUpdate();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -87,6 +105,7 @@ export default {
|
|||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
.title-wrap {
|
.title-wrap {
|
||||||
|
flex: 1;
|
||||||
.item-top {
|
.item-top {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: rgba(51,51,51,1);
|
color: rgba(51,51,51,1);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<view class="price">¥<span>{{ couponInfo.vouchertemplate_price }}</span></view>
|
<view class="price">¥<span>{{ couponInfo.vouchertemplate_price }}</span></view>
|
||||||
<view class="condition">满{{ couponInfo.vouchertemplate_limit }}使用</view>
|
<view class="condition">满{{ couponInfo.vouchertemplate_limit }}使用</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-store u-line-1">仅限{{ couponInfo.vouchertemplate_storename }}商品使用</view>
|
<view class="info-store u-line-1">仅限{{ couponInfo.type == 2 ? couponInfo.vouchertemplate_storename : '指定商品' }}使用</view>
|
||||||
<view class="info-integral">兑换积分:{{ couponInfo.vouchertemplate_points }}积分</view>
|
<view class="info-integral">兑换积分:{{ couponInfo.vouchertemplate_points }}积分</view>
|
||||||
<view class="info-date">有效期{{ couponInfo.vouchertemplate_startdate }}-{{ couponInfo.vouchertemplate_enddate }}</view>
|
<view class="info-date">有效期{{ couponInfo.vouchertemplate_startdate }}-{{ couponInfo.vouchertemplate_enddate }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<view class="price">¥<span>{{ couponInfo.voucher_price }}</span></view>
|
<view class="price">¥<span>{{ couponInfo.voucher_price }}</span></view>
|
||||||
<view class="condition">满{{ couponInfo.voucher_limit }}使用</view>
|
<view class="condition">满{{ couponInfo.voucher_limit }}使用</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-store u-line-1">仅限{{ couponInfo.type == 1 ? '平台' : couponInfo.store_name }}{{ couponInfo.gc_id | showClass(goodsClass) }}商品使用</view>
|
<view class="info-store u-line-1">仅限{{ couponInfo.type == 1 ? '指定商品' : couponInfo.store_name }}{{ couponInfo.gc_id | showClass(goodsClass) }}商品使用</view>
|
||||||
<view class="info-integral">兑换积分:{{ couponInfo.voucher_points }}积分</view>
|
<view class="info-integral">兑换积分:{{ couponInfo.voucher_points }}积分</view>
|
||||||
<view class="info-date">有效期{{ couponInfo.voucher_startdate }}-{{ couponInfo.voucher_enddate }}</view>
|
<view class="info-date">有效期{{ couponInfo.voucher_startdate }}-{{ couponInfo.voucher_enddate }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="order-item">
|
<view class="order-item" v-if="order.extend_store">
|
||||||
<view class="order-title">
|
<view class="order-title">
|
||||||
<view class="store-info">
|
<view class="store-info">
|
||||||
<image :src="order.extend_store.store_avatar"></image>
|
<image :src="order.extend_store.store_avatar"></image>
|
||||||
@@ -24,14 +24,14 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-btn" v-if="[1, 2, 3, 4, 8].indexOf(order.view_type) >= 0">
|
<view class="order-btn" v-if="[1, 2, 3, 4, 8, 9].indexOf(order.view_type) >= 0">
|
||||||
<!-- @click="toOtherPage('RefundOrder')" -->
|
<view class="cancel" v-if="(order.view_type == 3 || order.view_type == 2) && order.is_refund == 1" @click="toOtherPage('RefundOrder')">申请退款</view>
|
||||||
<view class="cancel" v-if="order.view_type == 3 || order.view_type == 2">申请退款</view>
|
|
||||||
<view class="cancel" v-if="order.view_type == 3" @click="toOtherPage('Logistics')">查看物流</view>
|
<view class="cancel" v-if="order.view_type == 3" @click="toOtherPage('Logistics')">查看物流</view>
|
||||||
<view class="logistics" v-if="order.view_type == 3" @click="confirmReceive">确认收货</view>
|
<view class="logistics" v-if="order.view_type == 3" @click="confirmReceive">确认收货</view>
|
||||||
<view class="comment" v-if="order.view_type == 4" @click="toOtherPage('Comment')">立即评价</view>
|
<view class="comment" v-if="order.view_type == 4" @click="toOtherPage('Comment')">立即评价</view>
|
||||||
<view class="cancel" v-if="order.view_type == 1" @click="cancelOrder">取消支付</view>
|
<view class="cancel" v-if="order.view_type == 1" @click="cancelOrder">取消支付</view>
|
||||||
<view class="payment" v-if="order.view_type == 1" @click="payNow(order.pay_sn, order.order_amount,order.order_id)">立即支付</view>
|
<view class="cancel" v-if="order.view_type == 9" @click="cancelOrder">取消订单</view>
|
||||||
|
<view class="payment" v-if="order.view_type == 1 || order.view_type == 9" @click="payNow(order.pay_sn, order.order_amount,order.order_id)">立即支付</view>
|
||||||
<view class="service" v-if="order.view_type == 8">联系官方客服</view>
|
<view class="service" v-if="order.view_type == 8">联系官方客服</view>
|
||||||
<view class="submit" v-if="order.view_type == 8">提交官方审核</view>
|
<view class="submit" v-if="order.view_type == 8">提交官方审核</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -48,7 +48,7 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
order: Object
|
order: Object
|
||||||
},
|
},
|
||||||
created() {
|
mounted() {
|
||||||
this.viewState();
|
this.viewState();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -82,6 +82,7 @@ export default {
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// console.log(state);
|
||||||
this.state = state;
|
this.state = state;
|
||||||
},
|
},
|
||||||
cancelOrder() {
|
cancelOrder() {
|
||||||
|
|||||||
@@ -177,7 +177,7 @@
|
|||||||
console.log('视频错误信息:',e);
|
console.log('视频错误信息:',e);
|
||||||
},
|
},
|
||||||
timeupdate(e) {
|
timeupdate(e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
},
|
},
|
||||||
getRandomColor: function() {
|
getRandomColor: function() {
|
||||||
const rgb = []
|
const rgb = []
|
||||||
@@ -187,19 +187,9 @@
|
|||||||
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();
|
||||||
@@ -215,7 +205,7 @@
|
|||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 100rpx;
|
bottom: 100rpx;
|
||||||
right: 30%;
|
right: 230rpx;
|
||||||
width: 300rpx;
|
width: 300rpx;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
line-height: 80rpx;
|
line-height: 80rpx;
|
||||||
@@ -307,17 +297,18 @@
|
|||||||
height: 560rpx;
|
height: 560rpx;
|
||||||
|
|
||||||
.protocol_content {
|
.protocol_content {
|
||||||
|
display: block;
|
||||||
width: 494rpx;
|
width: 494rpx;
|
||||||
height: 528rpx;
|
height: 528rpx;
|
||||||
|
margin: 10rpx auto 30rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: rgba(51, 51, 51, 1);
|
|
||||||
display: block;
|
|
||||||
text-align: left;
|
text-align: left;
|
||||||
margin: 80rpx auto 33rpx;
|
|
||||||
letter-spacing: 1rpx;
|
|
||||||
text-align: justify;
|
|
||||||
line-height: 36rpx;
|
line-height: 36rpx;
|
||||||
|
text-align: justify;
|
||||||
|
letter-spacing: 1rpx;
|
||||||
|
text-indent: 2rem;
|
||||||
|
color: rgba(51, 51, 51, 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,16 +2,22 @@
|
|||||||
<view class="group">
|
<view class="group">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<text>全部拼团</text>
|
<text>全部拼团</text>
|
||||||
<text @click="viewMore">查看更多></text>
|
<view class="more" @click="viewMore">
|
||||||
|
<text>查看更多</text>
|
||||||
|
<u-icon name="arrow-right" color="#999" size="22"></u-icon>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<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="60"></u-tabs-swiper> -->
|
||||||
|
<u-tabs :list="classifyList" name="gc_name" :is-scroll="true" :current="current" @change="tabsChange" active-color="#FF780F" :show-bar="false" height="60" font-size="24" inactive-color="#333333"></u-tabs>
|
||||||
</view>
|
</view>
|
||||||
<swiper :current="swiperCurrent" @animationfinish="animationfinish" style="height: 130px">
|
<swiper :current="swiperCurrent" @animationfinish="animationfinish" style="height: 340rpx;">
|
||||||
<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>
|
<view v-if="groupList[i]">
|
||||||
<u-empty text="暂无拼团商品" mode="list" color="#000" v-if="!groupList.length" style="margin: 0 auto;"></u-empty>
|
<sitem :info="info" v-for="(info, index) in groupList[i].slice(0, 3)" :key="index"></sitem>
|
||||||
|
</view>
|
||||||
|
<u-empty text="暂无拼团商品" mode="list" color="#000" v-if="!groupList[i] || !groupList[i].length" style="margin: 0 auto;"></u-empty>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
@@ -55,7 +61,9 @@ export default {
|
|||||||
page: 0,
|
page: 0,
|
||||||
gc_id: id,
|
gc_id: id,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.groupList = res.data;
|
this.groupList[this.current] = res.data;
|
||||||
|
// console.log(this.groupList);
|
||||||
|
this.$forceUpdate();
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
tabsChange(index) {
|
tabsChange(index) {
|
||||||
@@ -79,7 +87,7 @@ export default {
|
|||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
.top {
|
.top {
|
||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
height: 90rpx;
|
height:80rpx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -88,17 +96,19 @@ export default {
|
|||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
>text:last-child{
|
.more {
|
||||||
font-size: 18rpx;
|
font-size: 20rpx;
|
||||||
color: #999;
|
display: flex;
|
||||||
}
|
align-items: center;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.list {
|
.list {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
&:not(:nth-child(3n)) {
|
> view {
|
||||||
> view {
|
&:not(:nth-child(3n)) {
|
||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="item" @click="toDetailsPage">
|
<view class="item" @click="toDetailsPage">
|
||||||
<image class="head" :src="info.pintuan_image"></image>
|
<image class="head" :src="info.pintuan_image" mode="widthFix"></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>
|
||||||
@@ -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,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -44,11 +45,12 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.item{
|
.item{
|
||||||
width: 210rpx;
|
width: 220rpx;
|
||||||
overflow: hidden;
|
height: 100%;
|
||||||
|
// overflow: hidden;
|
||||||
.head{
|
.head{
|
||||||
width: 210rpx;
|
width: 100%;
|
||||||
height: 131rpx;
|
height: 180rpx;
|
||||||
border-radius: 6rpx;
|
border-radius: 6rpx;
|
||||||
}
|
}
|
||||||
.title{
|
.title{
|
||||||
@@ -66,7 +68,7 @@ export default {
|
|||||||
> view:first-child{
|
> view:first-child{
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: #FF3131;
|
color: #FF3131;
|
||||||
margin-bottom: 4rpx;
|
margin-bottom: 12rpx;
|
||||||
}
|
}
|
||||||
> view:last-child{
|
> view:last-child{
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
|
|||||||
@@ -2,18 +2,19 @@
|
|||||||
<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="26" :show-bar="false" @change="tabsChange" height="60"></u-tabs-swiper> -->
|
||||||
|
<u-tabs :list="classifyList" name="gc_name" :is-scroll="true" :current="current" @change="tabsChange" active-color="#FF780F" :show-bar="false" height="60" font-size="24" inactive-color="#333333"></u-tabs>
|
||||||
</view>
|
</view>
|
||||||
<swiper class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" :style="{height: swiperHeight}">
|
<swiper class="swiper-box" :current="swiperCurrent" @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">
|
||||||
<view class="goods-item">
|
<view class="goods-item">
|
||||||
<item v-for="item in goodsList" :key="item.goods_id" :info="item"></item>
|
<item v-for="item in goodsList[index]" :key="item.goods_id" :info="item"></item>
|
||||||
</view>
|
</view>
|
||||||
<u-empty text="暂无商品" mode="list" color="#000" v-if="!goodsList.length"></u-empty>
|
<u-empty text="暂无商品" mode="list" color="#000" margin-top="20" v-if="!goodsList[index] || !goodsList[index].length"></u-empty>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
<!-- 加载更多 -->
|
<!-- 加载更多 -->
|
||||||
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20" @loadmore="loadMore" v-if="goodsList.length>=pageSize"></u-loadmore>
|
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20" @loadmore="loadMore"></u-loadmore>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -22,7 +23,7 @@ export default {
|
|||||||
name:"list",
|
name:"list",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
pageSize: 12,
|
// pageSize: 12,
|
||||||
current: -1,
|
current: -1,
|
||||||
swiperCurrent: 0,
|
swiperCurrent: 0,
|
||||||
goodsList: [],
|
goodsList: [],
|
||||||
@@ -39,6 +40,7 @@ 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});
|
||||||
}
|
}
|
||||||
@@ -68,7 +70,7 @@ export default {
|
|||||||
this.page--;
|
this.page--;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getGoodsClassRecommend(gc_id) {
|
getGoodsClassRecommend() {
|
||||||
this.$u.api.getGoodsClassRecommend().then(res => {
|
this.$u.api.getGoodsClassRecommend().then(res => {
|
||||||
if (res.errCode == 0) {
|
if (res.errCode == 0) {
|
||||||
// 初始化 current
|
// 初始化 current
|
||||||
@@ -82,37 +84,36 @@ 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[this.current] = res.data.goodsList;
|
||||||
else this.goodsList.push(...res.data.goodsList);
|
else this.goodsList[this.current].push(...res.data.goodsList);
|
||||||
// console.log(this.goodsList);
|
// console.log(this.goodsList);
|
||||||
this.setSwiperHeight();
|
this.setSwiperHeight();
|
||||||
}
|
}
|
||||||
|
this.$forceUpdate();
|
||||||
return res.data.goodsList.length;
|
return res.data.goodsList.length;
|
||||||
},
|
},
|
||||||
setSwiperHeight() {
|
setSwiperHeight() {
|
||||||
// height: 230px, margin-bottom: 13
|
// height: 480rpx, margin-bottom: 26rpx
|
||||||
// const height = Math.ceil(this.goodsList.length / 2) * (510 + 26);
|
const height = Math.ceil(this.goodsList[this.current].length / 2) * (480 + 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';
|
// console.log(this.swiperHeight);
|
||||||
},
|
},
|
||||||
// tabs通知swiper切换
|
// tabs通知swiper切换
|
||||||
tabsChange(index) {
|
tabsChange(index) {
|
||||||
this.swiperCurrent = index;
|
this.current = index;
|
||||||
},
|
this.swiperCurrent = this.current;
|
||||||
// swiper-item左右移动,通知tabs的滑块跟随移动
|
// this.getGoodsRecommend({ gc_id: this.classifyList[this.current].gc_id });
|
||||||
transition(e) {
|
|
||||||
let dx = e.detail.dx;
|
|
||||||
this.$refs.uTabs.setDx(dx);
|
|
||||||
},
|
},
|
||||||
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
|
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
|
||||||
// swiper滑动结束,分别设置tabs和swiper的状态
|
// swiper滑动结束,分别设置tabs和swiper的状态
|
||||||
animationfinish(e) {
|
animationfinish(e) {
|
||||||
let current = e.detail.current;
|
let current = e.detail.current;
|
||||||
this.$refs.uTabs.setFinishCurrent(current);
|
|
||||||
this.swiperCurrent = current;
|
|
||||||
this.current = current;
|
this.current = current;
|
||||||
|
this.swiperCurrent = current;
|
||||||
|
// this.getGoodsRecommend({ gc_id: this.classifyList[this.current].gc_id });
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -125,22 +126,22 @@ export default {
|
|||||||
};
|
};
|
||||||
.top {
|
.top {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
height: 90rpx;
|
height: 74rpx;
|
||||||
line-height: 90rpx;
|
line-height: 88rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
.swiper-box {
|
.swiper-box {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin-bottom: 10rpx;
|
padding-top: 20rpx;
|
||||||
.swiper-item {
|
.swiper-item {
|
||||||
height: 100%;
|
// height: 100%;
|
||||||
.goods-item {
|
.goods-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
// height: 100%;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<image :src="info.goods_image" mode="aspectFill" class="img"></image>
|
<image :src="info.goods_image" mode="aspectFill" class="img"></image>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<text class="title u-line-2">{{ info.goods_name }}</text>
|
<text class="title u-line-2">{{ info.goods_name }}</text>
|
||||||
<text class="jianjie u-line-1">{{ info.goods_advword }}</text>
|
<!-- <text class="jianjie u-line-1">{{ info.goods_advword }}</text> -->
|
||||||
<text class="price">¥{{ info.goods_price }}</text>
|
<text class="price">¥{{ info.goods_price }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -44,7 +44,7 @@ export default {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.item{
|
.item{
|
||||||
width: 330rpx;
|
width: 330rpx;
|
||||||
height: 510rpx;
|
height: 480rpx;
|
||||||
margin-bottom: 26rpx;
|
margin-bottom: 26rpx;
|
||||||
background-color: #f8f8f8;
|
background-color: #f8f8f8;
|
||||||
border-radius: 10rpx 10rpx 0rpx 0rpx;
|
border-radius: 10rpx 10rpx 0rpx 0rpx;
|
||||||
@@ -62,10 +62,12 @@ export default {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
.title{
|
.title{
|
||||||
line-height: 40rpx;
|
margin-bottom: 16rpx;
|
||||||
font-size: 30rpx;
|
font-size: 26rpx;
|
||||||
|
font-weight: 600;
|
||||||
|
height: 60rpx;
|
||||||
|
line-height: 30rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
margin-bottom: 13rpx;
|
|
||||||
}
|
}
|
||||||
.jianjie{
|
.jianjie{
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="recommend">
|
<view class="recommend">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<text>{{ type == 'spike' ? '今日秒杀推荐' : '今日拼团推荐' }}</text>
|
<text>今日秒杀推荐</text>
|
||||||
<text>点击查看更多></text>
|
<view class="more" @click="toOthersPage">
|
||||||
|
<text>查看更多</text>
|
||||||
|
<u-icon name="arrow-right" color="#999" size="22"></u-icon>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="connect">
|
<view class="connect" @click="toOthersPage">
|
||||||
<view class="time" v-if="type == 'spike'">
|
<view class="time" v-if="type == 'spike'">
|
||||||
<image src="/static/image/common/15.png"></image>
|
<image src="/static/image/common/15.png"></image>
|
||||||
<text>{{ info.groupbuy_starttime_histime }}</text>
|
<text>{{ info.groupbuy_starttime_histime }}</text>
|
||||||
@@ -32,12 +35,26 @@ export default {
|
|||||||
props: ['recommendData', 'type'],
|
props: ['recommendData', 'type'],
|
||||||
created() {
|
created() {
|
||||||
this.info = this.recommendData;
|
this.info = this.recommendData;
|
||||||
// console.log(this.recommendData);
|
console.log(this.recommendData);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
toOthersPage() {
|
||||||
|
this.$u.route({
|
||||||
|
url: 'pageB/sdetails/index',
|
||||||
|
params: {
|
||||||
|
id: this.recommendData.goods_id,
|
||||||
|
// type: 3,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.recommend{
|
.recommend{
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
.top{
|
.top{
|
||||||
height: 90rpx;
|
height: 90rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -47,12 +64,15 @@ export default {
|
|||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
>text:last-child{
|
.more {
|
||||||
font-size: 18rpx;
|
display: flex;
|
||||||
color: #999;
|
align-items: center;
|
||||||
}
|
color: #999;
|
||||||
|
font-size: 20rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.connect{
|
.connect{
|
||||||
|
padding: 15rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
.time{
|
.time{
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -2,7 +2,10 @@
|
|||||||
<view class="recommend">
|
<view class="recommend">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<text>今日拼团推荐</text>
|
<text>今日拼团推荐</text>
|
||||||
<text @click="toDetailsPage">点击查看更多></text>
|
<view class="more" @click="toDetailsPage">
|
||||||
|
<text>查看详情</text>
|
||||||
|
<u-icon name="arrow-right" color="#999" size="22"></u-icon>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="connect">
|
<view class="connect">
|
||||||
<view class="user">
|
<view class="user">
|
||||||
@@ -20,7 +23,7 @@
|
|||||||
<text>¥{{ info.goods_price }}</text>
|
<text>¥{{ info.goods_price }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<image class="img" :src="info.pintuan_image" @click="toDetailsPage"></image>
|
<image class="img" :src="info.pintuan_image" @click="toDetailsPage" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -57,8 +60,9 @@ export default {
|
|||||||
this.$u.route({
|
this.$u.route({
|
||||||
url: 'pageB/sdetails/index',
|
url: 'pageB/sdetails/index',
|
||||||
params: {
|
params: {
|
||||||
id: this.recommendData.pintuan_id,
|
// id: this.recommendData.pintuan_id,
|
||||||
type: 2,
|
id: this.recommendData.groupbuy_id,
|
||||||
|
// type: 2,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -66,7 +70,7 @@ export default {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.recommend{
|
.recommend {
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
@@ -79,13 +83,15 @@ export default {
|
|||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
>text:last-child{
|
.more {
|
||||||
font-size: 18rpx;
|
display: flex;
|
||||||
color: #999;
|
align-items: center;
|
||||||
}
|
color: #999;
|
||||||
|
font-size: 20rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.connect{
|
.connect{
|
||||||
padding: 30rpx;
|
padding:10rpx 30rpx 30rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
.user {
|
.user {
|
||||||
@@ -153,10 +159,11 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.img{
|
.img{
|
||||||
width: 213rpx;
|
|
||||||
height: 160rpx;
|
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
margin-left: 13rpx;
|
width: 210rpx;
|
||||||
|
height: 200rpx;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
border-radius: 4rpx;
|
||||||
background-color: antiquewhite;
|
background-color: antiquewhite;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<text class="num">00</text>
|
<text class="num">00</text>
|
||||||
<text class="mah">:</text>
|
<text class="mah">:</text>
|
||||||
<text class="num">00</text>
|
<text class="num">00</text>
|
||||||
<text>-</text>
|
<text class="heng">-</text>
|
||||||
<text class="num">{{ time.bigHour }}</text>
|
<text class="num">{{ time.bigHour }}</text>
|
||||||
<text class="mah">:</text>
|
<text class="mah">:</text>
|
||||||
<text class="num">00</text>
|
<text class="num">00</text>
|
||||||
@@ -17,9 +17,10 @@
|
|||||||
<text class="num">00</text>
|
<text class="num">00</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="next" @click="viewMore">
|
<view class="next" @click="viewMore">
|
||||||
查看更多>
|
<text>查看更多</text>
|
||||||
</view>
|
<u-icon name="arrow-right" color="#999" size="18"></u-icon>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<sitem v-for="(item, index) in list.slice(0, 3)" :key="index" :item="item"></sitem>
|
<sitem v-for="(item, index) in list.slice(0, 3)" :key="index" :item="item"></sitem>
|
||||||
@@ -46,10 +47,10 @@ export default {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.seckill{
|
.seckill{
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 30rpx;
|
padding: 0 30rpx 30rpx;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
.top{
|
.top{
|
||||||
height: 60rpx;
|
height: 90rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@@ -65,24 +66,36 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 20rpx;
|
font-size: 20rpx;
|
||||||
|
.heng {
|
||||||
|
margin: 0 6rpx;
|
||||||
|
}
|
||||||
.num{
|
.num{
|
||||||
box-sizing: content-box;
|
|
||||||
width: 25rpx;
|
width: 25rpx;
|
||||||
height: 25rpx;
|
height: 25rpx;
|
||||||
background-color: #bfbfbf;
|
padding: 2rpx 4rpx;
|
||||||
margin: 0 10rpx;
|
margin: 0 6rpx;
|
||||||
padding: 2rpx;
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 25rpx;
|
||||||
|
border-radius: 4rpx;
|
||||||
|
box-sizing: content-box;
|
||||||
|
background-color: #000;
|
||||||
|
}
|
||||||
|
.mah {
|
||||||
|
vertical-align: text-top;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.next{
|
.next{
|
||||||
font-size: 18rpx;
|
font-size: 20rpx;
|
||||||
color: #999;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
color: #999;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.list{
|
.list{
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
// justify-content: space-between;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="item" @click="spikeGoods">
|
<view class="item" @click="spikeGoods">
|
||||||
<image class="head" :src="item.groupbuy_image1"></image>
|
<image class="head" :src="item.groupbuy_image1" mode="aspectFill"></image>
|
||||||
<text class="title u-line-2">{{ item.goods_name }}</text>
|
<text class="title u-line-2">{{ item.goods_name }}</text>
|
||||||
<view class="price">
|
<view class="price">
|
||||||
<text>¥{{ item.groupbuy_price }}</text>
|
<text>¥{{ item.groupbuy_price }}</text>
|
||||||
<text class="origin">¥{{ item.goods_price }}</text>
|
<text class="origin">¥{{ item.goods_price }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="info">
|
<view class="info" v-if="0">
|
||||||
<text>剩余{{ item.inventory | formatValue }}件</text>
|
<text>剩余{{ item.inventory | formatValue }}件</text>
|
||||||
<text>立即购买</text>
|
<text>立即购买</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -45,8 +45,9 @@ export default {
|
|||||||
this.$u.route({
|
this.$u.route({
|
||||||
url: 'pageB/sdetails/index',
|
url: 'pageB/sdetails/index',
|
||||||
params: {
|
params: {
|
||||||
id: this.item.groupbuy_id,
|
// id: this.item.groupbuy_id,
|
||||||
type: 3,
|
id: this.item.goods_id,
|
||||||
|
// type: 3,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -55,23 +56,28 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.item{
|
.item{
|
||||||
width: 220rpx;
|
width: 30%;
|
||||||
|
margin-right: 50rpx;
|
||||||
.head{
|
.head{
|
||||||
width: 210rpx;
|
width: 100%;
|
||||||
height: 131rpx;
|
height: 210rpx;
|
||||||
border-radius: 6rpx;
|
border-radius: 6rpx;
|
||||||
background-color: antiquewhite;
|
background-color: antiquewhite;
|
||||||
}
|
}
|
||||||
.title{
|
.title{
|
||||||
|
width: 200rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
margin-top: 6rpx;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
|
line-height: 30rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
margin-top: 16rpx;
|
-webkit-line-clamp: 1 !important;
|
||||||
}
|
}
|
||||||
.price{
|
.price{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-top: 19rpx;
|
margin-top: 10rpx;
|
||||||
>text:first-child{
|
>text:first-child{
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: #FF3131;
|
color: #FF3131;
|
||||||
@@ -88,7 +94,7 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
font-size: 20rpx;
|
font-size: 20rpx;
|
||||||
margin-top: 19rpx;
|
margin-top: 10rpx;
|
||||||
>text:first-child{
|
>text:first-child{
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: 20%;
|
width: 20%;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom:34rpx;
|
||||||
>image{
|
>image{
|
||||||
width: 80rpx;
|
width: 80rpx;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -61,8 +61,8 @@ export default {
|
|||||||
this.$u.route({
|
this.$u.route({
|
||||||
url: 'pageB/sdetails/index',
|
url: 'pageB/sdetails/index',
|
||||||
params: {
|
params: {
|
||||||
id: this.item.groupbuy_id,
|
id: this.item.goods_id,
|
||||||
type: 3,
|
// type: 3,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -85,8 +85,8 @@ export default {
|
|||||||
this.$u.route({
|
this.$u.route({
|
||||||
url: 'pageB/sdetails/index',
|
url: 'pageB/sdetails/index',
|
||||||
params: {
|
params: {
|
||||||
id: this.item.pintuan_id,
|
id: this.item.pintuan_goods_id,
|
||||||
type: 2,
|
// type: 2,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,15 +4,18 @@
|
|||||||
<view class="title">全部优惠券</view>
|
<view class="title">全部优惠券</view>
|
||||||
<view class="view-more" @click="toCouponPage">查看更多></view>
|
<view class="view-more" @click="toCouponPage">查看更多></view>
|
||||||
</view>
|
</view>
|
||||||
<u-tabs-swiper ref="coupon" :list="couponGroupList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="couponCurrent" font-size="24" :show-bar="false" @change="couponTabsChange" height="88" ></u-tabs-swiper>
|
<!-- <u-tabs-swiper ref="coupon" :list="couponGroupList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="couponCurrent" font-size="24" :show-bar="false" @change="couponTabsChange" height="60" ></u-tabs-swiper> -->
|
||||||
|
<u-tabs :list="couponGroupList" name="gc_name" :is-scroll="true" :current="couponCurrent" @change="couponTabsChange" active-color="#FF780F" :show-bar="false" height="60" font-size="24" inactive-color="#333333"></u-tabs>
|
||||||
<!-- :style="{ height: swiperHeight }" -->
|
<!-- :style="{ height: swiperHeight }" -->
|
||||||
<swiper :current="swiperCouponCurrent" @animationfinish="couponAnimationFinish" :style="{height: swiperHeight}">
|
<swiper class="box" :current="swiperCouponCurrent" @animationfinish="couponAnimationFinish" :style="{height: swiperHeight}">
|
||||||
<swiper-item class="swiper-coupon-item" v-for="(_, i) in couponGroupList" :key="i">
|
<swiper-item class="swiper-coupon-item" v-for="(_, i) in couponGroupList" :key="i">
|
||||||
<!-- 最多显示四个 -->
|
<!-- 最多显示四个 -->
|
||||||
<view v-for="(coupon, index) in couponList.slice(0, 4)" :key="index" class="coupon-item">
|
<view v-if="couponList[i]">
|
||||||
<Coupon :couponInfo="coupon" :status='0' :type="0"></Coupon>
|
<view v-for="(coupon, index) in couponList[i].slice(0, 4)" :key="index" class="coupon-item">
|
||||||
|
<Coupon :couponInfo="coupon" :status='0' :type="0"></Coupon>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<u-empty text="暂无优惠券" mode="coupon" color="#000" v-if="!couponList.length"></u-empty>
|
<u-empty text="暂无优惠券" mode="coupon" color="#000" v-if="!couponList[i] || !couponList[i].length"></u-empty>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
@@ -56,16 +59,18 @@ export default {
|
|||||||
gc_id: gc_id,
|
gc_id: gc_id,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if(res.errCode == 0) {
|
if(res.errCode == 0) {
|
||||||
this.couponList = res.data;
|
this.couponList[this.couponCurrent] = res.data;
|
||||||
} else {
|
} else {
|
||||||
this.couponList = [];
|
this.couponList[this.couponCurrent] = [];
|
||||||
}
|
}
|
||||||
// 设置 swiper 高度
|
// 设置 swiper 高度
|
||||||
this.setViewHeight();
|
this.setViewHeight();
|
||||||
|
this.$forceUpdate();
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
couponTabsChange(index) {
|
couponTabsChange(index) {
|
||||||
this.couponCurrent = index;
|
this.couponCurrent = index;
|
||||||
|
this.swiperCouponCurrent = this.couponCurrent;
|
||||||
},
|
},
|
||||||
couponAnimationFinish(e) {
|
couponAnimationFinish(e) {
|
||||||
const current = e.detail.current;
|
const current = e.detail.current;
|
||||||
@@ -75,8 +80,8 @@ export default {
|
|||||||
setViewHeight() {
|
setViewHeight() {
|
||||||
// 一个优惠券的高度 97px, 下距离 10px
|
// 一个优惠券的高度 97px, 下距离 10px
|
||||||
let num = 0;
|
let num = 0;
|
||||||
num = this.couponList.length
|
num = this.couponList[this.couponCurrent].length
|
||||||
? this.couponList.length > 4 ? 4 : this.couponList.length
|
? this.couponList[this.couponCurrent].length > 4 ? 4 : this.couponList[this.couponCurrent].length
|
||||||
: 1
|
: 1
|
||||||
this.swiperHeight = (200 + 20) * num + 'rpx';
|
this.swiperHeight = (200 + 20) * num + 'rpx';
|
||||||
},
|
},
|
||||||
@@ -97,7 +102,7 @@ export default {
|
|||||||
margin-bottom: 40rpx;
|
margin-bottom: 40rpx;
|
||||||
.top {
|
.top {
|
||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
height: 90rpx;
|
height: 80rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@@ -107,18 +112,21 @@ export default {
|
|||||||
color: rgba(51,51,51,1);
|
color: rgba(51,51,51,1);
|
||||||
}
|
}
|
||||||
.view-more {
|
.view-more {
|
||||||
font-size: 18rpx;
|
font-size: 20rpx;
|
||||||
color: rgba(153,153,153,1);
|
color: rgba(153,153,153,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.swiper-coupon-item {
|
.box {
|
||||||
padding: 0 30rpx;
|
padding-top: 20rpx;
|
||||||
box-sizing: border-box;
|
.swiper-coupon-item {
|
||||||
background-color: #ffffff;
|
padding: 0 30rpx;
|
||||||
.coupon-item {
|
box-sizing: border-box;
|
||||||
height: 200rpx;
|
background-color: #ffffff;
|
||||||
margin-bottom: 20rpx;
|
.coupon-item {
|
||||||
}
|
height: 200rpx;
|
||||||
}
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -23,7 +23,6 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
type_logines(){
|
type_logines(){
|
||||||
console.log("2345")
|
|
||||||
this.show = this.type_login
|
this.show = this.type_login
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
5
package-lock.json
generated
@@ -4,6 +4,11 @@
|
|||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"blueimp-md5": {
|
||||||
|
"version": "2.17.0",
|
||||||
|
"resolved": "https://registry.npm.taobao.org/blueimp-md5/download/blueimp-md5-2.17.0.tgz?cache=0&sync_timestamp=1595922448921&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fblueimp-md5%2Fdownload%2Fblueimp-md5-2.17.0.tgz",
|
||||||
|
"integrity": "sha1-9PysCIsRX3tARfGfXaWenQGxu5Y="
|
||||||
|
},
|
||||||
"uview-ui": {
|
"uview-ui": {
|
||||||
"version": "1.5.0",
|
"version": "1.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-1.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-1.5.0.tgz",
|
||||||
|
|||||||
@@ -11,9 +11,10 @@
|
|||||||
"url": "http://git.luyuan.tk/luyuan/deming.git"
|
"url": "http://git.luyuan.tk/luyuan/deming.git"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"uview-ui": "^1.5.0",
|
"blueimp-md5": "^2.17.0",
|
||||||
|
"uview-ui": "^1.5.0",
|
||||||
"vuex": "^3.5.1"
|
"vuex": "^3.5.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,9 +18,9 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 服务协议 -->
|
<!-- 服务协议 -->
|
||||||
<view class="pact">
|
<view class="pact" v-if="0">
|
||||||
<view>
|
<view>
|
||||||
<view></view>
|
<view style="padding-bottom: 10px;"></view>
|
||||||
<text>我已详细阅读并同意</text>
|
<text>我已详细阅读并同意</text>
|
||||||
<text class="pact_text" v-for="(item,index) in pact_text" :key="index" @click="pact_click(index)"> {{item.text}}
|
<text class="pact_text" v-for="(item,index) in pact_text" :key="index" @click="pact_click(index)"> {{item.text}}
|
||||||
</text>
|
</text>
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
// 数据的请求
|
// 数据的请求
|
||||||
this.apiwelcome();
|
// this.apiwelcome();
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
let pages = getCurrentPages();
|
let pages = getCurrentPages();
|
||||||
@@ -123,7 +123,9 @@
|
|||||||
...mapMutations(['loginIn']),
|
...mapMutations(['loginIn']),
|
||||||
apiwelcome() {
|
apiwelcome() {
|
||||||
this.$u.api.sendSmsCode({}).then((res) => {
|
this.$u.api.sendSmsCode({}).then((res) => {
|
||||||
console.log(res)
|
if (res.errCode == 0) {
|
||||||
|
console.log(res)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 协议跳转
|
// 协议跳转
|
||||||
@@ -148,21 +150,18 @@
|
|||||||
if (this.member_mobile == '') {
|
if (this.member_mobile == '') {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: '手机号不能为空',
|
title: '手机号不能为空',
|
||||||
type: 'error'
|
|
||||||
})
|
})
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (type_phone == false) {
|
if (type_phone == false) {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: '手机号格式不正确',
|
title: '手机号格式不正确',
|
||||||
type: 'error'
|
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.sms_code == '') {
|
if (this.sms_code == '') {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: '验证码不能为空',
|
title: '验证码不能为空',
|
||||||
type: 'error'
|
|
||||||
})
|
})
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -176,14 +175,12 @@
|
|||||||
if (res.data == '') {
|
if (res.data == '') {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: res.message,
|
title: res.message,
|
||||||
type: 'error'
|
|
||||||
})
|
})
|
||||||
return false
|
return false
|
||||||
} else {
|
} else {
|
||||||
me.loginIn(res.data.token); //存储一个字符传值
|
me.loginIn(res.data.token); //存储一个字符传值
|
||||||
// 缓存用户的信息
|
// 缓存用户的信息
|
||||||
uni.setStorageSync('user_info',res.data);
|
uni.setStorageSync('user_info',res.data);
|
||||||
|
|
||||||
if (res.data.member.has_labels) {
|
if (res.data.member.has_labels) {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '/pages/index/index'
|
url: '/pages/index/index'
|
||||||
@@ -205,7 +202,6 @@
|
|||||||
} else {
|
} else {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: res.message,
|
title: res.message,
|
||||||
type: 'error'
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -432,6 +428,7 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
padding-left: 40rpx;
|
padding-left: 40rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
padding-bottom:10px
|
||||||
// overflow: hidden; //超出的文本隐藏
|
// overflow: hidden; //超出的文本隐藏
|
||||||
// text-overflow: ellipsis; //溢出用省略号显示
|
// text-overflow: ellipsis; //溢出用省略号显示
|
||||||
// white-space: nowrap; //溢出不换行
|
// white-space: nowrap; //溢出不换行
|
||||||
|
|||||||
@@ -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,16 +28,22 @@ export default {
|
|||||||
this.$u.api.documentInfo({
|
this.$u.api.documentInfo({
|
||||||
document_code: 'agreement'
|
document_code: 'agreement'
|
||||||
}).then((res)=>{
|
}).then((res)=>{
|
||||||
console.log(res)
|
// console.log(res.data.document_title);
|
||||||
|
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)
|
// console.log(res.data.document_title);
|
||||||
|
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
|
||||||
})
|
})
|
||||||
@@ -46,7 +52,10 @@ export default {
|
|||||||
this.$u.api.documentInfo({
|
this.$u.api.documentInfo({
|
||||||
document_code: 'use'
|
document_code: 'use'
|
||||||
}).then((res)=>{
|
}).then((res)=>{
|
||||||
console.log(res)
|
// console.log(res.data.document_title);
|
||||||
|
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
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
value: '',
|
value: '',
|
||||||
login: '注册',
|
login: '注册',
|
||||||
show: false,
|
show: false,
|
||||||
is_check: null,
|
is_check: true,
|
||||||
member_mobile: '', //手机号
|
member_mobile: '', //手机号
|
||||||
smslog_type : '1',//状态
|
smslog_type : '1',//状态
|
||||||
sms_code : '', //验证码
|
sms_code : '', //验证码
|
||||||
@@ -104,33 +104,30 @@
|
|||||||
},
|
},
|
||||||
// 用户注册
|
// 用户注册
|
||||||
loginIns(){
|
loginIns(){
|
||||||
|
console.log(this.is_check);
|
||||||
let me = this;
|
let me = this;
|
||||||
let type_phone = this.$u.test.mobile( this.member_mobile)
|
let type_phone = this.$u.test.mobile(this.member_mobile)
|
||||||
if( this.member_mobile == ''){
|
if(this.member_mobile == ''){
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: '手机号不能为空!',
|
title: '手机号不能为空!',
|
||||||
type: 'error'
|
|
||||||
})
|
})
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (type_phone == false) {
|
if (type_phone == false) {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: '手机号格式不正确!',
|
title: '手机号格式不正确!',
|
||||||
type: 'error'
|
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if( this.sms_code == ''){
|
if(this.sms_code == ''){
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: '验证码不能为空!',
|
title: '验证码不能为空!',
|
||||||
type: 'error'
|
|
||||||
})
|
})
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.is_check) {
|
if (!this.is_check) {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: '请同意协议!',
|
title: '请同意协议!',
|
||||||
type: 'error'
|
|
||||||
})
|
})
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -138,10 +135,6 @@
|
|||||||
member_mobile: this.member_mobile,
|
member_mobile: this.member_mobile,
|
||||||
sms_code: this.sms_code
|
sms_code: this.sms_code
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log('3333333333',res);
|
|
||||||
// 校验手机号
|
|
||||||
|
|
||||||
// console.log(res)
|
|
||||||
if(res.errCode == 0){
|
if(res.errCode == 0){
|
||||||
//存储一个字符传值
|
//存储一个字符传值
|
||||||
me.loginIn(res.data.token);
|
me.loginIn(res.data.token);
|
||||||
@@ -159,20 +152,11 @@
|
|||||||
// type: 'success',
|
// type: 'success',
|
||||||
// url: '/pageA/topick/topick'
|
// url: '/pageA/topick/topick'
|
||||||
// })
|
// })
|
||||||
}
|
} else {
|
||||||
if(res.errCode == 1){
|
this.$refs.uToast.show({
|
||||||
this.$refs.uToast.show({
|
title: res.message,
|
||||||
title: res.message,
|
})
|
||||||
type: 'error'
|
}
|
||||||
})
|
|
||||||
}
|
|
||||||
if(res.errCode == 2){
|
|
||||||
this.$refs.uToast.show({
|
|
||||||
title: res.message,
|
|
||||||
type: 'primary',
|
|
||||||
url: '/pageA/login/login'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 选中某个复选框时,由checkbox时触发
|
// 选中某个复选框时,由checkbox时触发
|
||||||
@@ -196,7 +180,6 @@
|
|||||||
// console.log("调用父组件的方法")
|
// console.log("调用父组件的方法")
|
||||||
// console.log('2222',this._data.member_mobile)
|
// console.log('2222',this._data.member_mobile)
|
||||||
let member_mobile = this._data.member_mobile;
|
let member_mobile = this._data.member_mobile;
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -457,10 +440,6 @@
|
|||||||
.pact {
|
.pact {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-left: 40rpx;
|
padding-left: 40rpx;
|
||||||
overflow: hidden;
|
|
||||||
// overflow: hidden; //超出的文本隐藏
|
|
||||||
// text-overflow: ellipsis; //溢出用省略号显示
|
|
||||||
// white-space: nowrap; //溢出不换行
|
|
||||||
}
|
}
|
||||||
.phones{
|
.phones{
|
||||||
margin-bottom: 90rpx!important;
|
margin-bottom: 90rpx!important;
|
||||||
|
|||||||
@@ -1,27 +1,35 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="userinfo">
|
<view class="userinfo">
|
||||||
|
|
||||||
<view class="user">
|
<view class="user">
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<image></image>
|
<view class="avatar">
|
||||||
<view>
|
<image :src="item.member_avatar" mode="aspectFill"></image>
|
||||||
<text>达人昵称</text>
|
<view class="posi-type">
|
||||||
<text>关注数量</text>
|
<view>
|
||||||
|
<u-icon name="play-right-fill" color="#fff" size="20rpx"></u-icon>
|
||||||
|
</view>
|
||||||
|
<text>正在直播</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="box">
|
||||||
|
<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="guanzhu">关注</view>
|
<view class="btn" :class="[ is_follow ? 'btn-follow' : 'btn-unfollow' ]" @click="following">{{ is_follow ? "已关注" : "关注" }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="profile">个性签名</view>
|
<view class="profile" :class="{'u-line-2': is_open }" @click="openPro">
|
||||||
|
个性签名:{{ 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;
|
||||||
@@ -31,53 +39,120 @@ image{
|
|||||||
.info{
|
.info{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
>image{
|
.avatar {
|
||||||
width: 140rpx;
|
position: relative;
|
||||||
height: 140rpx;
|
&>image{
|
||||||
border-radius: 50%;
|
z-index: 99;
|
||||||
|
width: 140rpx;
|
||||||
|
height: 140rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
.posi-type {
|
||||||
|
z-index: 100;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
background-color: rgba(0,0,0,0.3);
|
||||||
|
& > view {
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 30rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: rgba(0,0,0,0.5);
|
||||||
|
}
|
||||||
|
& > text {
|
||||||
|
padding: 0 12rpx 0 6rpx;
|
||||||
|
color: #FF3131;
|
||||||
|
height: 40rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
font-size: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
>view{
|
.box {
|
||||||
margin-left: 40rpx;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 79rpx;
|
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
>text:first-child{
|
height: 79rpx;
|
||||||
|
margin-left: 40rpx;
|
||||||
|
color: #333;
|
||||||
|
.name {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color:#333;
|
|
||||||
}
|
}
|
||||||
>text:last-child{
|
.num {
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #333;
|
& > :first-child {
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.guanzhu{
|
.btn{
|
||||||
width: 140rpx;
|
width: 140rpx;
|
||||||
height: 60rpx;
|
height: 60rpx;
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color:#fff;
|
|
||||||
line-height: 60rpx;
|
line-height: 60rpx;
|
||||||
border-radius: 30rpx;
|
|
||||||
background-color: #FF780F;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
color:#fff;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
}
|
||||||
|
.btn-follow {
|
||||||
|
background-color: #999999;
|
||||||
|
}
|
||||||
|
.btn-unfollow {
|
||||||
|
background-color: #FF780F;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.profile{
|
.profile{
|
||||||
margin-top: 19rpx;
|
margin-top: 20rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
margin-left: 14rpx;
|
line-height: 1.2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</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);
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border-radius: 6rpx;
|
border-radius: 6rpx;
|
||||||
margin-right: 26rpx;
|
margin-right: 26rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
}
|
}
|
||||||
.xuanzhong{
|
.xuanzhong{
|
||||||
border: #ff780f 1rpx solid;
|
border: #ff780f 1rpx solid;
|
||||||
@@ -56,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,155 +1,232 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="userinfo">
|
<view class="userinfo">
|
||||||
<view class="userhead">
|
<view class="userhead">
|
||||||
<image :src="item.member_avatar"></image>
|
<image class="avatar" :src="item.member_avatar"></image>
|
||||||
<text class="follow" v-if="!is_follow" @click="following(item.member_id)">+</text>
|
<text class="follow" @click="following(item.member_id)">{{ is_follow ? "✓" : "+" }}</text>
|
||||||
<u-icon v-else name="checkmark" color="#ffffff" :size="28" class="follow" @click="following(item.member_id)"></u-icon>
|
|
||||||
</view>
|
</view>
|
||||||
<!-- 点赞 -->
|
<!-- 点赞 -->
|
||||||
<view class="operat zan">
|
<view class="operat zan">
|
||||||
<u-icon name="thumb-up-fill" :color=" is_like ? '#FF7807' : '#ffffff' " :size="50" @click="likeType(item.article_id)"></u-icon>
|
<image class="operat-img" :src=" is_like ? '../../static/image/userinfo/dianzan1.png' : '../../static/image/userinfo/dianzan.png' "
|
||||||
<text>{{item.like_num}}</text>
|
mode="" @click="likeType(item.article_id)"></image>
|
||||||
|
<text class="operat-span">{{item.like_num}}</text>
|
||||||
</view>
|
</view>
|
||||||
<!-- 收藏 -->
|
<!-- 收藏 -->
|
||||||
<view class="operat shoucang">
|
<view class="operat shoucang">
|
||||||
<u-icon name="star-fill" :color=" is_collect ? '#FF7807' : '#ffffff' " :size="50" @click="collecting(item.article_id)"></u-icon>
|
<image class="operat-img" :src=" is_collect ? '../../static/image/userinfo/shoucang1.png' : '../../static/image/userinfo/shoucang.png' "
|
||||||
<text>{{item.collect_num}}</text>
|
mode="" @click="collecting(item.article_id)"></image>
|
||||||
|
<text class="operat-span">{{item.collect_num}}</text>
|
||||||
</view>
|
</view>
|
||||||
<!-- 评论 -->
|
<!-- 评论 -->
|
||||||
<view class="operat pinglun">
|
<view class="operat pinglun">
|
||||||
<u-icon name="more-circle-fill" :color=" is_content ? '#FF7807' : '#ffffff' " :size="50" @click="editing()"></u-icon>
|
<image class="operat-img" :src=" is_content ? '../../static/image/userinfo/pinglun1.png' : '../../static/image/userinfo/pinglun.png' "
|
||||||
<text>{{item.comment_num}}</text>
|
mode="" @click="editing(item.article_id)"></image>
|
||||||
|
<text class="operat-span">{{ comment_num }}</text>
|
||||||
</view>
|
</view>
|
||||||
<!-- 购物车 -->
|
<!-- 购物车 -->
|
||||||
<view class="operat gouwu">
|
<view class="operat gouwu">
|
||||||
<u-icon name="shopping-cart-fill" :color=" is_cart ? '#FF7807' : '#ffffff' " :size="50" @click="carting()"></u-icon>
|
<image class="operat-img" :src=" is_cart ? '../../static/image/userinfo/gouwuche1.png' : '../../static/image/userinfo/gouwuche.png' "
|
||||||
|
mode="" @click="carting()"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.userinfo{
|
.userinfo {
|
||||||
width: 110rpx;
|
width: 110rpx;
|
||||||
height: 570rpx;
|
height: 570rpx;
|
||||||
display: flex;
|
/* #ifndef APP-PLUS-NVUE */
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
.userhead{
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
position: relative;
|
/* #endif */
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
&>image{
|
|
||||||
width: 110rpx;
|
|
||||||
height: 110rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
border: 2rpx solid #fff;
|
|
||||||
}
|
|
||||||
.follow {
|
|
||||||
position: absolute;
|
|
||||||
top: 90rpx;
|
|
||||||
left: 35%;
|
|
||||||
width: 36rpx;
|
|
||||||
height: 36rpx;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 36rpx;
|
|
||||||
font-size: 36rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
color: #fff;
|
|
||||||
background-color: #FF780F;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.operat {
|
|
||||||
display: flex;
|
.userhead {
|
||||||
align-items: center;
|
position: relative;
|
||||||
flex-direction: column;
|
/* #ifndef APP-PLUS-NVUE */
|
||||||
& > text {
|
display: flex;
|
||||||
margin-top: 10rpx;
|
/* #endif */
|
||||||
font-size: 28rpx;
|
align-items: center;
|
||||||
color: #fff;
|
padding-bottom: 20rpx;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
.avatar {
|
||||||
|
width: 110rpx;
|
||||||
|
height: 110rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
/* #ifndef APP-PLUS-NVUE */
|
||||||
|
border: 2rpx solid #fff;
|
||||||
|
/* #endif */
|
||||||
|
}
|
||||||
|
|
||||||
|
.follow {
|
||||||
|
z-index: 100;
|
||||||
|
position: absolute;
|
||||||
|
top: 90rpx;
|
||||||
|
left: 40rpx;
|
||||||
|
width: 36rpx;
|
||||||
|
height: 36rpx;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 36rpx;
|
||||||
|
font-size: 34rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
color: #fff;
|
||||||
|
background-color: #FF780F;
|
||||||
|
}
|
||||||
|
|
||||||
|
.operat {
|
||||||
|
/* #ifndef APP-PLUS-NVUE */
|
||||||
|
display: flex;
|
||||||
|
/* #endif */
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.operat-span {
|
||||||
|
margin-top: 10rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.operat-img {
|
||||||
|
width: 50rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name:'userinfo',
|
name: 'userinfo',
|
||||||
props:['list','cart','comment'],
|
props: ['list', 'cart', 'comment', 'num'],
|
||||||
data(){
|
data() {
|
||||||
return {
|
return {
|
||||||
is_follow: this.list.is_attention || false,
|
is_follow: this.list.is_attention || false,
|
||||||
is_like: this.list.is_like || false,
|
is_like: this.list.is_like || false,
|
||||||
is_collect: this.list.is_collect || false,
|
is_collect: this.list.is_collect || false,
|
||||||
is_content: false,
|
is_content: false,
|
||||||
is_cart: false,
|
is_cart: false,
|
||||||
item: this.list || {}
|
comment_num: this.list.comment_num || 0,
|
||||||
|
item: this.list || {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
list(newValue, old) {
|
||||||
|
console.log(newValue);
|
||||||
|
this.item = newValue || {};
|
||||||
|
this.is_follow = this.list.is_attention || false;
|
||||||
|
this.is_like = this.list.is_like || false;
|
||||||
|
this.is_collect = this.list.is_collect || false;
|
||||||
|
this.comment_num = this.list.comment_num || 0;
|
||||||
|
},
|
||||||
|
cart(newValue, old) {
|
||||||
|
// console.log(newValue);
|
||||||
|
this.is_cart = newValue;
|
||||||
|
},
|
||||||
|
comment(newValue, old) {
|
||||||
|
// console.log(newValue,old);
|
||||||
|
this.is_content = newValue;
|
||||||
|
},
|
||||||
|
num(newVal, old) {
|
||||||
|
// console.log(newVal);
|
||||||
|
this.comment_num = newVal;
|
||||||
|
// this.item.comment_num = newVal;
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 关注
|
||||||
|
following(id) {
|
||||||
|
uni.request({
|
||||||
|
url: "https://dmmall.sdbairui.com/api/member/attentionMember",
|
||||||
|
method: "POST",
|
||||||
|
data: {
|
||||||
|
member_id: id
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
if (res.data.errCode == 0) {
|
||||||
|
this.is_follow = !this.is_follow;
|
||||||
|
console.log(this.is_follow);
|
||||||
|
uni.showToast({
|
||||||
|
title: res.data.message,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 点赞
|
||||||
|
likeType(id) {
|
||||||
|
// console.log(id);
|
||||||
|
uni.request({
|
||||||
|
url: "https://dmmall.sdbairui.com/api/article/articleLike",
|
||||||
|
method: "POST",
|
||||||
|
data: {
|
||||||
|
article_id: id
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res);
|
||||||
|
if (res.data.errCode == 0) {
|
||||||
|
// console.log(res);
|
||||||
|
this.is_like = !this.is_like;
|
||||||
|
this.list.like_num = res.data.data.num;
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.data.message,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 收藏
|
||||||
|
collecting(id) {
|
||||||
|
uni.request({
|
||||||
|
url: "https://dmmall.sdbairui.com/api/article/articleCollect",
|
||||||
|
method: "POST",
|
||||||
|
data: {
|
||||||
|
article_id: id
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res);
|
||||||
|
if (res.data.errCode == 0) {
|
||||||
|
console.log(res.data.num);
|
||||||
|
this.is_collect = !this.is_collect;
|
||||||
|
this.list.collect_num = res.data.data.num;
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.data.message,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 评论
|
||||||
|
editing() {
|
||||||
|
this.is_content = !this.is_content;
|
||||||
|
// console.log(this.is_content);
|
||||||
|
this.$emit("openCart", {
|
||||||
|
comment: this.is_content,
|
||||||
|
cart: this.is_cart
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 购物车
|
||||||
|
carting() {
|
||||||
|
this.is_cart = !this.is_cart;
|
||||||
|
// console.log(this.is_cart);
|
||||||
|
this.$emit("openCart", {
|
||||||
|
comment: this.is_content,
|
||||||
|
cart: this.is_cart
|
||||||
|
});
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
watch: {
|
</script>
|
||||||
list(newValue,old) {
|
|
||||||
// console.log(newValue,old);
|
|
||||||
this.item = newValue || {};
|
|
||||||
this.is_follow = this.list.is_attention || false;
|
|
||||||
this.is_like = this.list.is_like || false;
|
|
||||||
this.is_collect = this.list.is_collect || false;
|
|
||||||
},
|
|
||||||
cart(newValue,old) {
|
|
||||||
// console.log(newValue,old);
|
|
||||||
this.is_cart = newValue;
|
|
||||||
},
|
|
||||||
comment(newValue,old) {
|
|
||||||
// console.log(newValue,old);
|
|
||||||
this.is_content = newValue;
|
|
||||||
},
|
|
||||||
deep: true
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 关注
|
|
||||||
following(id) {
|
|
||||||
this.is_follow = !this.is_follow;
|
|
||||||
this.$u.api.attentionMember({member_id: id}).then(res => {
|
|
||||||
if (res.errCode == 0) {
|
|
||||||
this.$u.toast(res.message);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 点赞
|
|
||||||
likeType(id) {
|
|
||||||
// console.log(id);
|
|
||||||
this.is_like = !this.is_like;
|
|
||||||
this.$u.post("article/articleLike",{article_id: id}).then(res => {
|
|
||||||
if (res.errCode == 0) {
|
|
||||||
// console.log(res);
|
|
||||||
this.list.like_num = res.data.num;
|
|
||||||
} else {
|
|
||||||
this.$u.toast(res.message);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 收藏
|
|
||||||
collecting(id) {
|
|
||||||
this.is_collect = !this.is_collect;
|
|
||||||
this.$u.post("article/articleCollect",{article_id: id}).then(res => {
|
|
||||||
if (res.errCode == 0) {
|
|
||||||
// console.log(res);
|
|
||||||
this.list.collect_num = res.data.num;
|
|
||||||
} else {
|
|
||||||
this.$u.toast(res.message);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 评论
|
|
||||||
editing() {
|
|
||||||
this.is_content = !this.is_content;
|
|
||||||
// console.log(this.is_content);
|
|
||||||
this.$emit("openCart",{ comment: this.is_content, cart: this.is_cart});
|
|
||||||
},
|
|
||||||
// 购物车
|
|
||||||
carting() {
|
|
||||||
this.is_cart = !this.is_cart;
|
|
||||||
// console.log(this.is_cart);
|
|
||||||
this.$emit("openCart",{ comment: this.is_content, cart: this.is_cart});
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|||||||
253
pageB/coupon/details.vue
Normal file
@@ -0,0 +1,253 @@
|
|||||||
|
<template>
|
||||||
|
<view class="coupon-details">
|
||||||
|
<view class="coupon-container">
|
||||||
|
<view class="title">新人专享好礼</view>
|
||||||
|
<view class="coupon-main">
|
||||||
|
<image src="/static/image/common/29.png" class="bg"></image>
|
||||||
|
<view class="left">
|
||||||
|
<view class="price"><text class="sign">¥</text><text class="value">{{ price }}</text></view>
|
||||||
|
<view class="label">专属优惠券</view>
|
||||||
|
</view>
|
||||||
|
<view class="btn" @click="exchangeCoupon">立即领取</view>
|
||||||
|
</view>
|
||||||
|
<view class="tag">
|
||||||
|
<view>
|
||||||
|
<image src="/static/image/common/25.png"></image>
|
||||||
|
<text>全场包邮</text>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<image src="/static/image/common/26.png"></image>
|
||||||
|
<text>延误必赔</text>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<image src="/static/image/common/27.png"></image>
|
||||||
|
<text>免费上门取件</text>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<image src="/static/image/common/28.png"></image>
|
||||||
|
<text>退货免运费</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="title-container">
|
||||||
|
<image src="/static/image/common/22.png" class="bg"></image>
|
||||||
|
<view class="title">首席搭配师</view>
|
||||||
|
</view>
|
||||||
|
<view class="content-container">
|
||||||
|
<image src="/static/image/common/23.png" class="people"></image>
|
||||||
|
<view class="tag">
|
||||||
|
<view class="">双十一成交破亿</view>
|
||||||
|
<view class="">单场千万级大咖</view>
|
||||||
|
<view class="">品牌特卖TOP1</view>
|
||||||
|
</view>
|
||||||
|
<view class="btn">
|
||||||
|
<view class="bg-view"></view>
|
||||||
|
<view>我们有万能穿搭公式</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
price: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
this.price = option.price;
|
||||||
|
// this.isNewmembervoucher();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 是否显示新人优惠券
|
||||||
|
isNewmembervoucher() {
|
||||||
|
this.$u.api.isNewmembervoucher().then(res => {
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
this.price = res.data.price;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
exchangeCoupon() {
|
||||||
|
this.$u.api.getCoupon({ id: 1 }).then(res => {
|
||||||
|
this.$u.toast(res.message);
|
||||||
|
if(res.errCode == 0) {}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.coupon-details {
|
||||||
|
min-height: calc(100vh - var(--window-top));
|
||||||
|
background-color: #FFDFAC;
|
||||||
|
padding-top: 30rpx;
|
||||||
|
.coupon-container {
|
||||||
|
width: 690rpx;
|
||||||
|
height: 368rpx;
|
||||||
|
background: linear-gradient(-87deg, rgba(247,162,30,1), rgba(255,120,15,1));
|
||||||
|
box-shadow: 0rpx 4rpx 2rpx 0rpx rgba(102,102,102,0.2);
|
||||||
|
border-radius: 20rpx;
|
||||||
|
margin: 0 auto 70rpx;
|
||||||
|
padding: 22rpx {
|
||||||
|
top: 40rpx
|
||||||
|
};
|
||||||
|
.title {
|
||||||
|
font-size: 48rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: rgba(255,255,255,1);
|
||||||
|
line-height: 34rpx;
|
||||||
|
text-shadow: 0rpx 4rpx 2rpx rgba(102,102,102,0.2);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.coupon-main {
|
||||||
|
margin: 26rpx auto 20rpx;
|
||||||
|
width: 665rpx;
|
||||||
|
height: 194rpx;
|
||||||
|
position: relative;
|
||||||
|
.bg {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 665rpx;
|
||||||
|
height: 194rpx;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
.left {
|
||||||
|
z-index: 2;
|
||||||
|
position: absolute;
|
||||||
|
top: 40rpx;
|
||||||
|
left: 122rpx;
|
||||||
|
.price {
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
line-height: 80rpx;
|
||||||
|
> text {
|
||||||
|
font-weight: bold;
|
||||||
|
color: rgba(255,120,15,1);
|
||||||
|
}
|
||||||
|
.sign {
|
||||||
|
font-size: 54rpx;
|
||||||
|
}
|
||||||
|
.value {
|
||||||
|
font-size: 102rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.label {
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: rgba(255,120,15,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.btn {
|
||||||
|
z-index: 2;
|
||||||
|
position: absolute;
|
||||||
|
top: 62rpx;
|
||||||
|
right: 60rpx;
|
||||||
|
width: 192rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
background: linear-gradient(-87deg, rgba(247,162,30,1), rgba(255,120,15,1));
|
||||||
|
border-radius: 20rpx;
|
||||||
|
line-height: 70rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 27rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: rgba(255,255,255,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.tag {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 20rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: rgba(255,255,255,1);
|
||||||
|
> view {
|
||||||
|
> image {
|
||||||
|
width: 20rpx;
|
||||||
|
height: 20rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.title-container {
|
||||||
|
position: relative;
|
||||||
|
height: 124rpx;
|
||||||
|
.bg {
|
||||||
|
position: absolute;
|
||||||
|
width: 504rpx;
|
||||||
|
height: 124rpx;
|
||||||
|
z-index: 1;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -75%);
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 2;
|
||||||
|
width: 750rpx;
|
||||||
|
height: 59rpx;
|
||||||
|
background: rgba(255,255,255,0.27);
|
||||||
|
font-size: 60rpx;
|
||||||
|
font-weight: 800;
|
||||||
|
color: rgba(255,122,16,1);
|
||||||
|
text-align: center;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.content-container {
|
||||||
|
height: 684rpx;
|
||||||
|
position: relative;
|
||||||
|
.people {
|
||||||
|
width: 348rpx;
|
||||||
|
height: 684rpx;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, 0%);
|
||||||
|
}
|
||||||
|
.tag {
|
||||||
|
> view {
|
||||||
|
position: absolute;
|
||||||
|
height: 48rpx;
|
||||||
|
background: rgba(229,0,79,0.36);
|
||||||
|
border-radius: 20rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: rgba(255,255,255,1);
|
||||||
|
line-height: 48rpx;
|
||||||
|
padding: 0 24rpx;
|
||||||
|
&:nth-child(1) {
|
||||||
|
top: 104rpx;
|
||||||
|
right: 71rpx;
|
||||||
|
}
|
||||||
|
&:nth-child(2) {
|
||||||
|
top: 271rpx;
|
||||||
|
left: 30rpx;
|
||||||
|
}
|
||||||
|
&:nth-child(3) {
|
||||||
|
top: 373rpx;
|
||||||
|
right: 33rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.btn {
|
||||||
|
position: absolute;
|
||||||
|
top: 459rpx;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, 0%);
|
||||||
|
width: 581rpx;
|
||||||
|
height: 86rpx;
|
||||||
|
background: linear-gradient(-87deg,rgba(247,162,30,1),rgba(255,120,15,1));
|
||||||
|
border-radius: 20rpx;
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
color: rgba(255,255,255,1);
|
||||||
|
line-height: 86rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -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></userinfo>
|
<userinfo :list="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,39 +13,15 @@
|
|||||||
}"
|
}"
|
||||||
:bold="false"
|
:bold="false"
|
||||||
@change="dianji"
|
@change="dianji"
|
||||||
:show-bar="false"></u-tabs>
|
:show-bar="false">
|
||||||
<swiper class="card" @change="dianji" :current="num">
|
</u-tabs>
|
||||||
<swiper-item>
|
<scroll-view class="scroll-box" scroll-y="true">
|
||||||
<scroll-view style="width:100%;height:100%" scroll-y="true">
|
<view class="box">
|
||||||
<view class="box">
|
<videoItem v-for="item in listInfo" :key="item.article_id" :item="item"
|
||||||
<view class="list">
|
@getArticlelist="getArticlelist"></videoItem>
|
||||||
<view >
|
<view class="no-data" v-show="!listInfo && !page">暂无数据</view>
|
||||||
<videoItem v-for="item in 10" :key="index"></videoItem>
|
</view>
|
||||||
</view>
|
</scroll-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>
|
||||||
@@ -61,39 +37,85 @@
|
|||||||
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
<image src="/static/image/common/10.png"></image>
|
<image src="/static/image/common/10.png"></image>
|
||||||
<text>输入达人名称</text>
|
<text>输入达人名称</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="list">
|
<view class="list" style="margin-left:-20rpx">
|
||||||
<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-left:20rpx;" 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=2'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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">
|
||||||
@@ -22,15 +22,15 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 用户操作 -->
|
<!-- 用户操作 -->
|
||||||
<userinfo class="userinfo" :list="list" :cart="cart_type" :comment="is_comment" @openCart="openPopup"></userinfo>
|
<userinfo class="userinfo" :list="list" :cart="cart_type" :comment="is_comment" :num="comment_num" @openCart="openPopup"></userinfo>
|
||||||
<!-- 评论 -->
|
<!-- 评论 -->
|
||||||
<u-popup v-model="is_comment" class="pl" mode="bottom" border-radius="10" height="700rpx">
|
<u-popup v-model="is_comment" class="pl" mode="bottom" border-radius="10" height="700rpx">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<text>评论</text>
|
<text>评论</text>
|
||||||
<u-icon name="arrow-down" color="#333" size="28" @click="is_comment=false"></u-icon>
|
<u-icon name="close" color="#333" size="28" @click="is_comment=false"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view class="scroll-box" scroll-y="true" >
|
<scroll-view class="scroll-box" scroll-y="true" lower-threshold="50" @scrolltolower="scrollBottom">
|
||||||
<block v-for="(item,index) in commentList" :key="index" v-if="commentList.length">
|
<block v-for="(item,index) in commentList" :key="index">
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<image :src="item.member_avatar" mode="aspectFill"></image>
|
<image :src="item.member_avatar" mode="aspectFill"></image>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
@@ -43,15 +43,22 @@
|
|||||||
{{ item.content }}
|
{{ item.content }}
|
||||||
</view>
|
</view>
|
||||||
<view class="child-content">
|
<view class="child-content">
|
||||||
<view>
|
<view class="child-box" v-for="(child,cid) in allList[item.id]" :key="cid">
|
||||||
|
<view class="info">
|
||||||
|
<image :src="child.member_avatar" mode=""></image>
|
||||||
|
<text>{{ child.member_nickname }}</text>
|
||||||
|
<u-icon v-if="!child.is_nickanme" class="icon" name="play-right-fill" color="#666" size="10rpx"></u-icon>
|
||||||
|
<text v-if="!child.is_nickanme">{{ child.reply_member_nickname }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="child_content">{{ child.content }}</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="more-reply" v-if="item.reply_count">展开更多回复<u-icon name="arrow-down"></u-icon></view> -->
|
<view class="more-reply" v-if="item.reply_count" @click="getReplyList(item.id)">展开更多回复<u-icon name="arrow-down"></u-icon></view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
<view class="no-data" v-else>111</view>
|
<view class="no-data" v-if="!commentList.length">还没有评论,快来评论吧!</view>
|
||||||
|
<u-loadmore v-else class="load-size" :status="status" size="20" 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>
|
||||||
@@ -59,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 :placeholder="edit_text_other" @focus="focus" v-model="send_value">
|
||||||
<text @click="sendComment">发送</text>
|
<text @click="sendComment">发送</text>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
@@ -173,13 +180,15 @@
|
|||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 88rpx;
|
height: 88rpx;
|
||||||
padding: 0 20rpx;
|
padding: 0 20rpx;
|
||||||
line-height: 88rpx;
|
line-height: 88rpx;
|
||||||
background-color: #ECECEC;
|
background-color: #ECECEC;
|
||||||
& > text {
|
& > text {
|
||||||
margin-right: 280rpx;
|
|
||||||
color: #333;
|
color: #333;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
@@ -187,7 +196,7 @@
|
|||||||
}
|
}
|
||||||
.scroll-box {
|
.scroll-box {
|
||||||
z-index: 99;
|
z-index: 99;
|
||||||
margin: 88rpx 0 150rpx 0;
|
margin: 88rpx 0 100rpx 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
.box {
|
.box {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -223,6 +232,28 @@
|
|||||||
}
|
}
|
||||||
.child-content {
|
.child-content {
|
||||||
margin: 6rpx 90rpx 6rpx;
|
margin: 6rpx 90rpx 6rpx;
|
||||||
|
.child-box {
|
||||||
|
.info {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
color: #666;
|
||||||
|
font-size: 20rpx;
|
||||||
|
& > image {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
.icon {
|
||||||
|
margin: 0 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.child_content {
|
||||||
|
margin: 18rpx 0 18rpx 30rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
.more-reply {
|
.more-reply {
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
@@ -230,9 +261,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.no-data {
|
.no-data {
|
||||||
margin-top: 100rpx;
|
margin-top: 200rpx;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
.editing {
|
.editing {
|
||||||
|
z-index: 1000;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -361,7 +394,7 @@
|
|||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
import userinfo from "../components/userinfo/index" // 点赞组件
|
import userinfo from "../components/userinfo/index" // 点赞组件
|
||||||
import contentBox from "../components/shpoone/index" // 评论
|
// import contentBox from "../components/shpoone/index" // 评论
|
||||||
// import shoplist from "../components/shoplist/index" // 商品列表
|
// import shoplist from "../components/shoplist/index" // 商品列表
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -373,6 +406,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
list:{},
|
list:{},
|
||||||
swiper_id: "",
|
swiper_id: "",
|
||||||
|
page: 0, // 主评论
|
||||||
|
page_: [], // 子评论
|
||||||
cart_type: false, // 显示购物车
|
cart_type: false, // 显示购物车
|
||||||
is_comment: false, // 显示评论
|
is_comment: false, // 显示评论
|
||||||
is_focus: false, // 聚焦
|
is_focus: false, // 聚焦
|
||||||
@@ -381,10 +416,19 @@ export default {
|
|||||||
cartList: [],
|
cartList: [],
|
||||||
cart_len: 0,
|
cart_len: 0,
|
||||||
photo_len: 0,
|
photo_len: 0,
|
||||||
|
comment_num: 0,
|
||||||
edit_text: "有爱评论,说点好听的 ~",
|
edit_text: "有爱评论,说点好听的 ~",
|
||||||
edit_text_other: "有爱评论,说点好听的 ~",
|
edit_text_other: "有爱评论,说点好听的 ~",
|
||||||
commentList: [], // 评论
|
commentList: [], // 评论
|
||||||
allList: {}, // 全部子评论
|
allList: [], // 全部子评论
|
||||||
|
status: 'loadmore',
|
||||||
|
iconType: 'circle',
|
||||||
|
loadText: {
|
||||||
|
loadmore: '轻轻上拉',
|
||||||
|
loading: '努力加载中',
|
||||||
|
nomore: '暂时没有更多了',
|
||||||
|
no: '评论'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option){
|
onLoad(option){
|
||||||
@@ -395,10 +439,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;
|
||||||
}
|
}
|
||||||
@@ -418,32 +462,46 @@ export default {
|
|||||||
// console.log(e.detail.current);
|
// console.log(e.detail.current);
|
||||||
this.swiper_id = e.detail.current; // 储存swiper id
|
this.swiper_id = e.detail.current; // 储存swiper id
|
||||||
},
|
},
|
||||||
// 更改购物车状态
|
// 更改弹框状态
|
||||||
openPopup(data) {
|
openPopup(data) {
|
||||||
// console.log(data);
|
// console.log(data);
|
||||||
this.cart_type = data.cart;
|
this.cart_type = data.cart;
|
||||||
this.is_comment = data.comment;
|
this.is_comment = data.comment;
|
||||||
if (this.is_comment) {
|
if (this.is_comment) {
|
||||||
this.getComment(this.article_id,0);
|
this.page = 0;
|
||||||
|
this.getComment();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 获取评论
|
// 获取评论
|
||||||
getComment(id,page) {
|
getComment() {
|
||||||
this.$u.post("article/articleCommentList",{
|
this.$u.post("article/articleCommentList",{
|
||||||
article_id: id,
|
article_id: this.article_id,
|
||||||
page: page,
|
page: this.page,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res);
|
this.status = "loading";
|
||||||
if (res.errCode == 0) {
|
// console.log(res);
|
||||||
this.commentList = res.data;
|
if (res.errCode == 0) {
|
||||||
}
|
if (this.commentList.length < 8) {
|
||||||
|
this.status = "nomore";
|
||||||
|
}
|
||||||
|
if (this.page == 0) {
|
||||||
|
this.commentList = res.data;
|
||||||
|
} else if (res.data.length == 0 && this.page > 0) {
|
||||||
|
this.status = "nomore";
|
||||||
|
} else {
|
||||||
|
this.commentList = this.commentList.concat(res.data);
|
||||||
|
}
|
||||||
|
this.page++;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 打开评论输入
|
// 打开评论输入
|
||||||
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;
|
||||||
@@ -458,6 +516,10 @@ export default {
|
|||||||
},
|
},
|
||||||
// 发布评论
|
// 发布评论
|
||||||
sendComment() {
|
sendComment() {
|
||||||
|
if (this.send_value.length == 0) {
|
||||||
|
this.$u.toast("内容不能为空!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.$u.post("article/articleAddComment",{
|
this.$u.post("article/articleAddComment",{
|
||||||
article_id: this.article_id,
|
article_id: this.article_id,
|
||||||
content: this.send_value,
|
content: this.send_value,
|
||||||
@@ -466,6 +528,9 @@ 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;
|
||||||
|
// console.log(this.comment_num);
|
||||||
this.is_edit = false;
|
this.is_edit = false;
|
||||||
if (res.data.data.pid) {
|
if (res.data.data.pid) {
|
||||||
this.commentList[this.comment_id].reply_count = true;
|
this.commentList[this.comment_id].reply_count = true;
|
||||||
@@ -478,6 +543,20 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 发现回复列表
|
||||||
|
getReplyList(id) {
|
||||||
|
this.page_[id] = 0;
|
||||||
|
if (!this.page_[id] === 0) {
|
||||||
|
}
|
||||||
|
console.log(this.page_[id]);
|
||||||
|
this.$u.post("article/articleReplyList", {id: id, page: this.page_[id]}).then(res => {
|
||||||
|
console.log(this.page_);
|
||||||
|
if (res.errCode == 0) {
|
||||||
|
this.page_[id]++;
|
||||||
|
this.allList[id] = res.data;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
// 预览图片
|
// 预览图片
|
||||||
viewImage(e) {
|
viewImage(e) {
|
||||||
let arr = [];
|
let arr = [];
|
||||||
@@ -489,6 +568,10 @@ export default {
|
|||||||
current: e.currentTarget.dataset.url,
|
current: e.currentTarget.dataset.url,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 评论滚动到底部
|
||||||
|
scrollBottom(e) {
|
||||||
|
this.getComment();
|
||||||
|
},
|
||||||
// 跳转到商品
|
// 跳转到商品
|
||||||
gotoInfo(id) {
|
gotoInfo(id) {
|
||||||
console.log(id);
|
console.log(id);
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="sdetails">
|
<view class="sdetails">
|
||||||
<u-swiper :list="list" height="500" border-radius="0" mode="dot"></u-swiper>
|
<u-swiper :list="list" height="500" border-radius="0" mode="dot" @click="viewImage"></u-swiper>
|
||||||
<view class="spike-view" v-if="type == 3">
|
<view class="spike-view" v-if="type == 3">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="price">
|
<view class="price">
|
||||||
<view class="now-price">¥{{ groupbuyInfo.groupbuy_price }}</view>
|
<view class="now-price">¥{{ groupbuyInfo.groupbuy_price || '0.00' }}</view>
|
||||||
<view class="origin-price">¥{{ groupbuyInfo.goods_price }}</view>
|
<view class="origin-price">¥{{ groupbuyInfo.goods_price || '0.00' }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="num">剩余数量{{ groupbuyInfo.inventory - groupbuyInfo.groupbuy_buy_quantity }}件</view>
|
<view class="num">剩余数量{{ groupbuyInfo.inventory - groupbuyInfo.groupbuy_buy_quantity || '0' }}件</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>
|
||||||
@@ -22,10 +22,17 @@
|
|||||||
<text class="store-name">{{ goodsInfo.store_name }}</text>
|
<text class="store-name">{{ goodsInfo.store_name }}</text>
|
||||||
<text class="goods-name">{{ goodsInfo.goods_name }}</text>
|
<text class="goods-name">{{ goodsInfo.goods_name }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="pic">
|
<view class="price-collect">
|
||||||
<text>¥{{ goodsInfo.goods_price }}</text>
|
<view class="pic" v-if="type != 3">
|
||||||
<s>¥{{ goodsInfo.goods_marketprice }}</s>
|
<text>¥{{ goodsInfo.pintuan_price || '0.00' }}</text>
|
||||||
</view>
|
<s>¥{{ goodsInfo.goods_price || '0.00' }}</s>
|
||||||
|
</view>
|
||||||
|
<view class="collect" @click="switchCollect(goodsInfo.goods_collect)">
|
||||||
|
<u-icon name="star" color="#474747" size="28" v-if="!goodsInfo.goods_collect"></u-icon>
|
||||||
|
<u-icon name="star-fill" color="#FF7807" size="28" v-else></u-icon>
|
||||||
|
<text>{{ !goodsInfo.goods_collect ? '收藏' : '已收藏' }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="hr"></view>
|
<view class="hr"></view>
|
||||||
<!-- <navs :value="领券"></navs> -->
|
<!-- <navs :value="领券"></navs> -->
|
||||||
@@ -91,7 +98,7 @@
|
|||||||
<image class="close" src="/static/image/common/17.png" @click="showGroupUser=false"></image>
|
<image class="close" src="/static/image/common/17.png" @click="showGroupUser=false"></image>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
<u-popup v-model="showInvolvementUser" mode="center">
|
<u-popup v-model="showInvolvementUser" mode="center" z-index="10078">
|
||||||
<view class="involvement-container" v-if="involvemenGroupInfo.length">
|
<view class="involvement-container" v-if="involvemenGroupInfo.length">
|
||||||
<view class="title u-line-1">参与{{ involvemenGroupInfo[0].member_nickname }}的拼团</view>
|
<view class="title u-line-1">参与{{ involvemenGroupInfo[0].member_nickname }}的拼团</view>
|
||||||
<view class="involvement-view">
|
<view class="involvement-view">
|
||||||
@@ -120,13 +127,15 @@
|
|||||||
<image class="image" :src="goodsInfo.goods_image"></image>
|
<image class="image" :src="goodsInfo.goods_image"></image>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<text class="u-line-2">{{goodsInfo.goods_name}}</text>
|
<text class="u-line-2">{{goodsInfo.goods_name}}</text>
|
||||||
<text>¥{{goodsInfo.goods_price}}</text>
|
<text v-if="type == 1">¥{{ goodsInfo.goods_price }}</text>
|
||||||
|
<text v-else-if="type == 2">¥{{ goodsInfo.pintuan_price }}</text>
|
||||||
|
<text v-else-if="type == 3">¥{{ groupbuyInfo.groupbuy_price }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<guige @sel="self" ref="guige" v-for="(item,index) in goodsInfo.spec_value" :key="index" :title="goodsInfo.spec_name[index]" :item="item"></guige>
|
<guige @sel="self" ref="guige" v-for="(item,index) in goodsInfo.spec_value" :key="index" :title="goodsInfo.spec_name[index]" :item="item"></guige>
|
||||||
<view class="num">
|
<view class="num">
|
||||||
<text>购买数量</text>
|
<text>购买数量</text>
|
||||||
<u-number-box v-model="goodsNumber" @change="valChange"></u-number-box>
|
<u-number-box v-model="goodsNumber" :min="1"></u-number-box>
|
||||||
</view>
|
</view>
|
||||||
<view style="height:100rpx"></view>
|
<view style="height:100rpx"></view>
|
||||||
</view>
|
</view>
|
||||||
@@ -135,14 +144,14 @@
|
|||||||
</u-popup>
|
</u-popup>
|
||||||
<!-- 普通商品 tool -->
|
<!-- 普通商品 tool -->
|
||||||
<view class="tloos" v-if="type == 1">
|
<view class="tloos" v-if="type == 1">
|
||||||
<view class="navs">
|
<view class="navs" @click="toOthersPage('pageC/merchant/index?id=' + storeInfo.store_id)" v-if="!showSpec">
|
||||||
<image src="/static/image/common/18.png"></image>
|
<image src="/static/image/common/18.png"></image>
|
||||||
店铺
|
店铺
|
||||||
</view>
|
</view>
|
||||||
<view class="navs" style="margin-right:30rpx">
|
<view class="navs" style="margin-right:30rpx" v-if="!showSpec" @click="customers()">
|
||||||
<image src="/static/image/common/19.png"></image>
|
<image src="/static/image/common/19.png"></image>
|
||||||
客服
|
客服
|
||||||
</view>
|
</view>
|
||||||
<view class="button" style="background:rgba(253,211,96,0.6);" v-if="goodsInfo.goods_try == 1" @click="tryDress">试穿试送</view>
|
<view class="button" style="background:rgba(253,211,96,0.6);" v-if="goodsInfo.goods_try == 1" @click="tryDress">试穿试送</view>
|
||||||
<view class="button" style="background:rgba(253,211,96,1);" @click="addCart">加入购物车</view>
|
<view class="button" style="background:rgba(253,211,96,1);" @click="addCart">加入购物车</view>
|
||||||
<view class="button" style="background:rgba(255,120,15,1);" @click="settlementOrder">立即购买</view>
|
<view class="button" style="background:rgba(255,120,15,1);" @click="settlementOrder">立即购买</view>
|
||||||
@@ -154,20 +163,21 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 秒杀 tool -->
|
<!-- 秒杀 tool -->
|
||||||
<view class="spike-tool" v-if="type==3">
|
<view class="spike-tool" v-if="type==3">
|
||||||
<view class="left">
|
<view class="left" v-if="!showSpec">
|
||||||
<view>
|
<view @click="toOthersPage('pageC/merchant/index?id=' + storeInfo.store_id)">
|
||||||
<image src="/static/image/common/18.png"></image>
|
<image src="/static/image/common/18.png"></image>
|
||||||
<text>店铺</text>
|
<text>店铺</text>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view @click="customers()">
|
||||||
<image src="/static/image/common/19.png"></image>
|
<image src="/static/image/common/19.png"></image>
|
||||||
<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" />
|
||||||
@@ -183,7 +193,8 @@ 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优惠券
|
||||||
@@ -193,16 +204,18 @@ export default {
|
|||||||
showInvolvementUser: false, // 参团
|
showInvolvementUser: false, // 参团
|
||||||
involvemenGroupInfo: [], // 参团的人
|
involvemenGroupInfo: [], // 参团的人
|
||||||
groupbuyInfo: {}, // 秒杀详情
|
groupbuyInfo: {}, // 秒杀详情
|
||||||
spikeTime: '',
|
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
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -215,20 +228,27 @@ 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();
|
||||||
// console.log(option);
|
// console.log(option);
|
||||||
this.type = Number(option.type);
|
// this.type = Number(option.type);
|
||||||
|
// this.type = 1;
|
||||||
this.id = option.id;
|
this.id = option.id;
|
||||||
this.getGoodsDetails(this.id);
|
// 先请求普通商品详情获取商品类型再渲染页面
|
||||||
this.setTitle();
|
this.ordinaryDetails(this.id);
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.debounce = true;
|
this.debounce = true;
|
||||||
this.showSpec = false;
|
this.showSpec = false;
|
||||||
this.showGroupUser = false;
|
this.showGroupUser = false;
|
||||||
this.showInvolvementUser = false;
|
this.showInvolvementUser = false;
|
||||||
|
this.getGoodsDetails(this.id);
|
||||||
},
|
},
|
||||||
onNavigationBarButtonTap(e) {
|
onNavigationBarButtonTap(e) {
|
||||||
if(e.index == 0) this.$u.route('/pageC/cart/index');
|
if(e.index == 0) this.$u.route('/pageC/cart/index');
|
||||||
@@ -237,6 +257,43 @@ export default {
|
|||||||
clearInterval(this.timer);
|
clearInterval(this.timer);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
customers(){
|
||||||
|
console.log(this.$store.state.hasLogin)
|
||||||
|
if(!this.$store.state.hasLogin){
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: "请先登录",
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
function Friend(uuid, name, avatar,time = "", text = "",date = "") {
|
||||||
|
this.uuid = uuid;
|
||||||
|
this.name = name;
|
||||||
|
this.avatar = avatar;
|
||||||
|
this.online = false;
|
||||||
|
this.unReadMessage = 0;
|
||||||
|
this.text = text;
|
||||||
|
this.time = time;
|
||||||
|
this.date = date
|
||||||
|
}
|
||||||
|
// console.log(123)
|
||||||
|
this.$u.api.getAtwillUserInfo({
|
||||||
|
id:this.storeid
|
||||||
|
}).then((res)=>{
|
||||||
|
console.log(res)
|
||||||
|
let user = new Friend(res.data.member_id,res.data.member_nickname,res.data.member_avatar)
|
||||||
|
this.$u.route({
|
||||||
|
url:"/pageD/privateChat/privateChat",
|
||||||
|
params:{
|
||||||
|
id:JSON.stringify(user)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}).catch((err)=>{
|
||||||
|
console.log(err)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
setSwiperList(list) {
|
setSwiperList(list) {
|
||||||
let img = [];
|
let img = [];
|
||||||
list.forEach(item => {
|
list.forEach(item => {
|
||||||
@@ -250,11 +307,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));
|
||||||
//计算出小时数
|
//计算出小时数
|
||||||
@@ -273,13 +345,32 @@ export default {
|
|||||||
}, 1000)
|
}, 1000)
|
||||||
},
|
},
|
||||||
addCart() {
|
addCart() {
|
||||||
|
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;
|
||||||
|
}
|
||||||
this.$u.api.addCart({
|
this.$u.api.addCart({
|
||||||
goods_id: this.id,
|
goods_id: this.id,
|
||||||
quantity: this.goodsNumber,
|
quantity: this.goodsNumber,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: res.message,
|
title: res.message,
|
||||||
type: res.errCode == 0 ? 'success' : 'warning',
|
duration: 1000,
|
||||||
|
callback: () => {
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
this.showSpec = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -297,10 +388,6 @@ export default {
|
|||||||
case 3:
|
case 3:
|
||||||
this.spikeGoodsDetails(id);
|
this.spikeGoodsDetails(id);
|
||||||
break;
|
break;
|
||||||
case 4:
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -308,12 +395,26 @@ export default {
|
|||||||
// 普通商品详情
|
// 普通商品详情
|
||||||
ordinaryDetails(id) {
|
ordinaryDetails(id) {
|
||||||
this.$u.api.getGoodsDetails({ id: id }).then((res)=>{
|
this.$u.api.getGoodsDetails({ id: id }).then((res)=>{
|
||||||
|
// console.log(res)
|
||||||
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;
|
||||||
|
this.storeid = res.data.store.store_id
|
||||||
// console.log(this.goodsInfo.mobile_body);
|
// console.log(this.goodsInfo.mobile_body);
|
||||||
|
this.type = res.data.view_type;
|
||||||
|
this.setTitle();
|
||||||
|
if(this.type == 1) {
|
||||||
|
this.id = res.data.goods.goods_id;
|
||||||
|
} else if(this.type == 2) {
|
||||||
|
this.id = res.data.goods.pintuan_id;
|
||||||
|
this.getGoodsDetails(this.id);
|
||||||
|
} else if(this.type == 3) {
|
||||||
|
this.id = res.data.groupbuy_id;
|
||||||
|
this.getGoodsDetails(this.id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -329,6 +430,7 @@ export default {
|
|||||||
this.glist = res.data.data.spec_list;
|
this.glist = res.data.data.spec_list;
|
||||||
this.user_suc = res.data.data.user_suc;
|
this.user_suc = res.data.data.user_suc;
|
||||||
this.groupUser =res.data.data.user;
|
this.groupUser =res.data.data.user;
|
||||||
|
// console.log(this.groupUser);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -338,20 +440,25 @@ export default {
|
|||||||
groupbuy_id: id
|
groupbuy_id: id
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if(res.errCode == 0) {
|
if(res.errCode == 0) {
|
||||||
|
// this.id = res.data.groupbuy_id;
|
||||||
this.groupbuyInfo = res.data.groupbuyInfo;
|
this.groupbuyInfo = res.data.groupbuyInfo;
|
||||||
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_endtime);
|
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: {
|
||||||
id: this.id,
|
id: this.goodsInfo.goods_id,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -362,6 +469,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 = {
|
||||||
@@ -370,13 +497,14 @@ export default {
|
|||||||
}
|
}
|
||||||
if(this.type == 2) {
|
if(this.type == 2) {
|
||||||
if(type == 'involvement') {
|
if(type == 'involvement') {
|
||||||
|
// const userId = uni.getStorageSync('user_info').member.member_id;
|
||||||
|
this.$store.commit('setGroupHeadId', this.involvemenGroupInfo[0].user_id);
|
||||||
|
// console.log(this.$store.state.pintuangroup_headid);
|
||||||
Object.assign(params, {
|
Object.assign(params, {
|
||||||
pintuan_id: this.id,
|
pintuan_id: this.id,
|
||||||
pintuangroup_id: this.involvemenGroupInfo[0].pintuangroup_id,
|
pintuangroup_id: this.involvemenGroupInfo[0].pintuangroup_id,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
const userId = uni.getStorageSync('user_info').member.member_id;
|
|
||||||
this.$store.commit('setGroupHeadId', userId);
|
|
||||||
Object.assign(params, {
|
Object.assign(params, {
|
||||||
pintuan_id: this.id,
|
pintuan_id: this.id,
|
||||||
})
|
})
|
||||||
@@ -384,6 +512,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.$u.api.settlementOrder(params).then(res => {
|
this.$u.api.settlementOrder(params).then(res => {
|
||||||
if(res.errCode == 0) {
|
if(res.errCode == 0) {
|
||||||
|
// console.log('type' + this.type);
|
||||||
this.$store.commit('setOrderType', this.type);
|
this.$store.commit('setOrderType', this.type);
|
||||||
this.$store.commit('updateOrderInfo', res.data)
|
this.$store.commit('updateOrderInfo', res.data)
|
||||||
this.$u.route({
|
this.$u.route({
|
||||||
@@ -391,6 +520,7 @@ export default {
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.debounce = true;
|
this.debounce = true;
|
||||||
|
this.$u.toast(res.message);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -401,9 +531,6 @@ export default {
|
|||||||
this.showInvolvementUser = true;
|
this.showInvolvementUser = true;
|
||||||
// console.log(this.involvemenGroupInfo);
|
// console.log(this.involvemenGroupInfo);
|
||||||
},
|
},
|
||||||
valChange(e) {
|
|
||||||
// console.log(this.value)
|
|
||||||
},
|
|
||||||
self(){
|
self(){
|
||||||
// console.log(this.$refs.guige)
|
// console.log(this.$refs.guige)
|
||||||
let index = 0;
|
let index = 0;
|
||||||
@@ -417,15 +544,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];
|
||||||
},
|
},
|
||||||
@@ -441,17 +571,18 @@ export default {
|
|||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
title = '秒杀商品详情';
|
title = '秒杀商品详情';
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
title = '商品详情';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
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',
|
||||||
@@ -459,6 +590,42 @@ export default {
|
|||||||
id: this.goodsInfo.goods_id
|
id: this.goodsInfo.goods_id
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
// 查看轮播图
|
||||||
|
viewImage(index) {
|
||||||
|
let arr = [];
|
||||||
|
this.list.forEach(item => {
|
||||||
|
arr.push(item.image);
|
||||||
|
})
|
||||||
|
uni.previewImage({
|
||||||
|
urls: arr,
|
||||||
|
current: arr[index]
|
||||||
|
})
|
||||||
|
},
|
||||||
|
switchCollect(status) {
|
||||||
|
if(status) {
|
||||||
|
this.removeFavorite();
|
||||||
|
} else {
|
||||||
|
this.addFavoriteGoods();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
addFavoriteGoods() {
|
||||||
|
this.$u.api.addFavoriteGoods({ fid: this.goodsInfo.goods_id }).then(res => {
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
this.getGoodsDetails(this.id);
|
||||||
|
} else {
|
||||||
|
this.$u.toast(res.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
removeFavorite() {
|
||||||
|
this.$u.api.removeFavorite({ fid: this.goodsInfo.goods_id, type: 'goods' }).then(res => {
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
this.getGoodsDetails(this.id);
|
||||||
|
} else {
|
||||||
|
this.$u.toast(res.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -470,7 +637,7 @@ export default {
|
|||||||
background-color: #EEEBEE;
|
background-color: #EEEBEE;
|
||||||
.spike-view {
|
.spike-view {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 396rpx;
|
top: 400rpx;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 104rpx;
|
height: 104rpx;
|
||||||
@@ -523,8 +690,8 @@ export default {
|
|||||||
}
|
}
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
.title {
|
.time {
|
||||||
margin-bottom: 18rpx;
|
margin-top: 18rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -550,18 +717,31 @@ export default {
|
|||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.pic{
|
.price-collect {
|
||||||
>text{
|
display: flex;
|
||||||
font-size: 32rpx;
|
align-items: center;
|
||||||
color: #FF3131;
|
justify-content: space-between;
|
||||||
}
|
.pic{
|
||||||
>s{
|
>text{
|
||||||
font-size: 26rpx;
|
font-size: 32rpx;
|
||||||
color: #999;
|
color: #FF3131;
|
||||||
display: inline-block;
|
}
|
||||||
margin-left: 30rpx;
|
>s{
|
||||||
}
|
font-size: 26rpx;
|
||||||
}
|
color: #999;
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: 30rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.collect {
|
||||||
|
margin-left: auto;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
> text {
|
||||||
|
margin-left: 12rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.comment {
|
.comment {
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
@@ -860,6 +1040,7 @@ export default {
|
|||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: rgba(255,255,255,1);
|
color: rgba(255,255,255,1);
|
||||||
z-index: 10076;
|
z-index: 10076;
|
||||||
|
background-color: #FFFFFF;
|
||||||
.launch {
|
.launch {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
background: rgba(253,211,96,1);
|
background: rgba(253,211,96,1);
|
||||||
@@ -874,13 +1055,14 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.spike-tool {
|
.spike-tool {
|
||||||
|
z-index: 10076;
|
||||||
|
display: flex;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 98rpx;
|
height: 100rpx;
|
||||||
display: flex;
|
background-color: #FFFFFF;
|
||||||
z-index: 10076;
|
|
||||||
.left {
|
.left {
|
||||||
width: 190rpx;
|
width: 190rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -902,8 +1084,8 @@ export default {
|
|||||||
}
|
}
|
||||||
.btn {
|
.btn {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
height: 98rpx;
|
height: 104rpx;
|
||||||
line-height: 98rpx;
|
line-height: 104rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: rgba(255,255,255,1);
|
color: rgba(255,255,255,1);
|
||||||
|
|||||||
@@ -13,11 +13,14 @@ export default {
|
|||||||
name:"search",
|
name:"search",
|
||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
|
type: '', // 1 商家达人社区 2 商品
|
||||||
keyword: "",
|
keyword: "",
|
||||||
searchwordlist: [],
|
searchwordlist: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
// type: 2 商品 1: 其他
|
||||||
|
onLoad(option) {
|
||||||
|
this.type = option.type;
|
||||||
this.getWordList();
|
this.getWordList();
|
||||||
},
|
},
|
||||||
// 点击搜索按钮
|
// 点击搜索按钮
|
||||||
@@ -34,8 +37,10 @@ export default {
|
|||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
getWordList() {
|
getWordList() {
|
||||||
this.$u.api.searchwordlist().then(res => {
|
this.$u.api.searchwordlist({type:this.type}).then(res => {
|
||||||
this.searchwordlist = res.data;
|
console.log(res)
|
||||||
|
this.searchwordlist = res.data;
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
search(value){
|
search(value){
|
||||||
@@ -44,14 +49,22 @@ export default {
|
|||||||
this.$u.toast('搜索内容不可为空');
|
this.$u.toast('搜索内容不可为空');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.$u.route({
|
let params = {
|
||||||
url: "/pageB/search/out",
|
value: value,
|
||||||
params: {
|
type: this.type,
|
||||||
value: value,
|
}
|
||||||
type: "shop",
|
if(this.type == 2) {
|
||||||
order: 'goods_salenum'
|
this.$u.route({
|
||||||
}
|
url: "/pageB/search/out",
|
||||||
})
|
params: params,
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
this.$u.route({
|
||||||
|
url: "/pageB/search/searchGoods",
|
||||||
|
params: params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,193 +1,296 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="out">
|
<view class="classify-goods">
|
||||||
<u-tabs-swiper v-if="type == 'dianpu'" @change="tabsChange" :show-bar="false" :bold="false" :font-size="32"
|
<view class="tab-container">
|
||||||
active-color="#FF780F" ref="uTabs" :list="list" :is-scroll="false" style="border-bottom: 1px solid #ececec;flex-shrink:0"
|
<view class="salenum" :class="{ 'current' : current == 0 }" @click="switchCurrent(0)">店铺</view>
|
||||||
height="88"></u-tabs-swiper>
|
<view class="price" :class="{ 'current' : current == 1 }" @click="switchCurrent(1)">
|
||||||
<swiper v-if="type == 'dianpu'" class="swiper" :current="swiperCurrent" @transition="transition"
|
达人
|
||||||
@animationfinish="animationfinish">
|
</view>
|
||||||
<swiper-item>
|
<view class="evaluation" :class="{ 'current' : current == 2 }" @click="switchCurrent(2)">社区</view>
|
||||||
<scroll-view :scroll-y="true" style="height:100%">
|
</view>
|
||||||
<view style="padding-top:30rpx">
|
<scroll-view scroll-y class="goods-container" :style="{ height: scrollHeight }" @scrolltolower="loadMore" v-show="current == 0">
|
||||||
<shop></shop>
|
<view v-for="goods in goodsList" :key="goods.store_id" class="goods-item" @click="toDetailsPage(goods.store_id)">
|
||||||
</view>
|
<image :src="goods.store_avatar"></image>
|
||||||
</scroll-view>
|
<view class="right">
|
||||||
</swiper-item>
|
<view class="name u-line-1">{{ goods.store_name }}</view>
|
||||||
<swiper-item>
|
<view class="briefing u-line-2">{{ goods.store_description }}</view>
|
||||||
<scroll-view :scroll-y="true" style="height:100%">
|
</view>
|
||||||
<view class="list">
|
</view>
|
||||||
<!-- <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> -->
|
<u-loadmore :status="loadStatus" bgColor="#FFFFFF" margin-top="20" margin-bottom="20" v-if="goodsList.length >= pageSize"></u-loadmore>
|
||||||
</view>
|
<u-empty mode="list" v-if="!goodsList.length"></u-empty>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</swiper-item>
|
<scroll-view style="width:100%;" :style="{ height: scrollHeight }" scroll-y="true" @scrolltolower="loadMore" v-if=" current == 2 ">
|
||||||
</swiper>
|
<view class="box" style="padding: 0 30rpx;">
|
||||||
<view v-else style=" display: flex;flex-direction: column;height: calc(100vh - 88rpx);">
|
<view style="display:flex">
|
||||||
<view class="select">
|
<view>
|
||||||
<view @click="sx(0)" class="xz" data-type="xl">销量</view>
|
<videoItem v-for="(item,id) in goodsList.filter((_, index) => !(index&1))" :key="id" :item="item"
|
||||||
<view class="xz" @click="sx(1)">
|
@getArticlelist="getArticlelist"></videoItem>
|
||||||
<text>价格</text>
|
</view>
|
||||||
<view class="jiage">
|
<view style="margin-left:20rpx">
|
||||||
<view class="top topxz"></view>
|
<videoItem v-for="(item,id) in goodsList.filter((_, index) => index&1)" :key="id" :item="item"
|
||||||
<view class="bottom bottomxz"></view>
|
@getArticlelist="getArticlelist"></videoItem>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view data-type="hp" @click="sx(2)">好评</view>
|
</view>
|
||||||
</view>
|
<u-loadmore :status="loadStatus" bgColor="#FFFFFF" margin-top="20" margin-bottom="20" v-if="goodsList.length >= pageSize"></u-loadmore>
|
||||||
<view class="swiper" :current="swiperCurrent" @change="huadong">
|
<u-empty mode="list" v-if="!goodsList.length"></u-empty>
|
||||||
<scroll-view :scroll-y="true" style="height:100%">
|
</scroll-view>
|
||||||
<view style="padding-top:30rpx">
|
<scroll-view style="width:100%;padding: 20rpx 30rpx;margin-right:23rpx;" :style="{ height: scrollHeight }" scroll-y="true" @scrolltolower="loadMore" v-if=" current == 1 ">
|
||||||
<shop v-for="(i,j) in shoplist" :key="j" :name="i.goods_name" :id="i.goods_id" :commonid="i.goods_commonid"
|
<view class="list" >
|
||||||
:image="i.goods_image"></shop>
|
<darenItem style="margin-top:20rpx;margin-right:23rpx;box-shadow:0px 3rpx 7rpx 0px rgba(153, 153, 153, 0.35);" v-for="item in goodsList" :key="item.id" :info="item" v-on:pChangeType="changeType"></darenItem>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
<u-loadmore :status="loadStatus" bgColor="#FFFFFF" margin-top="20" margin-bottom="20" v-if="goodsList.length >= pageSize"></u-loadmore>
|
||||||
</view>
|
<u-empty mode="list" v-if="!goodsList.length"></u-empty>
|
||||||
</view>
|
</scroll-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"
|
import videoItem from "@/components/index/video-item/index"
|
||||||
import darenItem from "@/components/index/daren-item/index"
|
import darenItem from "@/components/index/daren-item/index"
|
||||||
export default {
|
export default {
|
||||||
name: "out",
|
data() {
|
||||||
components: {
|
return {
|
||||||
shop,
|
pageSize: 12,
|
||||||
darenItem
|
cid: '',
|
||||||
},
|
page: 1,
|
||||||
data() {
|
current: 0,
|
||||||
return {
|
priceOrderAsc: true, // 是否升序
|
||||||
list: [{
|
goodsList: [],
|
||||||
name: "店铺"
|
scrollHeight: '',
|
||||||
}, {
|
loadStatus: 'loadmore',
|
||||||
name: "达人"
|
timer: true, // 防止上拉加载短时间内多次调用,
|
||||||
}],
|
value:""
|
||||||
current: 0,
|
}
|
||||||
swiperCurrent: 0,
|
},
|
||||||
keyword: "",
|
components:{
|
||||||
type: "",
|
videoItem,
|
||||||
shoplist: []
|
darenItem
|
||||||
}
|
},
|
||||||
},
|
watch: {
|
||||||
onLoad(o) {
|
current(value) {
|
||||||
this.type = o.type
|
this.page = 1;
|
||||||
this.keyword = o.value
|
this.ShopSearch({ laod: 'reload' });
|
||||||
this.search()
|
},
|
||||||
},
|
priceOrderAsc(value) {
|
||||||
methods: {
|
this.page = 1;
|
||||||
tabsChange(index) {
|
this.ShopSearch({ laod: 'reload' });
|
||||||
this.swiperCurrent = index;
|
}
|
||||||
},
|
},
|
||||||
transition(e) {
|
onLoad(option) {
|
||||||
let dx = e.detail.dx;
|
this.value = option.value;
|
||||||
this.$refs.uTabs.setDx(dx);
|
this.setViewHeight();
|
||||||
},
|
this.ShopSearch()
|
||||||
animationfinish(e) {
|
this.setNavSearchInput(this.value);
|
||||||
let current = e.detail.current;
|
},
|
||||||
this.$refs.uTabs.setFinishCurrent(current);
|
onNavigationBarSearchInputConfirmed(value) {
|
||||||
this.swiperCurrent = current;
|
this.value = value.text
|
||||||
this.current = current;
|
// console.log(this.value)
|
||||||
},
|
this.ShopSearch()
|
||||||
sx(type) {
|
},
|
||||||
console.log(type)
|
methods: {
|
||||||
|
// 动态设置导航栏搜索框内容
|
||||||
},
|
setNavSearchInput(keyword) {
|
||||||
huadong(e) {
|
// #ifdef APP-PLUS
|
||||||
console.log(e.detail.current)
|
let webView = this.$mp.page.$getAppWebview();
|
||||||
},
|
webView.setTitleNViewSearchInputText(keyword);
|
||||||
search() {
|
// #endif
|
||||||
this.$u.api.ShopSearch({
|
// #ifdef H5
|
||||||
keyword: this.keyword
|
let inputSearch=document.querySelector('.uni-input-input[type=search]');
|
||||||
}).then((res) => {
|
var evt = new InputEvent('input', {
|
||||||
this.shoplist = res.data.data
|
inputType: 'insertText',
|
||||||
})
|
data: keyword,
|
||||||
}
|
dataTransfer: null,
|
||||||
},
|
isComposing: false
|
||||||
}
|
});
|
||||||
|
if(inputSearch){
|
||||||
|
inputSearch.value = keyword;
|
||||||
|
inputSearch.dispatchEvent(evt);
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
changeType(member_id){
|
||||||
|
console.log(member_id);
|
||||||
|
this.$emit("pChangeType")
|
||||||
|
this.$u.api.attentionMember({
|
||||||
|
member_id: member_id
|
||||||
|
}).then((res)=>{
|
||||||
|
console.log(res)
|
||||||
|
for(let i in this.goodsList){
|
||||||
|
|
||||||
|
if(this.goodsList[i].member_id == member_id){
|
||||||
|
this.goodsList[i].is_attention = res.message == "已取消关注!" ? 0 : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
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 ShopSearch({ load = 'reload' } = {}) {
|
||||||
|
// const res = await this.$u.api.ShopSearch({
|
||||||
|
// keyword: this.value,
|
||||||
|
// page: this.page,
|
||||||
|
// order: sort,
|
||||||
|
// })
|
||||||
|
console.log(this.value)
|
||||||
|
let res = {}
|
||||||
|
if(this.current == 0) {
|
||||||
|
res = await this.$u.api.storeList({
|
||||||
|
name_search: this.value,
|
||||||
|
page: this.page
|
||||||
|
})
|
||||||
|
this.timer = true;
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
if(load == 'reload') this.goodsList = res.data.list.data;
|
||||||
|
else if(load == 'loadmore') this.goodsList.push(...res.data.list.data);
|
||||||
|
}
|
||||||
|
console.log(this.goodsList)
|
||||||
|
return res.data.list.data.length;
|
||||||
|
} else if (this.current == 1) {
|
||||||
|
|
||||||
|
res = await this.$u.api.getExpertList({
|
||||||
|
like_nickname: this.value,
|
||||||
|
page: this.page
|
||||||
|
})
|
||||||
|
this.timer = true;
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
if(load == 'reload') this.goodsList = res.data.list;
|
||||||
|
else if(load == 'loadmore') this.goodsList.push(...res.data.list);
|
||||||
|
}
|
||||||
|
console.log(this.goodsList)
|
||||||
|
return res.data.list.length;
|
||||||
|
} else if (this.current == 2) {
|
||||||
|
res = await this.$u.api.getArticlelist({
|
||||||
|
value: this.value,
|
||||||
|
page: this.page
|
||||||
|
})
|
||||||
|
this.timer = true;
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
if(load == 'reload') this.goodsList = res.data.list;
|
||||||
|
else if(load == 'loadmore') this.goodsList.push(...res.data.list);
|
||||||
|
}
|
||||||
|
console.log(this.goodsList)
|
||||||
|
return res.data.list.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
loadMore() {
|
||||||
|
if(this.goodsList.length < this.pageSize) return false;
|
||||||
|
if(!this.timer) return false;
|
||||||
|
this.loadStatus = "loading";
|
||||||
|
this.page++;
|
||||||
|
this.ShopSearch({ 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;
|
||||||
|
this.goodsList = []
|
||||||
|
this.ShopSearch()
|
||||||
|
},
|
||||||
|
setViewHeight() {
|
||||||
|
const res = uni.getSystemInfoSync();
|
||||||
|
this.scrollHeight = res.windowHeight - res.windowWidth / 750 * 90 + 'px';
|
||||||
|
},
|
||||||
|
toDetailsPage(id) {
|
||||||
|
this.$u.route('/pageC/merchant/index', {
|
||||||
|
id: id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.list{
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
width: calc(100% + 23rpx);
|
||||||
|
margin-right: -23rpx;
|
||||||
|
}
|
||||||
|
.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>
|
||||||
214
pageB/search/searchGoods.vue
Normal file
@@ -0,0 +1,214 @@
|
|||||||
|
<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, // 防止上拉加载短时间内多次调用,
|
||||||
|
value:""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
current(value) {
|
||||||
|
this.page = 1;
|
||||||
|
this.ShopSearch({ laod: 'reload' });
|
||||||
|
},
|
||||||
|
priceOrderAsc(value) {
|
||||||
|
this.page = 1;
|
||||||
|
this.ShopSearch({ laod: 'reload' });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
this.value = option.value
|
||||||
|
this.setViewHeight();
|
||||||
|
this.ShopSearch()
|
||||||
|
},
|
||||||
|
onNavigationBarSearchInputConfirmed(value) {
|
||||||
|
this.value = value.text
|
||||||
|
this.ShopSearch()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
setNavSearchInput(keyword) {
|
||||||
|
console.log(keyword);
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
let webView = this.$mp.page.$getAppWebview();
|
||||||
|
webView.setTitleNViewSearchInputText(keyword);
|
||||||
|
// #endif
|
||||||
|
// #ifdef H5
|
||||||
|
let inputSearch=document.querySelector('.uni-input-input[type=search]');
|
||||||
|
const evt = new InputEvent('input', {
|
||||||
|
inputType: 'insertText',
|
||||||
|
data: keyword,
|
||||||
|
dataTransfer: null,
|
||||||
|
isComposing: false
|
||||||
|
});
|
||||||
|
if(inputSearch){
|
||||||
|
inputSearch.value = keyword;
|
||||||
|
inputSearch.dispatchEvent(evt);
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
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 ShopSearch({ load = 'reload' } = {}) {
|
||||||
|
console.log(this.value);
|
||||||
|
this.setNavSearchInput(this.value);
|
||||||
|
const sort = this.setOrderSort();
|
||||||
|
const res = await this.$u.api.ShopSearch({
|
||||||
|
keyword: this.value,
|
||||||
|
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.ShopSearch({ load: 'loadmore' }).then(length => {
|
||||||
|
if(length == 0) {
|
||||||
|
this.page--;
|
||||||
|
this.loadStatus = 'nomore';
|
||||||
|
} else {
|
||||||
|
this.loadStatus = 'loading';
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.loadStatus = "nomore";
|
||||||
|
this.page--;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
switchCurrent(current) {
|
||||||
|
this.ShopSearch()
|
||||||
|
if(current == 1 && this.current == 1) this.priceOrderAsc = !this.priceOrderAsc;
|
||||||
|
this.current = current;
|
||||||
|
},
|
||||||
|
setViewHeight() {
|
||||||
|
const res = uni.getSystemInfoSync();
|
||||||
|
this.scrollHeight = res.windowHeight - res.windowWidth / 750 * 90 + 'px';
|
||||||
|
},
|
||||||
|
toDetailsPage(id) {
|
||||||
|
this.$u.route('/pageB/sdetails/index', {
|
||||||
|
id: id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</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>
|
||||||
470
pageB/video/video.nvue
Normal file
@@ -0,0 +1,470 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<video id="videoId" :style="videoSize" :src="src" autoplay="true" :show-fullscreen-btn="false" @play="playing"
|
||||||
|
@timeupdate="timeupdate" :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-image class="pause" @click="stoping" src="../../static/videoPlay.png" v-if="!is_play">
|
||||||
|
</cover-image>
|
||||||
|
<!-- 用户操作 -->
|
||||||
|
<userinfo class="user-info" :list="list" :cart="cart_type" :comment="is_comment" :num="comment_num" @openCart="openPopup"></userinfo>
|
||||||
|
<cover-view class="info-box" @click="stopClick">>
|
||||||
|
<view class="video-info-box">
|
||||||
|
<image class="image-play" src="../../static/videoIcon.png" mode=""></image>
|
||||||
|
<text class="video-slip">视频</text>
|
||||||
|
<text class="time">{{ time_count == 1 ? 0 : 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: labelLen[index] * 40 + 'rpx' }">{{ item.name }}</text>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
</cover-view>
|
||||||
|
<cover-view class="content-box" v-if="is_comment">
|
||||||
|
<view class="content-title">
|
||||||
|
<text class="tips">评论</text>
|
||||||
|
<text class="close-down" @click="closeComment">×</text>
|
||||||
|
</view>
|
||||||
|
<scroller class="comment-list">
|
||||||
|
<view class="" v-for="(item,index) in commentList" :key="index">
|
||||||
|
<view class="comment-list-box">
|
||||||
|
<view class="comment-list-header">
|
||||||
|
<image class="avatar" :src="item.member_avatar" mode=""></image>
|
||||||
|
<view>
|
||||||
|
<text class="comment-title">{{ item.member_nickname }}</text>
|
||||||
|
<text class="comment-time">{{ item.create_time }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<text class="reply">回复</text>
|
||||||
|
</view>
|
||||||
|
<view class="content-main">
|
||||||
|
<text class="content-style">{{ item.content }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="send-box">
|
||||||
|
<input class="send-val" type="text" value="" />
|
||||||
|
<text class="btn-send">发送</text>
|
||||||
|
</view>
|
||||||
|
<loading class="loading" @loading="onloading" :display="loadinging ? 'show' : 'hide'">
|
||||||
|
<loading-indicator class="indicator"></loading-indicator>
|
||||||
|
<text class="indicator-text">努力加载中</text>
|
||||||
|
</loading>
|
||||||
|
</scroller>
|
||||||
|
</cover-view>
|
||||||
|
<list class="cart-box">
|
||||||
|
<cell></cell>
|
||||||
|
</list>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import userinfo from "../components/userinfo/index" // 点赞组件
|
||||||
|
const temp_url = "https://dmmall.sdbairui.com/api/";
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
userinfo
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
videoSize: {},
|
||||||
|
list: {},
|
||||||
|
labelLen: [],
|
||||||
|
cart_type: false, // 显示购物车
|
||||||
|
is_comment: false, // 显示评论
|
||||||
|
comment_num: 0, // 评论数
|
||||||
|
page: 0,
|
||||||
|
commentList: [], // 评论列表
|
||||||
|
src: "",
|
||||||
|
is_play: true,
|
||||||
|
time_count: 0,
|
||||||
|
linear: null,
|
||||||
|
loadinging: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
this.article_id = option.id;
|
||||||
|
this.getVideoInfo(option.id);
|
||||||
|
this.getInfo();
|
||||||
|
},
|
||||||
|
onReady() {
|
||||||
|
this.videoBox = uni.createVideoContext("videoId", this);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 获取信息
|
||||||
|
getVideoInfo(article_id) {
|
||||||
|
uni.request({
|
||||||
|
url: temp_url + "article/articleInfo",
|
||||||
|
method: "POST",
|
||||||
|
data: {
|
||||||
|
article_id: article_id
|
||||||
|
},
|
||||||
|
header: {
|
||||||
|
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
this.list = res.data.data.info;
|
||||||
|
this.src = res.data.data.info.video_path;
|
||||||
|
let item = res.data.data.info.label;
|
||||||
|
let arr = [];
|
||||||
|
item.forEach(data => {
|
||||||
|
let str = escape(data.name);
|
||||||
|
if (str.indexOf('%u')) {
|
||||||
|
// console.log(data.name);
|
||||||
|
arr.push(Math.floor(data.name.length / 2));
|
||||||
|
} else {
|
||||||
|
arr.push(data.name.length);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.labelLen = arr;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获取评论
|
||||||
|
getComment() {
|
||||||
|
uni.request({
|
||||||
|
url: temp_url + "article/articleCommentList",
|
||||||
|
method: "POST",
|
||||||
|
data: {
|
||||||
|
article_id: this.article_id,
|
||||||
|
page: this.page,
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
if (res.data.errCode == 0) {
|
||||||
|
console.log(res.data);
|
||||||
|
this.commentList = res.data.data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 发布评论
|
||||||
|
sendComment() {
|
||||||
|
if (this.send_value.length == 0) {
|
||||||
|
this.$u.toast("内容不能为空!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
uni.request({
|
||||||
|
url: temp_url + "article/articleAddComment",
|
||||||
|
method: "POST",
|
||||||
|
data: {
|
||||||
|
article_id: this.article_id,
|
||||||
|
content: this.send_value,
|
||||||
|
pid: this.pid,
|
||||||
|
reply_id: this.reply_id,
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
if (res.data.errCode == 0) {
|
||||||
|
this.send_value = "";
|
||||||
|
this.comment_num = res.data.num;
|
||||||
|
console.log(res.data);
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.data.message,
|
||||||
|
icon: "none"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获取手机信息
|
||||||
|
getInfo() {
|
||||||
|
uni.getSystemInfo({
|
||||||
|
success: (res) => {
|
||||||
|
this.videoSize = {
|
||||||
|
width: "750rpx",
|
||||||
|
height: res.screenHeight + "px"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 播放
|
||||||
|
playing(e) {
|
||||||
|
// console.log(e);
|
||||||
|
if (e.type == "play") {}
|
||||||
|
},
|
||||||
|
// 暂停
|
||||||
|
stoping() {
|
||||||
|
this.is_play = !this.is_play;
|
||||||
|
if (this.is_play) {
|
||||||
|
this.videoBox.play();
|
||||||
|
} else {
|
||||||
|
this.videoBox.pause();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 监听视频
|
||||||
|
timeupdate(e) {
|
||||||
|
this.time_count = parseInt(e.detail.duration) - parseInt(e.detail.currentTime);
|
||||||
|
if (e.detail.duration == e.detail.currentTime) {
|
||||||
|
this.is_play = false;
|
||||||
|
}
|
||||||
|
// let num = parseInt((e.detail.currentTime/e.detail.duration)*100);
|
||||||
|
// this.linear = num + "%";
|
||||||
|
// console.log(this.time_count);
|
||||||
|
},
|
||||||
|
// 打开弹窗
|
||||||
|
openPopup(data) {
|
||||||
|
console.log(data);
|
||||||
|
this.cart_type = data.cart;
|
||||||
|
this.is_comment = data.comment;
|
||||||
|
if (this.is_comment) {
|
||||||
|
this.page = 0;
|
||||||
|
this.getComment();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 关闭评论
|
||||||
|
closeComment() {
|
||||||
|
this.is_comment = false;
|
||||||
|
},
|
||||||
|
// 下拉加载
|
||||||
|
onloading(e) {
|
||||||
|
console.log(e);
|
||||||
|
this.loadinging = true;
|
||||||
|
setTimeout(() => {
|
||||||
|
this.loadinging = false;
|
||||||
|
}, 2000)
|
||||||
|
},
|
||||||
|
// stop
|
||||||
|
stopClick(event) {
|
||||||
|
event.stopPropagation();
|
||||||
|
},
|
||||||
|
goBack() {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
/* 关闭 */
|
||||||
|
.close {
|
||||||
|
position: fixed;
|
||||||
|
top: 80rpx;
|
||||||
|
right: 60rpx;
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 暂停 */
|
||||||
|
.pause {
|
||||||
|
position: fixed;
|
||||||
|
top: 600rpx;
|
||||||
|
left: 330rpx;
|
||||||
|
width: 100rpx;
|
||||||
|
height: 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 用户操作 */
|
||||||
|
.user-info {
|
||||||
|
position: fixed;
|
||||||
|
top: 360rpx;
|
||||||
|
right: 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-box {
|
||||||
|
z-index: 99;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 750rpx;
|
||||||
|
height: 700rpx;
|
||||||
|
margin-bottom: 88rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-title {
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
height: 88rpx;
|
||||||
|
padding: 0 20rpx;
|
||||||
|
background-color: #ECECEC;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment-list {
|
||||||
|
margin-bottom: 50rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment-list-box {
|
||||||
|
padding: 30rpx;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-main {
|
||||||
|
flex-direction: row;
|
||||||
|
padding-left: 100rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content-style {
|
||||||
|
width: 600rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #333;
|
||||||
|
lines: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment-list-header {
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar {
|
||||||
|
width: 60rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment-title {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment-time,
|
||||||
|
.reply {
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
.send-box {
|
||||||
|
z-index: 10000;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 750rpx;
|
||||||
|
height: 88rpx;
|
||||||
|
padding: 10rpx 30rpx;
|
||||||
|
border-top-width: 1rpx;
|
||||||
|
border-color: #ececec;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.send-val {
|
||||||
|
width: 600rpx;
|
||||||
|
height: 88rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-send {
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-down {
|
||||||
|
font-size: 50rpx;
|
||||||
|
text-align: center;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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);
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading {
|
||||||
|
width: 750rpx;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.indicator-text {
|
||||||
|
font-size: 20rpx;
|
||||||
|
text-align: center;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.indicator {
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="name u-line-2">{{ goods.goods_name }}</view>
|
<view class="name u-line-2">{{ goods.goods_name }}</view>
|
||||||
<view class="cart-info">
|
<view class="cart-info">
|
||||||
<view class="price">¥{{ goods.goods_price }}</view>
|
<view class="price">¥{{ goods.goods_total }}</view>
|
||||||
<view>×{{ goods.goods_num }}</view>
|
<view>×{{ goods.goods_num }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -148,7 +148,7 @@ export default {
|
|||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
this.orderType = this.$store.state.orderType;
|
this.orderType = this.$store.state.orderType;
|
||||||
this.orderInfo = this.$store.state.orderInfo;
|
this.orderInfo = this.$store.state.orderInfo;
|
||||||
// console.log(this.orderType);
|
console.log('orderType' + this.orderType);
|
||||||
// console.log(this.orderInfo);
|
// console.log(this.orderInfo);
|
||||||
this.getGoodsClass();
|
this.getGoodsClass();
|
||||||
this.setTotalPrice();
|
this.setTotalPrice();
|
||||||
@@ -179,12 +179,13 @@ export default {
|
|||||||
let params = {
|
let params = {
|
||||||
pintuan_id: this.orderInfo.pintuan_id,
|
pintuan_id: this.orderInfo.pintuan_id,
|
||||||
}
|
}
|
||||||
// console.log(this.involvemenGroupInfo);
|
// console.log(this.orderInfo);
|
||||||
|
// console.log(this.$store.state.pintuangroup_headid);
|
||||||
if(this.orderInfo.pintuangroup_id) {
|
if(this.orderInfo.pintuangroup_id) {
|
||||||
Object.assign(params, { pintuangroup_headid: this.$store.state.pintuangroup_headid });
|
Object.assign(params, { pintuangroup_headid: this.$store.state.pintuangroup_headid });
|
||||||
Object.assign(params, { pintuangroup_id: this.orderInfo.pintuangroup_id });
|
Object.assign(params, { pintuangroup_id: this.orderInfo.pintuangroup_id });
|
||||||
}
|
}
|
||||||
// console.log(params);
|
console.log(params);
|
||||||
this.$u.api.withImmediate(params).then(res => {
|
this.$u.api.withImmediate(params).then(res => {
|
||||||
this.showGroupUser = false;
|
this.showGroupUser = false;
|
||||||
this.showInvolvementUser = false;
|
this.showInvolvementUser = false;
|
||||||
@@ -203,8 +204,11 @@ export default {
|
|||||||
this.withImmediate();
|
this.withImmediate();
|
||||||
} else if(this.orderType == 1) {
|
} else if(this.orderType == 1) {
|
||||||
this.sendOrder(0);
|
this.sendOrder(0);
|
||||||
|
} else if(this.orderType == 3) {
|
||||||
|
this.sendOrder(0);
|
||||||
|
} else {
|
||||||
|
this.sendOrder(1);
|
||||||
}
|
}
|
||||||
else this.sendOrder(1);
|
|
||||||
},
|
},
|
||||||
// @params {Number} ifcart 是否是购物车商品
|
// @params {Number} ifcart 是否是购物车商品
|
||||||
sendOrder(ifcart) {
|
sendOrder(ifcart) {
|
||||||
@@ -462,6 +466,8 @@ export default {
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
.name {
|
.name {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
|
height: 88rpx;
|
||||||
|
line-height: 44rpx;
|
||||||
color: rgba(51,51,51,1);
|
color: rgba(51,51,51,1);
|
||||||
}
|
}
|
||||||
.cart-info {
|
.cart-info {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<view class="price">¥{{ price }}</view>
|
<view class="price">¥{{ price }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="pay-view">
|
<view class="pay-view">
|
||||||
<u-radio-group v-model="pay_way" @change="radioGroupChange" size="16">
|
<u-radio-group v-model="pay_way" size="16">
|
||||||
<view v-for="(item, index) in payLiat" :key="index" class="pay-item">
|
<view v-for="(item, index) in payLiat" :key="index" class="pay-item">
|
||||||
<view class="pay-way">
|
<view class="pay-way">
|
||||||
<image :src="item.icon"></image>
|
<image :src="item.icon"></image>
|
||||||
@@ -53,12 +53,6 @@ export default {
|
|||||||
this.order_id = option.order_id;
|
this.order_id = option.order_id;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
radioGroupChange(e) {
|
|
||||||
// console.log(e);
|
|
||||||
},
|
|
||||||
// getProvider() {
|
|
||||||
// uni.getProvider({service: 'payment'})
|
|
||||||
// },
|
|
||||||
payOrder(provider, orderInfo) {
|
payOrder(provider, orderInfo) {
|
||||||
let me = this;
|
let me = this;
|
||||||
uni.requestPayment({
|
uni.requestPayment({
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<view v-for="(store, s_index) in list" :key="s_index" class="cart-item">
|
<view v-for="(store, s_index) in list" :key="s_index" class="cart-item">
|
||||||
<view class="store">
|
<view class="store">
|
||||||
<u-checkbox v-model="store.checked" shape="circle" active-color="#FF780F" icon-size="35" :name="s_index" @change="storeaAloneChange"></u-checkbox>
|
<u-checkbox v-model="store.checked" shape="circle" active-color="#FF780F" icon-size="35" :name="s_index" @change="storeaAloneChange"></u-checkbox>
|
||||||
<view class="name">
|
<view class="name" @click="viewStoreDetails(store.store_id)">
|
||||||
<image :src="store.store_avatar"></image>
|
<image :src="store.store_avatar"></image>
|
||||||
<view>{{ store.store_name }}</view>
|
<view>{{ store.store_name }}</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -12,10 +12,10 @@
|
|||||||
<view class="goods">
|
<view class="goods">
|
||||||
<u-checkbox-group @change="goodsChange($event, s_index)">
|
<u-checkbox-group @change="goodsChange($event, s_index)">
|
||||||
<view v-for="(goods, g_index) in store.goods" :key="g_index" class="goods-item">
|
<view v-for="(goods, g_index) in store.goods" :key="g_index" class="goods-item">
|
||||||
<u-checkbox v-model="goods.checked" shape="circle" active-color="#FF780F" icon-size="35" :name="g_index" ></u-checkbox>
|
<u-checkbox v-model="goods.checked" shape="circle" active-color="#FF780F" icon-size="35" :name="g_index"></u-checkbox>
|
||||||
<image :src="goods.goods_image"></image>
|
<image :src="goods.goods_image" @click="viewGoodsDetails(goods.goods_id)"></image>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="name u-line-2">{{ goods.goods_name }}</view>
|
<view class="name u-line-2" @click="viewGoodsDetails(goods.goods_id)">{{ goods.goods_name }}</view>
|
||||||
<view class="cart-info">
|
<view class="cart-info">
|
||||||
<view class="price">¥{{ goods.goods_price }}</view>
|
<view class="price">¥{{ goods.goods_price }}</view>
|
||||||
<u-number-box :input-width="38" :input-height="39" :size="22" bg-color="#FFFFFF" :disabled-input=true color="#FF780F" :index="goods.cart_id" @minus="reduce" @plus="plus" v-model="goods.goods_num"></u-number-box>
|
<u-number-box :input-width="38" :input-height="39" :size="22" bg-color="#FFFFFF" :disabled-input=true color="#FF780F" :index="goods.cart_id" @minus="reduce" @plus="plus" v-model="goods.goods_num"></u-number-box>
|
||||||
@@ -204,6 +204,23 @@ export default {
|
|||||||
})
|
})
|
||||||
this.list[value[1]].checked = checked;
|
this.list[value[1]].checked = checked;
|
||||||
this.storeChange();
|
this.storeChange();
|
||||||
|
},
|
||||||
|
viewStoreDetails(sid) {
|
||||||
|
this.$u.route({
|
||||||
|
url: 'pageC/merchant/index',
|
||||||
|
params: {
|
||||||
|
id: sid
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
viewGoodsDetails(gid) {
|
||||||
|
this.$u.route({
|
||||||
|
url: 'pageB/sdetails/index',
|
||||||
|
params: {
|
||||||
|
id: gid,
|
||||||
|
type: 1,
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onNavigationBarButtonTap(btn) {
|
onNavigationBarButtonTap(btn) {
|
||||||
@@ -221,7 +238,7 @@ export default {
|
|||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
let currentWebview = page.$getAppWebview();
|
let currentWebview = page.$getAppWebview();
|
||||||
let titleObj = currentWebview.getStyle().titleNView;
|
let titleObj = currentWebview.getStyle().titleNView;
|
||||||
console.log(JSON.stringify(titleObj.buttons[0]));
|
// console.log(JSON.stringify(titleObj.buttons[0]));
|
||||||
if (!titleObj.buttons) {
|
if (!titleObj.buttons) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -292,6 +309,7 @@ export default {
|
|||||||
.info {
|
.info {
|
||||||
width: 418rpx;
|
width: 418rpx;
|
||||||
height: 160rpx;
|
height: 160rpx;
|
||||||
|
line-height: 48rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ export default {
|
|||||||
},
|
},
|
||||||
setViewHeight() {
|
setViewHeight() {
|
||||||
const res = uni.getSystemInfoSync();
|
const res = uni.getSystemInfoSync();
|
||||||
this.scrollHeight = res.windowHeight - (90 / 2) + 'px';
|
this.scrollHeight = res.windowHeight - (res.windowWidth / 750) * 90 + 'px';
|
||||||
},
|
},
|
||||||
setTitle(title) {
|
setTitle(title) {
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
@@ -170,7 +170,7 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
> image {
|
> image {
|
||||||
width: 220rpx;
|
width: 220rpx;
|
||||||
height: 170rpx;
|
height: 200rpx;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
margin-right: 30rpx;
|
margin-right: 30rpx;
|
||||||
}
|
}
|
||||||
@@ -184,7 +184,7 @@ export default {
|
|||||||
.briefing {
|
.briefing {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: rgba(102,102,102,1);
|
color: rgba(102,102,102,1);
|
||||||
line-height: 36rpx;
|
line-height: 42rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取分类列表
|
// 获取分类列表
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="imageTop">
|
<view class="imageTop">
|
||||||
<image :src="url"></image>
|
<image :src="url" mode="widthFix"></image>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.imageTop{
|
.imageTop{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 500rpx;
|
height: 500rpx;
|
||||||
margin-bottom: 20rpx;
|
overflow: hidden;
|
||||||
>image{
|
>image{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -21,6 +22,6 @@ export default {
|
|||||||
return {
|
return {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props:['url']
|
props:['url'],
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -1,17 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="listItem">
|
<view class="listItem">
|
||||||
<video v-if="type == '2'" :src="url" :show-fullscreen-btn="true"></video>
|
<video v-if="type == '2'" :src="url" :show-fullscreen-btn="true"></video>
|
||||||
<image v-else :src="url"></image>
|
<image v-else :src="url" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.listItem{
|
.listItem{
|
||||||
width: 365rpx;
|
width: 365rpx;
|
||||||
height: 500rpx;
|
height: 500rpx;
|
||||||
margin-bottom: 20rpx;
|
overflow: hidden;
|
||||||
>image,video{
|
>image,video{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -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 {
|
|||||||
},
|
},
|
||||||
// tabs通知swiper切换
|
// tabs通知swiper切换
|
||||||
tabsChange(index) {
|
tabsChange(index) {
|
||||||
|
this.current = index;
|
||||||
this.swiperCurrent = index;
|
this.swiperCurrent = index;
|
||||||
},
|
},
|
||||||
// swiper-item左右移动,通知tabs的滑块跟随移动
|
|
||||||
transition(e) {
|
|
||||||
let dx = e.detail.dx;
|
|
||||||
this.$refs.uTabs.setDx(dx);
|
|
||||||
},
|
|
||||||
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
|
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
|
||||||
// swiper滑动结束,分别设置tabs和swiper的状态
|
// swiper滑动结束,分别设置tabs和swiper的状态
|
||||||
animationfinish(e) {
|
animationfinish(e) {
|
||||||
@@ -104,7 +104,7 @@ export default {
|
|||||||
},
|
},
|
||||||
setViewHeight() {
|
setViewHeight() {
|
||||||
const res = uni.getSystemInfoSync();
|
const res = uni.getSystemInfoSync();
|
||||||
this.swiperHeight = res.windowHeight - (88 / 2) + 'px';
|
this.swiperHeight = res.windowHeight - (res.windowWidth / 750) * 88 + 'px';
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
215
pageC/merchant/classifyGoods.vue
Normal file
@@ -0,0 +1,215 @@
|
|||||||
|
<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 - (res.windowWidth / 750) * 90 + '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>
|
||||||
@@ -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">创建时间:{{store_addtime|date}} | {{info.live_store_address}}</view>
|
<view class="info">创建时间:{{ info.store_addtime | date('yyyy年mm月dd日') }} | {{ 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">23435</view>
|
<view class="value">{{ info.evaluatecount }}</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>
|
||||||
<image></image>
|
<u-icon name="arrow-down" color="#999999" size="28"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<view class="image-list">
|
<view class="image-list" v-if="info.business_licence_number_electronic">
|
||||||
<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(){
|
onLoad(option){
|
||||||
this.$u.api.getStoreInfo({id:1}).then((res)=>{
|
this.$u.api.getStoreInfo({id: option.id}).then((res)=>{
|
||||||
console.log(res)
|
// console.log(res)
|
||||||
this.info = res.data
|
this.info = res.data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -113,11 +113,6 @@ 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;
|
||||||
|
|||||||
200
pageC/merchant/goods.vue
Normal file
@@ -0,0 +1,200 @@
|
|||||||
|
<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, index) in goodsList" :key="index" 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 == 3 && this.current == 3) this.priceOrderAsc = !this.priceOrderAsc;
|
||||||
|
this.current = current;
|
||||||
|
},
|
||||||
|
setViewHeight() {
|
||||||
|
const res = uni.getSystemInfoSync();
|
||||||
|
const otherHeight = 347 + 140 + 20 + 98;
|
||||||
|
this.scrollHeight = res.windowHeight - (res.windowWidth / 750) * otherHeight + '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>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="merchant">
|
<view class="merchant">
|
||||||
<view v-if="show">
|
<!-- <view v-if="show" class="show-hide">
|
||||||
<view>
|
<view>
|
||||||
<image></image>
|
<image></image>
|
||||||
<view>消息</view>
|
<view>消息</view>
|
||||||
@@ -13,67 +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">
|
<view class="btn" @click="attentionMember">
|
||||||
<image></image>
|
<image src="/static/image/shop/8.png"></image>
|
||||||
<view>{{ 0 ? "关注" : "已关注" }}</view>
|
<view>{{ info.is_attention == 0 ? "关注" : "已关注" }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="follow">
|
<view class="follow" v-if="info.attention_member && info.attention_member.length">
|
||||||
<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 9" :key="index" class="item">
|
<view v-for="(item, index) in info.attention_member" :key="index" class="item">
|
||||||
<image></image>
|
<image :src="item.friend_frommavatar"></image>
|
||||||
<view class="nickname u-line-1">用户昵称</view>
|
<view class="nickname u-line-1">{{ item.friend_frommname }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
<view class="main">
|
<view class="main">
|
||||||
<view class="classify" v-if="cur==0">
|
<scroll-view class="video-image" scroll-y v-if="cur==0 && indextop.length" :style="{ height: scrollHeiht }">
|
||||||
<view v-for="item in indextop" :key="item.id">
|
<view v-for="item in indextop" :key="item.id" class="container-top">
|
||||||
<videoTop :url="item.url" v-if="item.type == 2"></videoTop>
|
<videoTop :url="item.article_pic" v-if="item.type == 2" @click.native="toDetailsPage(item.article_id)"></videoTop>
|
||||||
<imageTop v-else :url="item.url"></imageTop>
|
<imageTop v-else :url="item.article_pic" @click.native="toDetailsPage(item.article_id)"></imageTop>
|
||||||
</view>
|
</view>
|
||||||
<view style="display: flex;flex-wrap: wrap;">
|
<view v-if="indexlist.length" class="container-bottom">
|
||||||
<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 v-for="item in indexlist" :key="item.id" :type="item.type" :url="item.article_pic" class="bottom-item" @click.native="toDetailsPage(item.article_id)"></listitem>
|
||||||
</view>
|
</view>
|
||||||
|
</scroll-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>
|
<goods :sid="sid"></goods>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="tabbar">
|
<view class="tabbar">
|
||||||
<view @click="cur=0">
|
<view @click="switchCurrent(0)">
|
||||||
<image></image>
|
<image src="/static/image/shop/9.png"></image>
|
||||||
<view>商品分类</view>
|
<view>商品分类</view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="cur=1">
|
<view @click="switchCurrent(1)">
|
||||||
<image></image>
|
<image src="/static/image/shop/10.png" v-if="cur != 1"></image>
|
||||||
<view>商品列表</view>
|
<image src="/static/image/shop/13.png" v-else></image>
|
||||||
|
<view :style="{ color: cur == 1 ? '#FF780F' : '#999999' }">商品列表</view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="toDetailsPage">
|
<view @click="switchCurrent(2)">
|
||||||
<image></image>
|
<image src="/static/image/shop/11.png"></image>
|
||||||
<view>店铺信息</view>
|
<view>店铺信息</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view @click="customers()">
|
||||||
<image></image>
|
<image src="/static/image/shop/12.png"></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"
|
||||||
@@ -81,47 +81,148 @@ 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: [],
|
||||||
indexlist:[],
|
indexlist: [],
|
||||||
indextop:[],
|
indextop: [],
|
||||||
info:{}
|
info: {},
|
||||||
|
page: 0,
|
||||||
|
scrollHeiht: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components:{
|
components:{
|
||||||
item,
|
goods,
|
||||||
videoTop,
|
videoTop,
|
||||||
imageTop,
|
imageTop,
|
||||||
listitem
|
listitem
|
||||||
},
|
},
|
||||||
|
onPullDownRefresh() {
|
||||||
|
this.getStoreInfo();
|
||||||
|
this.getArticlelist();
|
||||||
|
// 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: {
|
||||||
toDetailsPage() {
|
customers(){
|
||||||
uni.navigateTo({
|
console.log(this.$store.state.hasLogin)
|
||||||
url: './details'
|
if(!this.$store.state.hasLogin){
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: "请先登录",
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
function Friend(uuid, name, avatar,time = "", text = "",date = "") {
|
||||||
|
this.uuid = uuid;
|
||||||
|
this.name = name;
|
||||||
|
this.avatar = avatar;
|
||||||
|
this.online = false;
|
||||||
|
this.unReadMessage = 0;
|
||||||
|
this.text = text;
|
||||||
|
this.time = time;
|
||||||
|
this.date = date
|
||||||
|
}
|
||||||
|
console.log(123)
|
||||||
|
this.$u.api.getAtwillUserInfo({
|
||||||
|
id:this.sid
|
||||||
|
}).then((res)=>{
|
||||||
|
console.log(res)
|
||||||
|
let user = new Friend(res.data.member_id,res.data.member_nickname,res.data.member_avatar)
|
||||||
|
this.$u.route({
|
||||||
|
url:"/pageD/privateChat/privateChat",
|
||||||
|
params:{
|
||||||
|
id:JSON.stringify(user)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}).catch((err)=>{
|
||||||
|
console.log(err)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
toDetailsPage(id) {
|
||||||
|
// console.log(11);
|
||||||
|
this.$u.route('pageB/photo/index', {
|
||||||
|
id: id
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
switchCurrent(current) {
|
||||||
|
this.cur = current;
|
||||||
|
if(current == 0) {
|
||||||
|
this.$u.route('/pageC/merchant/storeClassify', { id: this.sid });
|
||||||
|
} else if(current == 2) {
|
||||||
|
this.$u.route('/pageC/merchant/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);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getArticlelist() {
|
||||||
|
this.$u.api.getArticlelist({
|
||||||
|
page: this.page,
|
||||||
|
is_video_img: 0,
|
||||||
|
store_id: this.sid,
|
||||||
|
}).then(res => {
|
||||||
|
uni.stopPullDownRefresh();
|
||||||
|
if (res.errCode == 0) {
|
||||||
|
// this.articleList = res.data.list;
|
||||||
|
if(JSON.stringify(res.data) != '[]') {
|
||||||
|
if(res.data.list.length > 0) {
|
||||||
|
this.indextop = [res.data.list[0]]
|
||||||
|
// this.indextop = [res.data.list[0], res.data.list[1]];
|
||||||
|
}
|
||||||
|
if(res.data.list.length > 1) {
|
||||||
|
this.indextop.push(res.data.list[1]);
|
||||||
|
this.indexlist.push(...res.data.list.slice(2,));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
setViewHeight() {
|
||||||
|
const res = uni.getSystemInfoSync();
|
||||||
|
this.scrollHeiht = res.windowHeight - (73 + 20 + 170) + 'px';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(){
|
onLoad(option){
|
||||||
this.$u.api.getStoreGoodsList({id:1}).then((res)=>{
|
this.sid = option.id;
|
||||||
// console.log(res.data)
|
// console.log(this.sid);
|
||||||
this.list= res.data.list
|
this.getStoreInfo();
|
||||||
})
|
this.getArticlelist();
|
||||||
this.$u.api.getStoreImgVideoList({id:1}).then((res)=>{
|
this.setViewHeight();
|
||||||
console.log(res.data)
|
// this.getStoreImgVideoList();
|
||||||
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 {
|
||||||
@@ -168,7 +269,6 @@ 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;
|
||||||
@@ -230,13 +330,32 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.main{
|
.main{
|
||||||
padding-bottom: 98rpx;
|
.video-image {
|
||||||
|
padding-bottom: 98rpx;
|
||||||
|
}
|
||||||
|
.container-top {
|
||||||
|
> view {
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.container-bottom {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
.bottom-item {
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// > 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: rgb(95, 64, 64);
|
background: rgba(251,251,251,1);
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 10rpx 55rpx;
|
padding: 10rpx 55rpx;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
@@ -251,7 +370,6 @@ 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;
|
||||||
@@ -259,12 +377,5 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.item{
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: space-between;
|
|
||||||
// margin-top: 20rpx;
|
|
||||||
padding:25rpx;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
88
pageC/merchant/storeClassify.vue
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
<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>
|
||||||
@@ -3,13 +3,13 @@
|
|||||||
<view class="title">
|
<view class="title">
|
||||||
<view class="name">全部秒杀</view>
|
<view class="name">全部秒杀</view>
|
||||||
<view class="time">
|
<view class="time">
|
||||||
<text class="num">{{ seckillTime.littleHour }}</text>
|
<text class="num">{{ seckillTime.littleHour || '00' }}</text>
|
||||||
<text class="mah">:</text>
|
<text class="mah">:</text>
|
||||||
<text class="num">00</text>
|
<text class="num">00</text>
|
||||||
<text class="mah">:</text>
|
<text class="mah">:</text>
|
||||||
<text class="num">00</text>
|
<text class="num">00</text>
|
||||||
<text>-</text>
|
<text>-</text>
|
||||||
<text class="num">{{ seckillTime.bigHour }}</text>
|
<text class="num">{{ seckillTime.bigHour || '00' }}</text>
|
||||||
<text class="mah">:</text>
|
<text class="mah">:</text>
|
||||||
<text class="num">00</text>
|
<text class="num">00</text>
|
||||||
<text class="mah">:</text>
|
<text class="mah">:</text>
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="spike-list">
|
<view class="spike-list">
|
||||||
<SpecialGoods v-for="(item, index) in spikeList" :key="index" :item="item" type='spike'></SpecialGoods>
|
<SpecialGoods v-for="(item, index) in spikeList" :key="index" :item="item" type='spike'></SpecialGoods>
|
||||||
|
<u-empty mode="list" v-if="!spikeList.length" :margin-top="240"></u-empty>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,18 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<view id="actives">
|
<view id="actives">
|
||||||
<!-- 活动消息推送 -->
|
<!-- 活动消息推送 -->
|
||||||
<view class="activity" v-for="(item, index) in actives" :key="index">
|
<block v-for="(item, index) in actives" :key="index">
|
||||||
<view class="times">{{item.type}}</view>
|
<view class="time">{{ item.addtime }}</view>
|
||||||
<view class="content">
|
<view class="activity">
|
||||||
<view class="title">{{item.title}}</view>
|
<view class="content">
|
||||||
<view class="images_about">
|
<view class="title">{{item.title}}</view>
|
||||||
<image :src="item.goods_image"></image>
|
<view class="images_about">
|
||||||
<view>
|
<image :src="item.goods_image" mode="aspectFill"></image>
|
||||||
<text>{{item.summary}}</text>
|
<view>
|
||||||
</view>
|
<text class="u-line-2">{{item.summary}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -30,13 +32,13 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
titletext(){
|
titletext(){
|
||||||
console.log("22345")
|
|
||||||
},
|
},
|
||||||
// 活动消息列表
|
// 活动消息列表
|
||||||
messageactivityList(){
|
messageactivityList(){
|
||||||
this.$u.api.messageactivityList({}).then((res)=>{
|
this.$u.api.messageactivityList({}).then((res)=>{
|
||||||
console.log(res)
|
if (res.errCode == 0) {
|
||||||
this.actives = res.data
|
this.actives = res.data;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -46,15 +48,22 @@
|
|||||||
</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 {
|
||||||
|
padding: 30rpx 0;
|
||||||
|
color: #666;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.activity{
|
.activity{
|
||||||
|
|
||||||
.times{
|
.times{
|
||||||
width:100%;
|
width:100%;
|
||||||
font-size:28rpx;
|
font-size:28rpx;
|
||||||
@@ -71,9 +80,9 @@
|
|||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
image{
|
image{
|
||||||
width: 137rpx;
|
flex-shrink: 0;
|
||||||
|
width: 140rpx;
|
||||||
height: 140rpx;
|
height: 140rpx;
|
||||||
float: left;
|
|
||||||
}
|
}
|
||||||
.title{
|
.title{
|
||||||
font-size:30rpx;
|
font-size:30rpx;
|
||||||
@@ -81,25 +90,17 @@
|
|||||||
padding: 0rpx 0 19rpx;
|
padding: 0rpx 0 19rpx;
|
||||||
}
|
}
|
||||||
.images_about{
|
.images_about{
|
||||||
overflow: hidden;
|
display: flex;
|
||||||
text{
|
& > view{
|
||||||
display: table-cell;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
width: 100%;
|
||||||
height: 140rpx;
|
height: 140rpx;
|
||||||
vertical-align: middle;
|
padding: 20rpx;
|
||||||
width: 400rpx;
|
background: rgba(241,241,241,1);
|
||||||
padding-left: 15rpx;
|
& > text {
|
||||||
line-height: 36rpx;
|
}
|
||||||
display: block;
|
|
||||||
overflow:hidden; //超出的文本隐藏
|
|
||||||
text-overflow:ellipsis; //用省略号显示
|
|
||||||
white-space:nowrap; //不换行
|
|
||||||
}
|
|
||||||
view{
|
|
||||||
display: inline-block;
|
|
||||||
float: left;
|
|
||||||
width:430rpx;
|
|
||||||
height:140rpx;
|
|
||||||
background:rgba(241,241,241,1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="attention">
|
<view class="attention">
|
||||||
<view class="attention_box" v-for="(item,index) in attention" :key="index">
|
<view class="attention_box" v-for="(item,index) in attention" :key="index" @click="navto(item.friend_tomid)">
|
||||||
<view>
|
<view>
|
||||||
<image :src="item.url"></image>
|
<image :src="item.friend_tomavatar" mode="aspectFill"></image>
|
||||||
</view>
|
</view>
|
||||||
<view>{{item.name}}</view>
|
<view>{{item.friend_tomname}}</view>
|
||||||
<view>状态:{{item.type}}</view>
|
<view>{{item.live_status ? '正在直播' : '未直播'}}</view>
|
||||||
<view class="cur_two" @click="tapClick(index)" v-if = "item.about == 1">已关注</view>
|
<view class="cur_two" @click="tapClick(index)" v-if = "item.about == 1">已关注</view>
|
||||||
<view class="cur" @click="tapClick(index)" v-else = "item.about == 2">未关注</view>
|
<view class="cur" @click="tapClick(index)" v-else = "item.about == 2">未关注</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -19,37 +19,7 @@
|
|||||||
return {
|
return {
|
||||||
rSelect:[],
|
rSelect:[],
|
||||||
type : '未关注',
|
type : '未关注',
|
||||||
attention: [{
|
attention: []
|
||||||
url: '../../pageE/static/mine/1.png',
|
|
||||||
name: '达人昵称',
|
|
||||||
type: '正在直播',
|
|
||||||
about: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '../../pageE/static/mine/1.png',
|
|
||||||
name: '达人昵称',
|
|
||||||
type: '正在直播',
|
|
||||||
about: 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '../../pageE/static/mine/1.png',
|
|
||||||
name: '达人昵称',
|
|
||||||
type: '正在直播',
|
|
||||||
about: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '../../pageE/static/mine/1.png',
|
|
||||||
name: '达人昵称',
|
|
||||||
type: '正在直播',
|
|
||||||
about: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '../../pageE/static/mine/1.png',
|
|
||||||
name: '达人昵称',
|
|
||||||
type: '正在直播',
|
|
||||||
about: 1
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(){
|
onLoad(){
|
||||||
@@ -64,13 +34,20 @@
|
|||||||
this.rSelect.push(index); //选中添加到数组里
|
this.rSelect.push(index); //选中添加到数组里
|
||||||
} else {
|
} else {
|
||||||
this.rSelect.splice(this.rSelect.indexOf(index), 1); //取消
|
this.rSelect.splice(this.rSelect.indexOf(index), 1); //取消
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
snsfriendList(){
|
snsfriendList(){
|
||||||
this.$u.api.snsfriendList({}).then((res)=>{
|
this.$u.api.snsfriendList({}).then((res)=>{
|
||||||
console.log(res)
|
this.attention = res.data;
|
||||||
// this.attention = res.data
|
})
|
||||||
|
},
|
||||||
|
navto(id){
|
||||||
|
// /pageB/details/index
|
||||||
|
this.$u.route({
|
||||||
|
url:"/pageB/details/index",
|
||||||
|
params:{
|
||||||
|
id
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -102,7 +79,7 @@
|
|||||||
view image {
|
view image {
|
||||||
width: 80rpx;
|
width: 80rpx;
|
||||||
height: 80rpx;
|
height: 80rpx;
|
||||||
display: block;
|
border-radius: 50%;
|
||||||
margin: 24rpx auto 0;
|
margin: 24rpx auto 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
62
pageD/components/GoEasyAudioPlayer/GoEasyAudioPlayer.vue
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
<template>
|
||||||
|
<div class="goeasy-audio-player" @click="playAudio">
|
||||||
|
<div class="audio-facade" :style="{width:Math.ceil(duration)*7 + 50 + 'px'}">
|
||||||
|
<div class="audio-facade-bg" :class="{'play-icon':play}"> </div>
|
||||||
|
<div>{{Math.ceil(duration) || 0}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const innerAudioContext = uni.createInnerAudioContext();
|
||||||
|
export default {
|
||||||
|
name: "GoEasyAudioPlayer",
|
||||||
|
props : ['src', 'duration'],
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
play : false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods : {
|
||||||
|
playAudio () {
|
||||||
|
this.play = true;
|
||||||
|
innerAudioContext.src = this.src;
|
||||||
|
innerAudioContext.play();
|
||||||
|
setTimeout(() => {
|
||||||
|
this.play = false;
|
||||||
|
}, this.duration*1000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.goeasy-audio-player{
|
||||||
|
margin-top: 12rpx;
|
||||||
|
-webkit-tap-highlight-color:rgba(0,0,0,0);
|
||||||
|
}
|
||||||
|
.audio-facade{
|
||||||
|
min-width: 20rpx;
|
||||||
|
padding: 6rpx 10rpx;
|
||||||
|
height: 72rpx;
|
||||||
|
line-height: 72rpx;
|
||||||
|
background: #D02129;
|
||||||
|
font-size: 24rpx;
|
||||||
|
border-radius: 14rpx;
|
||||||
|
color: #ffffff;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.audio-facade-bg{
|
||||||
|
background: url("./images/voice.png") no-repeat center;
|
||||||
|
background-size: 30rpx;
|
||||||
|
width: 40rpx;
|
||||||
|
}
|
||||||
|
.audio-facade-bg.play-icon{
|
||||||
|
background: url("./images/play.gif") no-repeat center;
|
||||||
|
background-size: 30rpx;
|
||||||
|
-moz-transform:rotate(180deg);
|
||||||
|
-webkit-transform:rotate(180deg);
|
||||||
|
-o-transform:rotate(180deg);
|
||||||
|
transform:rotate(180deg);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
BIN
pageD/components/GoEasyAudioPlayer/images/play.gif
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
pageD/components/GoEasyAudioPlayer/images/voice.png
Normal file
|
After Width: | Height: | Size: 300 B |
55
pageD/components/GoEasyVideoPlayer/GoEasyVideoPlayer.vue
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
<template>
|
||||||
|
<video
|
||||||
|
v-if="show"
|
||||||
|
class="video-player"
|
||||||
|
controls = ""
|
||||||
|
@play="onPlayStart"
|
||||||
|
id="videoPlayer"
|
||||||
|
autoplay="true"
|
||||||
|
@fullscreenchange="onVideoFullScreenChange"
|
||||||
|
:src="url">
|
||||||
|
</video>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "GoEasyVideoPlayer",
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
show : false,
|
||||||
|
context: null,
|
||||||
|
url: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods : {
|
||||||
|
play (video) {
|
||||||
|
this.show = true;
|
||||||
|
this.url = video.url;
|
||||||
|
this.context = uni.createVideoContext('videoPlayer');
|
||||||
|
},
|
||||||
|
onVideoFullScreenChange (e) {
|
||||||
|
//当退出全屏播放时,隐藏播放器
|
||||||
|
if(this.show && !e.detail.fullScreen){
|
||||||
|
this.show = false;
|
||||||
|
this.context.stop();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onPlayStart () {
|
||||||
|
//播放开始时,立即全屏
|
||||||
|
this.context.requestFullScreen({
|
||||||
|
direction : 0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.video-player{
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
BIN
pageD/components/GoEasyVideoPlayer/images/play.png
Normal file
|
After Width: | Height: | Size: 560 B |
BIN
pageD/images/Arrow-Left.png
Normal file
|
After Width: | Height: | Size: 222 B |
BIN
pageD/images/Avatar-1.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
pageD/images/Avatar-2.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
pageD/images/Avatar-3.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
pageD/images/Avatar-4.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
pageD/images/GoEasyDemo-Vue-IM-Chat-gif.gif
Normal file
|
After Width: | Height: | Size: 80 KiB |
BIN
pageD/images/Vector.png
Normal file
|
After Width: | Height: | Size: 714 B |
BIN
pageD/images/file-content.png
Normal file
|
After Width: | Height: | Size: 808 B |
BIN
pageD/images/file-icon.png
Normal file
|
After Width: | Height: | Size: 372 B |
BIN
pageD/images/file.png
Normal file
|
After Width: | Height: | Size: 463 B |
BIN
pageD/images/green-dot.png
Normal file
|
After Width: | Height: | Size: 373 B |
BIN
pageD/images/group-icon.png
Normal file
|
After Width: | Height: | Size: 502 B |
BIN
pageD/images/group.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
pageD/images/im.gif
Normal file
|
After Width: | Height: | Size: 758 KiB |
BIN
pageD/images/jianpan.png
Normal file
|
After Width: | Height: | Size: 932 B |
BIN
pageD/images/loading.gif
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
pageD/images/logo.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
pageD/images/pending.gif
Normal file
|
After Width: | Height: | Size: 771 B |
BIN
pageD/images/play.png
Normal file
|
After Width: | Height: | Size: 560 B |
BIN
pageD/images/record-appearance-icon.png
Normal file
|
After Width: | Height: | Size: 620 B |
BIN
pageD/images/recording-loading.gif
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
pageD/images/vedio.png
Normal file
|
After Width: | Height: | Size: 472 B |
@@ -25,45 +25,21 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
actives: [
|
actives: [],
|
||||||
{
|
page: 1
|
||||||
url: '../../pageE/static/mine/1.png',
|
|
||||||
name: '您的订单已发货',
|
|
||||||
type: '2020-05-14 20:11',
|
|
||||||
about: '百搭休闲格纹裙!你值得有用!'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '../../pageE/static/mine/1.png',
|
|
||||||
name: '百元趋势新品',
|
|
||||||
type: '2020-05-14 20:11',
|
|
||||||
about: '百搭休闲格纹裙!你值得有用!'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '../../pageE/static/mine/1.png',
|
|
||||||
name: '百元趋势新品',
|
|
||||||
type: '2020-05-14 20:11',
|
|
||||||
about: '百搭休闲格纹裙!你值得有用!'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '../../pageE/static/mine/1.png',
|
|
||||||
name: '百元趋势新品',
|
|
||||||
type: '2020-05-14 20:11',
|
|
||||||
about: '百搭休闲格纹裙!你值得有用!'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
url: '../../pageE/static/mine/1.png',
|
|
||||||
name: '百元趋势新品',
|
|
||||||
type: '2020-05-14 20:11',
|
|
||||||
about: '百搭休闲格纹裙!你值得有用!'
|
|
||||||
},
|
|
||||||
|
|
||||||
]
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getCartList();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
titletext(){
|
getCartList() {
|
||||||
console.log("22345")
|
this.$u.post("message/orderDeliveryList",{page: this.page}).then(res => {
|
||||||
}
|
if (res.errCode == 0) {
|
||||||
|
this.actives == res.data;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
components:{
|
components:{
|
||||||
}
|
}
|
||||||
@@ -72,7 +48,6 @@
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
#actives{
|
#actives{
|
||||||
background: #ECECEC;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
.activity{
|
.activity{
|
||||||
|
|||||||
70
pageD/notice/info.vue
Normal 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>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<!-- 公告咨询 -->
|
<!-- 公告咨询 -->
|
||||||
<notice></notice>
|
<notice :list="list"></notice>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -10,18 +10,20 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
list: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(){
|
onLoad(){
|
||||||
this.informationList()
|
this.informationList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
titletext(){
|
titletext(){
|
||||||
console.log("22345")
|
|
||||||
},
|
},
|
||||||
informationList(){
|
informationList(){
|
||||||
this.$u.api.informationList({}).then((res)=>{
|
this.$u.api.informationList({}).then((res)=>{
|
||||||
console.log(res)
|
if (res.errCode == 0) {
|
||||||
|
this.list = res.data;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
615
pageD/privateChat/privateChat.vue
Normal file
@@ -0,0 +1,615 @@
|
|||||||
|
<template>
|
||||||
|
<div class="chatInterface">
|
||||||
|
<div class="chat-scroll-container">
|
||||||
|
<scroll-view ref="myScroll" scroll-y="true" class="scroll-view" :scroll-into-view="contentPosition">
|
||||||
|
<div :class="[allHistoryLoaded ? 'top gray' : 'top']" @click="loadMoreHistoryMessage">
|
||||||
|
<span class="description">{{allHistoryLoaded ? '已经没有更多的历史消息' : '点击加载更多历史消息'}}</span>
|
||||||
|
</div>
|
||||||
|
<!--已经收到的消息-->
|
||||||
|
<div v-for="(message, key) in messages || []"
|
||||||
|
:id="'message_' + message.timestamp"
|
||||||
|
:key="message.timestamp"
|
||||||
|
class = "message-item"
|
||||||
|
:class="{'self' : message.senderId == (currentUser && currentUser.uuid)}">
|
||||||
|
<div :class="friend.online ? 'avatar' : 'avatar offline-gray'"
|
||||||
|
v-if="message.senderId != (currentUser && currentUser.uuid)">
|
||||||
|
<image :src="friend.avatar" ></image>
|
||||||
|
</div>
|
||||||
|
<div class="avatar" v-else>
|
||||||
|
<image :src="currentUser.avatar"></image>
|
||||||
|
</div>
|
||||||
|
<div class="content">
|
||||||
|
<span class="text-content" v-if="message.type =='text'">{{message.payload.text}}</span>
|
||||||
|
<image class="image-content" v-if="message.type == 'image'" :src="message.payload.url" :data-url="message.payload.url" @click="showImageFullScreen" mode="widthFix" @load="scrollToBottom"></image>
|
||||||
|
<div class="video-snapshot" v-if="message.type == 'video'" :data-url="message.payload.video.url" @click="playVideo">
|
||||||
|
<image :src="message.payload.thumbnail.url" mode="aspectFit" @load="scrollToBottom"></image>
|
||||||
|
<div class="video-play-icon"></div>
|
||||||
|
</div>
|
||||||
|
<GoEasyAudioPlayer v-if="message.type =='audio'" :src="message.payload.url" :duration="message.payload.duration" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--发送中的消息-->
|
||||||
|
<div v-for="(message, index) in pendingMessages || []"
|
||||||
|
:key="index"
|
||||||
|
:id="'pendingMessage_' + index"
|
||||||
|
class = "message-item"
|
||||||
|
:class="{'self' : message.senderId == (currentUser && currentUser.uuid)}">
|
||||||
|
<div :class="friend.online ? 'avatar' : 'avatar offline-gray'"
|
||||||
|
v-if="message.senderId != (currentUser && currentUser.uuid)">
|
||||||
|
<image :src="friend.avatar"></image>
|
||||||
|
</div>
|
||||||
|
<div class="avatar" v-else>
|
||||||
|
<image :src="currentUser.avatar"></image>
|
||||||
|
</div>
|
||||||
|
<div class="content">
|
||||||
|
<b class="pending"></b>
|
||||||
|
<span class="text-content" v-if="message.type =='text'">{{message.payload.text}}</span>
|
||||||
|
<image class="image-content" v-if="message.type == 'image'" :src="message.payload.url" mode="widthFix" @load="scrollToBottom"></image>
|
||||||
|
<div v-if="message.type == 'video'" class="video-snapshot">
|
||||||
|
<image :src="message.payload.thumbnail.url" mode="aspectFit" @load="scrollToBottom"></image>
|
||||||
|
<div class="video-play-icon"></div>
|
||||||
|
</div>
|
||||||
|
<GoEasyAudioPlayer v-if="message.type =='audio'" :src="message.payload.url" :duration="message.payload.duration" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</scroll-view>
|
||||||
|
</div>
|
||||||
|
<div class="action-box" v-if="!video.visible">
|
||||||
|
<div class="action-top">
|
||||||
|
<div :class="[audio.visible ? 'record-icon record-open':'record-icon']" @click="switchAudioKeyboard"></div>
|
||||||
|
<div class="record-input" @longpress="onRecordStart" @touchend="onRecordEnd" v-if="audio.visible" >{{audio.recording ? '松开发送' : '按住录音'}}</div>
|
||||||
|
<div class="message-input" v-else>
|
||||||
|
<input type="text" placeholder="发送消息" v-model="content">
|
||||||
|
</div>
|
||||||
|
<div class="file-icon img-video" @click="sendImage"></div>
|
||||||
|
<div class="file-icon" @click="sendVideo"></div>
|
||||||
|
<span class="send-message-btn" @click="sendMessage">发送</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="record-loading" v-if="audio.recording"></div>
|
||||||
|
<video style="width:100%;height: 100%" :src="video.url" v-if="video.visible" id="videoPlayer" autoplay="true" @fullscreenchange="onVideoFullScreenChange" @play="onVideoPlayStart"></video>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import GoEasyAudioPlayer from "../components/GoEasyAudioPlayer/GoEasyAudioPlayer";
|
||||||
|
const recorderManager = uni.getRecorderManager();
|
||||||
|
export default {
|
||||||
|
name: "privateChat",
|
||||||
|
components : {
|
||||||
|
GoEasyAudioPlayer,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
//聊天文本框
|
||||||
|
content: '',
|
||||||
|
friend: null,
|
||||||
|
currentUser: null,
|
||||||
|
//已经接收到的消息
|
||||||
|
messages: [],
|
||||||
|
//正在发送中的消息
|
||||||
|
pendingMessages : [],
|
||||||
|
//已经加载完所有历史消息
|
||||||
|
allHistoryLoaded: false,
|
||||||
|
|
||||||
|
contentPosition : '',
|
||||||
|
|
||||||
|
audio : {
|
||||||
|
//语音录音中
|
||||||
|
recording : false,
|
||||||
|
//录音按钮展示
|
||||||
|
visible : false
|
||||||
|
},
|
||||||
|
video : {
|
||||||
|
visible : false,
|
||||||
|
url : '',
|
||||||
|
context : null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch : {
|
||||||
|
//每当新增了发送中的消息,都滑动到底部
|
||||||
|
pendingMessages(){
|
||||||
|
this.scrollToBottom()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onReady () {
|
||||||
|
this.video.context = uni.createVideoContext('videoPlayer');
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
if(!this.imService.currentUser){
|
||||||
|
uni.navigateTo({
|
||||||
|
url : '../login/login'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//对话数据
|
||||||
|
this.friend = JSON.parse(options.id);
|
||||||
|
this.currentUser = this.imService.currentUser;
|
||||||
|
let privateMessages = this.imService.getPrivateMessages(this.friend.uuid);
|
||||||
|
this.messages = privateMessages.sentMessages;
|
||||||
|
this.pendingMessages = privateMessages.pendingMessages;
|
||||||
|
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
|
title : this.friend.name
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.setNavigationBarColor({
|
||||||
|
backgroundColor : '#FF780F',
|
||||||
|
frontColor : '#333333'
|
||||||
|
});
|
||||||
|
}, 10);
|
||||||
|
|
||||||
|
this.initialListeners();
|
||||||
|
|
||||||
|
//每次进入聊天页面,总是滚动到底部
|
||||||
|
this.scrollToBottom()
|
||||||
|
|
||||||
|
},
|
||||||
|
onUnload() {
|
||||||
|
//退出聊天页面之前,清空页面传入的监听器
|
||||||
|
this.imService.onNewPrivateMessageReceive = (friendId, message)=> {};
|
||||||
|
this.imService.onPrivateHistoryLoad = (friendId, messages) =>{};
|
||||||
|
//将未读消息数清零
|
||||||
|
this.imService.resetFriendUnReadMessage(this.friend);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initialListeners () {
|
||||||
|
//传入监听器,收到一条私聊消息总是滚到到页面底部
|
||||||
|
this.imService.onNewPrivateMessageReceive = (friendId, message)=> {
|
||||||
|
if (friendId == this.friend.uuid) {
|
||||||
|
//收到新消息,是滚动到最底部
|
||||||
|
this.scrollToBottom()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
//传入监听器,完成一次私聊历史加载时,如果加载结果为空,显示没有更多消息
|
||||||
|
this.imService.onPrivateHistoryLoad = (friendId, messages) =>{
|
||||||
|
if (messages.length == 0) {
|
||||||
|
//灰色,就不能点击了
|
||||||
|
this.allHistoryLoaded = true
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// 录音监听器
|
||||||
|
this.initRecorderListeners();
|
||||||
|
},
|
||||||
|
initRecorderListeners(){
|
||||||
|
var self = this;
|
||||||
|
// 监听录音开始
|
||||||
|
recorderManager.onStart(function(){
|
||||||
|
self.audio.recording = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
//录音结束后,发送
|
||||||
|
recorderManager.onStop(function(res){
|
||||||
|
self.audio.recording = false;
|
||||||
|
self.imService.sendPrivateAudioMessage(self.friend.uuid, res)
|
||||||
|
});
|
||||||
|
|
||||||
|
// 监听录音报错
|
||||||
|
recorderManager.onError(function(res){
|
||||||
|
console.log("录音报错:",res);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
sendMessage() {//发送消息
|
||||||
|
if (this.content.trim() != '') {
|
||||||
|
this.imService.sendPrivateTextMessage(this.friend.uuid, this.content);
|
||||||
|
let that = this
|
||||||
|
setTimeout(function(){
|
||||||
|
that.scrollToBottom();
|
||||||
|
},500)
|
||||||
|
}
|
||||||
|
this.content = "";
|
||||||
|
},
|
||||||
|
loadMoreHistoryMessage() {//历史消息
|
||||||
|
let lastMessageTimeStamp = Date.now();
|
||||||
|
let lastMessage = this.messages[0];
|
||||||
|
if (lastMessage) {
|
||||||
|
lastMessageTimeStamp = lastMessage.timestamp;
|
||||||
|
}
|
||||||
|
this.imService.loadPrivateHistoryMessage(this.friend.uuid, lastMessageTimeStamp);
|
||||||
|
},
|
||||||
|
onRecordStart () {
|
||||||
|
try{
|
||||||
|
recorderManager.start();
|
||||||
|
}catch(e){
|
||||||
|
console.log("e:",e);
|
||||||
|
uni.showModal({
|
||||||
|
title: '录音错误',
|
||||||
|
content : '请在app和小程序端体验录音,Uni官方明确H5不支持getRecorderManager, 详情查看Uni官方文档'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onRecordEnd () {
|
||||||
|
try{
|
||||||
|
recorderManager.stop();
|
||||||
|
}catch(e){
|
||||||
|
console.log("e:",e);
|
||||||
|
uni.showModal({
|
||||||
|
title: '录音错误',
|
||||||
|
content : '请在app和小程序端体验录音,Uni官方明确H5不支持getRecorderManager, 详情查看Uni官方文档'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sendVideo () {//发送文件
|
||||||
|
uni.chooseVideo({
|
||||||
|
success : (res) => {
|
||||||
|
console.log(res)
|
||||||
|
this.imService.sendPrivateVideoMessage(this.friend.uuid, res)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
sendImage() {
|
||||||
|
uni.chooseImage({
|
||||||
|
count :1,
|
||||||
|
success :(res) => {
|
||||||
|
console.log(res)
|
||||||
|
this.imService.sendPrivateImageMessage(this.friend.uuid,res);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
showImageFullScreen (e) {
|
||||||
|
var imagesUrl = [e.currentTarget.dataset.url];
|
||||||
|
uni.previewImage({
|
||||||
|
urls: imagesUrl
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//语音录制按钮和键盘输入的切换
|
||||||
|
switchAudioKeyboard() {
|
||||||
|
this.audio.visible = !this.audio.visible;
|
||||||
|
},
|
||||||
|
playVideo (e) {
|
||||||
|
this.video.visible = true;
|
||||||
|
this.video.url =e.currentTarget.dataset.url;
|
||||||
|
},
|
||||||
|
onVideoPlayStart () {
|
||||||
|
this.video.context.requestFullScreen({
|
||||||
|
direction : 0
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onVideoFullScreenChange (e) {
|
||||||
|
//当退出全屏播放时,隐藏播放器
|
||||||
|
if(this.video.visible && !e.detail.fullScreen){
|
||||||
|
this.video.visible = false;
|
||||||
|
this.video.context.stop();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scrollToBottom () {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if(this.messages && this.messages.length !=0){
|
||||||
|
this.contentPosition = 'message_' + (this.messages[this.messages.length-1].timestamp || '');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style >
|
||||||
|
page {
|
||||||
|
height: 100%;;
|
||||||
|
}
|
||||||
|
uni-page-body, uni-page-refresh {
|
||||||
|
height: 100%;;
|
||||||
|
}
|
||||||
|
.chatInterface{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
.chatInterface .chat-scroll-container{
|
||||||
|
overflow: hidden;
|
||||||
|
padding-left: 20rpx;
|
||||||
|
padding-right: 20rpx;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.chatInterface .scroll-view{
|
||||||
|
flex: 1;
|
||||||
|
overflow: auto;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.chatInterface .top{
|
||||||
|
font-size: 24rpx;
|
||||||
|
height: 90rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
-webkit-tap-highlight-color: transparent;
|
||||||
|
color: blue;
|
||||||
|
}
|
||||||
|
.chatInterface .top .description{
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chatInterface .message-item{
|
||||||
|
/* max-height: 400rpx; */
|
||||||
|
margin-top: 40rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.chatInterface .avatar{
|
||||||
|
width: 80rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
margin-right:20rpx ;
|
||||||
|
}
|
||||||
|
.chatInterface .message-item.self .avatar{
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
|
.chatInterface .message-item .avatar image{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chatInterface .content{
|
||||||
|
font-size: 34rpx;
|
||||||
|
line-height: 44rpx;
|
||||||
|
/* max-height: 400rpx; */
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: right;
|
||||||
|
}
|
||||||
|
.chatInterface .content .image-content{
|
||||||
|
padding: 16rpx;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
width: 300rpx;
|
||||||
|
height: 300rpx;
|
||||||
|
}
|
||||||
|
.chatInterface .content .text-content{
|
||||||
|
padding: 16rpx;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
max-width: 520rpx;
|
||||||
|
}
|
||||||
|
.chatInterface .content .pending{
|
||||||
|
background: url("../images/pending.gif") no-repeat center;
|
||||||
|
background-size: 30rpx;
|
||||||
|
width: 30rpx;
|
||||||
|
height: 30rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
flex-grow: 0;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chatInterface .action-box{
|
||||||
|
display: flex;
|
||||||
|
height: 80rpx;
|
||||||
|
padding-top: 20rpx;
|
||||||
|
padding-bottom: 20rpx;
|
||||||
|
backdrop-filter: blur(0.27rpx);
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.chatInterface .action-top{
|
||||||
|
display: flex;
|
||||||
|
padding-top: 20rpx;
|
||||||
|
padding-bottom: 20rpx;
|
||||||
|
backdrop-filter: blur(0.27rem);
|
||||||
|
height: 80rpx;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.chatInterface .record-icon{
|
||||||
|
font-size: 32rpx;
|
||||||
|
width: 80rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
text-align: center;
|
||||||
|
background: url("../images/record-appearance-icon.png") no-repeat center;
|
||||||
|
background-size: 50%;
|
||||||
|
-webkit-tap-highlight-color:rgba(0,0,0,0);
|
||||||
|
}
|
||||||
|
.chatInterface .action-top .file-icon{
|
||||||
|
background: url("../images/vedio.png") no-repeat center;
|
||||||
|
background-size: 70%;
|
||||||
|
color: #9D9D9D;
|
||||||
|
position: relative;
|
||||||
|
width:80rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
-webkit-tap-highlight-color:rgba(0,0,0,0);
|
||||||
|
}
|
||||||
|
.chatInterface .record-icon.record-open{
|
||||||
|
background: url("../images/jianpan.png") no-repeat center;
|
||||||
|
background-size: 70%;
|
||||||
|
-webkit-tap-highlight-color:rgba(0,0,0,0);
|
||||||
|
}
|
||||||
|
.chatInterface .action-top .img-video{
|
||||||
|
background: url("../images/file.png") no-repeat center;
|
||||||
|
background-size: 74%;
|
||||||
|
}
|
||||||
|
.chatInterface .record-input{
|
||||||
|
width: 480rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
border-radius: 12rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
background: #cccccc;
|
||||||
|
color: #ffffff;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.chatInterface .message-input{
|
||||||
|
border-radius: 12rpx;
|
||||||
|
}
|
||||||
|
.chatInterface .message-input input{
|
||||||
|
width: 440rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
padding-left: 20rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
.chatInterface .send-message-btn{
|
||||||
|
font-size: 32rpx;
|
||||||
|
width: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
}
|
||||||
|
.record-loading{
|
||||||
|
position: absolute;
|
||||||
|
top:50%;
|
||||||
|
left: 50%;
|
||||||
|
width: 300rpx;
|
||||||
|
height: 300rpx;
|
||||||
|
margin: -150rpx -150rpx;
|
||||||
|
background: #262628;
|
||||||
|
background: url("../images/recording-loading.gif") no-repeat center;
|
||||||
|
background-size: 100%;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
}
|
||||||
|
.chatInterface .img-layer{
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: #000000;
|
||||||
|
z-index: 9999;
|
||||||
|
padding: 6rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.chatInterface .img-layer uni-image {
|
||||||
|
height: 100%!important;
|
||||||
|
}
|
||||||
|
.chatInterface .img-layer {
|
||||||
|
height: 100%!important;
|
||||||
|
width: 100%!important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.chatInterface .content .file-content .file-info{
|
||||||
|
height: 0.5rem;
|
||||||
|
width: 1.5rem;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 0 0.1rem;
|
||||||
|
}
|
||||||
|
.chatInterface .content .file-content .file-info .title{
|
||||||
|
height: 0.3rem;
|
||||||
|
line-height: 0.3rem;
|
||||||
|
overflow: hidden;
|
||||||
|
font-size: 0.16rem;
|
||||||
|
padding: 0;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
word-break: break-all;
|
||||||
|
color: #262628;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
.chatInterface .content .file-content .file-info .size{
|
||||||
|
font-size: 0.14rem;
|
||||||
|
height: 0.2rem;
|
||||||
|
line-height: 0.2rem;
|
||||||
|
padding: 0;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
word-break: break-all;
|
||||||
|
color: #999999;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
.chatInterface .video-snapshot{
|
||||||
|
position: relative;
|
||||||
|
height: 300rpx;
|
||||||
|
max-width: 400rpx;
|
||||||
|
background: #000000;
|
||||||
|
}
|
||||||
|
.chatInterface .video-snapshot image{
|
||||||
|
max-height: 300rpx;
|
||||||
|
max-width: 400rpx;
|
||||||
|
}
|
||||||
|
.chatInterface .video-snapshot video{
|
||||||
|
max-height: 300rpx;
|
||||||
|
max-width: 400rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-snapshot .video-play-icon{
|
||||||
|
position: absolute;
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
background:url("../images/play.png") no-repeat center;
|
||||||
|
background-size: 100%;
|
||||||
|
top:50%;
|
||||||
|
left: 50%;
|
||||||
|
margin:-20rpx;
|
||||||
|
}
|
||||||
|
.chatInterface .avatar{
|
||||||
|
overflow: hidden;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
.chatInterface .avatar img{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.chatInterface .content{
|
||||||
|
float: left;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.chatInterface .content span{
|
||||||
|
font-family: Source Han Sans CN;
|
||||||
|
letter-spacing: -0.41px;
|
||||||
|
color: #262628;
|
||||||
|
background: #efefef;
|
||||||
|
display: inline-block;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
.chatInterface .message-item.self{
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
.chatInterface .message-item.self .avatar{
|
||||||
|
margin-right: 0;
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
.chatInterface .message-item.self .content{
|
||||||
|
text-align: right;
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
.chatInterface .message-item.self .content span{
|
||||||
|
color: #ffffff;
|
||||||
|
background:#FF780F;
|
||||||
|
word-break: break-all;
|
||||||
|
text-align: left;
|
||||||
|
max-width: 520rpx;
|
||||||
|
}
|
||||||
|
.chatInterface .action-box{
|
||||||
|
background: #FAFAFA;
|
||||||
|
display: flex;
|
||||||
|
align-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.chatInterface .message-input{
|
||||||
|
background: #efefef;
|
||||||
|
border: 0;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chatInterface .send-message-btn{
|
||||||
|
flex-grow: 1;
|
||||||
|
text-align: center;
|
||||||
|
color: #95949A;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chatInterface .member-layer{
|
||||||
|
width:100%;
|
||||||
|
height: 100%;
|
||||||
|
background: #FFFFFF;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
.member-layer .member{
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chatInterface .group-icon{
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chatInterface .gray{
|
||||||
|
color: gray!important;
|
||||||
|
text-decoration: none!important;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -58,5 +58,6 @@ export default {
|
|||||||
min-height: calc(100vh - var(--window-top));
|
min-height: calc(100vh - var(--window-top));
|
||||||
background: #ECECEC;
|
background: #ECECEC;
|
||||||
padding: 20rpx 35rpx 0;
|
padding: 20rpx 35rpx 0;
|
||||||
|
line-height: 45rpx;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -29,6 +29,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="edit-tips">注意:修改手机号需要原手机号获取验证码,无原手机验证码,请联系客服</view>
|
<view class="edit-tips">注意:修改手机号需要原手机号获取验证码,无原手机验证码,请联系客服</view>
|
||||||
<view class="edit-btn" @click="updateMemberInfo">完成</view>
|
<view class="edit-btn" @click="updateMemberInfo">完成</view>
|
||||||
|
<u-toast ref="uToast" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -97,8 +98,37 @@ export default {
|
|||||||
},
|
},
|
||||||
onNavigationBarButtonTap(e) {
|
onNavigationBarButtonTap(e) {
|
||||||
if( e.index == 0 ) uni.navigateBack();
|
if( e.index == 0 ) uni.navigateBack();
|
||||||
|
// if( e.index == 1 ) this.customers();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
customers(){
|
||||||
|
function Friend(uuid, name, avatar,time = "", text = "",date = "") {
|
||||||
|
this.uuid = uuid;
|
||||||
|
this.name = name;
|
||||||
|
this.avatar = avatar;
|
||||||
|
this.online = false;
|
||||||
|
this.unReadMessage = 0;
|
||||||
|
this.text = text;
|
||||||
|
this.time = time;
|
||||||
|
this.date = date
|
||||||
|
}
|
||||||
|
// console.log(123)
|
||||||
|
this.$u.api.getAtwillUserInfo({
|
||||||
|
id: 1 // 平台店铺 id
|
||||||
|
}).then((res)=>{
|
||||||
|
// console.log(res)
|
||||||
|
let user = new Friend(res.data.member_id,res.data.member_nickname,res.data.member_avatar)
|
||||||
|
this.$u.route({
|
||||||
|
url:"/pageD/privateChat/privateChat",
|
||||||
|
params:{
|
||||||
|
id:JSON.stringify(user)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}).catch((err)=>{
|
||||||
|
console.log(err)
|
||||||
|
})
|
||||||
|
},
|
||||||
changeAvatar() {
|
changeAvatar() {
|
||||||
const url = this.$u.http.config.baseUrl + '/Upload/uploadfile';
|
const url = this.$u.http.config.baseUrl + '/Upload/uploadfile';
|
||||||
uni.chooseImage({
|
uni.chooseImage({
|
||||||
@@ -155,8 +185,11 @@ export default {
|
|||||||
birthday: this.birthday,
|
birthday: this.birthday,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.errCode == 0) {
|
if (res.errCode == 0) {
|
||||||
this.getUserInfo();
|
// this.getUserInfo();
|
||||||
// this.$u.toast(res.message);
|
this.$refs.uToast.show({
|
||||||
|
title: res.message,
|
||||||
|
back: true,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="item-box" v-for="(item, index) in articleList" :key="index" @click="toDetailsPage(item.article_id)">
|
<view class="item-box" v-for="(item, index) in articleList" :key="index" @click="toDetailsPage(item.article_id)">
|
||||||
<view class="video-item" v-if="item">
|
<view class="video-item" v-if="item">
|
||||||
<image class="head" :src="item.article_pic" v-if="item.type == 1"></image>
|
<image class="head" :src="item.article_pic" mode="scaleToFill" 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>
|
||||||
<image class="head" :src="item.article_pic"></image>
|
<image class="head" :src="item.article_pic"></image>
|
||||||
@@ -44,11 +44,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.articleCollectList();
|
this.articleCollectList();
|
||||||
},
|
},
|
||||||
// 下拉刷新
|
// 下拉刷新
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
this.articleCollectList();
|
this.articleCollectList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
showAction(item) {
|
showAction(item) {
|
||||||
@@ -93,16 +93,15 @@ export default {
|
|||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
.video-item{
|
.video-item{
|
||||||
height: 540rpx;
|
width: 330rpx;
|
||||||
|
height: 510rpx;
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
width: 335rpx;
|
|
||||||
box-shadow:0 3rpx 7rpx 0 rgba(153, 153, 153, 0.35);
|
|
||||||
padding-bottom: 20rpx;
|
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
box-shadow:0 3rpx 7rpx 0 rgba(153, 153, 153, 0.35);
|
||||||
.head{
|
.head{
|
||||||
width: 100%;
|
width: 330rpx;
|
||||||
height: 334rpx;
|
height: 330rpx !important;
|
||||||
}
|
}
|
||||||
.title{
|
.title{
|
||||||
margin:0 auto;
|
margin:0 auto;
|
||||||
|
|||||||
@@ -40,13 +40,13 @@ export default {
|
|||||||
setIntegralHeight() {
|
setIntegralHeight() {
|
||||||
const res = uni.getSystemInfoSync();
|
const res = uni.getSystemInfoSync();
|
||||||
// console.log(res.windowHeight);
|
// console.log(res.windowHeight);
|
||||||
this.integralHeight = res.windowHeight - 251 / 2 + 'px';
|
this.integralHeight = res.windowHeight - (res.windowWidth / 750) * 251 + 'px';
|
||||||
},
|
},
|
||||||
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);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<scroll-view scroll-y class="medal-article">
|
<scroll-view scroll-y class="medal-article">
|
||||||
<view class="medal-title">
|
<view class="medal-title">
|
||||||
<image src="../static/mine/29.png"></image>
|
<image src="../static/mine/29.png"></image>
|
||||||
<view>了解勋章</view>
|
<view>{{ title }}</view>
|
||||||
<image src="../static/mine/30.png"></image>
|
<image src="../static/mine/30.png"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="medal-content">
|
<view class="medal-content">
|
||||||
@@ -18,6 +18,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
nodes: '',
|
nodes: '',
|
||||||
|
title: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -27,7 +28,8 @@ export default {
|
|||||||
getMemberPointsStat() {
|
getMemberPointsStat() {
|
||||||
this.$u.api.getMemberPointsStat().then((res)=>{
|
this.$u.api.getMemberPointsStat().then((res)=>{
|
||||||
if (res.errCode == 0) {
|
if (res.errCode == 0) {
|
||||||
const nodes = res.data.grade_rule;
|
this.title = res.data.grade_rule.document_title;
|
||||||
|
const nodes = res.data.grade_rule.document_content;
|
||||||
this.nodes = common.unescapeHTML(nodes);
|
this.nodes = common.unescapeHTML(nodes);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -117,9 +117,9 @@ export default {
|
|||||||
setViewHeight() {
|
setViewHeight() {
|
||||||
const res = uni.getSystemInfoSync();
|
const res = uni.getSystemInfoSync();
|
||||||
// console.log(res.windowHeight);
|
// console.log(res.windowHeight);
|
||||||
this.richHeight = res.windowHeight - (88 + 250) / 2 + 'px';
|
this.richHeight = res.windowHeight - (88 + 250) * (res.windowWidth / 750) + 'px';
|
||||||
// console.log(this.richHeight);
|
// console.log(this.richHeight);
|
||||||
this.swiperHeight = res.windowHeight - 88 / 2 + 'px';
|
this.swiperHeight = res.windowHeight - (res.windowWidth / 750) * 88 + 'px';
|
||||||
},
|
},
|
||||||
viewProgress() {
|
viewProgress() {
|
||||||
this.$u.route({
|
this.$u.route({
|
||||||
|
|||||||
@@ -1,17 +1,27 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="coupon-swiper">
|
<view class="coupon-swiper">
|
||||||
<u-tabs-swiper ref="coupon" :list="couponGroupList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="couponCurrent" font-size="24" :show-bar="false" @change="couponTabsChange" height="88" ></u-tabs-swiper>
|
<!-- <scroll-view scroll-x="true" class="classify-coupon">
|
||||||
|
<view v-for="(classify, index) in couponGroupList" :key="index" class="classify-item" :class="{ 'active': couponCurrent == index }" @click="couponTabsChange(index)">{{ classify.gc_name }}</view>
|
||||||
|
</scroll-view> -->
|
||||||
|
<u-tabs :list="couponGroupList" name="gc_name" :is-scroll="true" :current="couponCurrent" @change="couponTabsChange" active-color="#FF780F" :show-bar="false" height="88" font-size="24" inactive-color="#333333"></u-tabs>
|
||||||
<swiper :current="swiperCouponCurrent" @animationfinish="couponAnimationFinish" :style="{ height: swiperHeight }">
|
<swiper :current="swiperCouponCurrent" @animationfinish="couponAnimationFinish" :style="{ height: swiperHeight }">
|
||||||
<swiper-item class="swiper-coupon-item" v-for="(_, i) in couponGroupList" :key="i">
|
<swiper-item class="swiper-coupon-item" v-for="(_, i) in couponGroupList" :key="i">
|
||||||
<scroll-view scroll-y style="height: 100%;" @scrolltolower="onreachBottom">
|
<scroll-view scroll-y style="height: 100%;" @scrolltolower="onreachBottom" class="coupon-scroll">
|
||||||
<view v-for="(coupon, index) in couponList" :key="index" class="coupon-item">
|
<view v-for="(coupon, index) in couponList[i]" :key="index" class="coupon-item">
|
||||||
<Coupon :couponInfo="coupon" :status='0' :type="0" @exchange="exchangeCoupon($event)"></Coupon>
|
<Coupon :couponInfo="coupon" :status='0' :type="0" @exchange="exchangeCoupon($event)"></Coupon>
|
||||||
</view>
|
</view>
|
||||||
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20" v-if="couponList.length>=pageSize" @loadmore="onreachBottom"></u-loadmore>
|
<u-empty text="暂无优惠券" mode="coupon" color="#000" v-if="!couponList[i] || !couponList[i].length"></u-empty>
|
||||||
<u-empty text="暂无优惠券" mode="coupon" color="#000" v-if="!couponList.length"></u-empty>
|
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-bottom="60" v-if="!couponList[i] || couponList[i].length>=pageSize" @loadmore="onreachBottom"></u-loadmore>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
|
<!-- <scroll-view scroll-y style="height: 100%;" @scrolltolower="onreachBottom" class="coupon-scroll" :style="{ height: swiperHeight }">
|
||||||
|
<view v-for="(coupon, index) in couponList" :key="index" class="coupon-item">
|
||||||
|
<Coupon :couponInfo="coupon" :status='0' :type="0" @exchange="exchangeCoupon($event)"></Coupon>
|
||||||
|
</view>
|
||||||
|
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20" v-if="couponList.length>=pageSize" @loadmore="onreachBottom"></u-loadmore>
|
||||||
|
<u-empty text="暂无优惠券" mode="coupon" color="#000" v-if="!couponList.length"></u-empty>
|
||||||
|
</scroll-view> -->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -19,7 +29,7 @@ import Coupon from "@/components/mine/coupon/index";
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
pageSize: 12,
|
pageSize: 5, // 页面显示的条数
|
||||||
swiperHeight: '',
|
swiperHeight: '',
|
||||||
couponCurrent: 0,
|
couponCurrent: 0,
|
||||||
swiperCouponCurrent: 0,
|
swiperCouponCurrent: 0,
|
||||||
@@ -39,9 +49,10 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
couponCurrent(index) {
|
couponCurrent(index) {
|
||||||
|
// this.couponList = [];
|
||||||
const id = this.couponGroupList[index].gc_id;
|
const id = this.couponGroupList[index].gc_id;
|
||||||
this.getCouponList({ gc_id: id, load: 'reload' });
|
this.getCouponList({ gc_id: id, load: 'reload' });
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onreachBottom() {
|
onreachBottom() {
|
||||||
@@ -78,9 +89,10 @@ export default {
|
|||||||
})
|
})
|
||||||
this.timer = true;
|
this.timer = true;
|
||||||
if(res.errCode == 0) {
|
if(res.errCode == 0) {
|
||||||
if(load == 'reload') this.couponList = res.data;
|
if(load == 'reload') this.couponList[this.couponCurrent] = res.data;
|
||||||
else if(load == 'loadmore') this.couponList.push(...res.data);
|
else if(load == 'loadmore') this.couponList[this.couponCurrent].push(...res.data);
|
||||||
}
|
}
|
||||||
|
this.$forceUpdate();
|
||||||
return res.data.length;
|
return res.data.length;
|
||||||
},
|
},
|
||||||
exchangeCoupon(id) {
|
exchangeCoupon(id) {
|
||||||
@@ -89,6 +101,7 @@ export default {
|
|||||||
},
|
},
|
||||||
couponTabsChange(index) {
|
couponTabsChange(index) {
|
||||||
this.couponCurrent = index;
|
this.couponCurrent = index;
|
||||||
|
this.swiperCouponCurrent = this.couponCurrent;
|
||||||
},
|
},
|
||||||
couponAnimationFinish(e) {
|
couponAnimationFinish(e) {
|
||||||
const current = e.detail.current;
|
const current = e.detail.current;
|
||||||
@@ -97,71 +110,99 @@ export default {
|
|||||||
},
|
},
|
||||||
setViewHeight() {
|
setViewHeight() {
|
||||||
const res = uni.getSystemInfoSync();
|
const res = uni.getSystemInfoSync();
|
||||||
this.swiperHeight = res.windowHeight - ((88 + 10 + 88) / 2) + 'px';
|
this.swiperHeight = res.windowHeight - ((88 + 10 + 88) * (res.windowWidth / 750)) + 'px';
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.coupon-swiper {
|
.coupon-swiper {
|
||||||
.swiper-coupon-item {
|
.classify-coupon {
|
||||||
box-sizing: border-box;
|
white-space: nowrap;
|
||||||
|
width: 100%;
|
||||||
|
height: 88rpx;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
padding: 30rpx {
|
margin-bottom: 2rpx;
|
||||||
top: 0;
|
.classify-item {
|
||||||
};
|
display: inline-block;
|
||||||
.coupon-item {
|
line-height: 88rpx;
|
||||||
margin-bottom: 20rpx;
|
text-align: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #333;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
}
|
||||||
|
.active {
|
||||||
|
color: #FF780F;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// .swiper-coupon-item {
|
||||||
|
// box-sizing: border-box;
|
||||||
|
// background-color: #ffffff;
|
||||||
|
// padding: 30rpx {
|
||||||
|
// top: 0;
|
||||||
|
// };
|
||||||
|
// .coupon-item {
|
||||||
|
// margin-bottom: 20rpx;
|
||||||
|
// }
|
||||||
|
// .coupon-item {
|
||||||
|
// padding: 30rpx;
|
||||||
|
// background-color: #ffffff;
|
||||||
|
// display: flex;
|
||||||
|
// align-items: flex-end;
|
||||||
|
// // margin-bottom: 2rpx;
|
||||||
|
// > img {
|
||||||
|
// width: 180rpx;
|
||||||
|
// height: 160rpx;
|
||||||
|
// border-radius: 10rpx;
|
||||||
|
// margin-right: 30rpx;
|
||||||
|
// }
|
||||||
|
// .coupon-main {
|
||||||
|
// .coupon-title {
|
||||||
|
// font-size: 30rpx;
|
||||||
|
// color: rgba(51,51,51,1);
|
||||||
|
// }
|
||||||
|
// .coupon-date {
|
||||||
|
// display: flex;
|
||||||
|
// align-items: center;
|
||||||
|
// margin: 29rpx 0 20rpx;
|
||||||
|
// > img {
|
||||||
|
// width: 24rpx;
|
||||||
|
// height: 24rpx;
|
||||||
|
// margin-right: 15rpx;
|
||||||
|
// }
|
||||||
|
// > view {
|
||||||
|
// font-size: 24rpx;
|
||||||
|
// color: rgba(153,153,153,1);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// .coupon-integral {
|
||||||
|
// font-size: 30rpx;
|
||||||
|
// font-weight: 500;
|
||||||
|
// color: rgba(255,120,15,1);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// .coupon-btn {
|
||||||
|
// margin-left: auto;
|
||||||
|
// width: 85rpx;
|
||||||
|
// // height: 42rpx;
|
||||||
|
// border: 2rpx solid rgba(255,120,15,1);
|
||||||
|
// border-radius: 10rpx;
|
||||||
|
// font-size: 26rpx;
|
||||||
|
// color: rgba(255,120,15,1);
|
||||||
|
// line-height: 42rpx;
|
||||||
|
// text-align: center;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
.coupon-scroll {
|
||||||
|
background-color: #ffffff;
|
||||||
|
padding-top: 30rpx;
|
||||||
|
.coupon-item {
|
||||||
|
padding: 30rpx {
|
||||||
|
top: 0;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
// .coupon-item {
|
|
||||||
// padding: 30rpx;
|
|
||||||
// background-color: #ffffff;
|
|
||||||
// display: flex;
|
|
||||||
// align-items: flex-end;
|
|
||||||
// // margin-bottom: 2rpx;
|
|
||||||
// > img {
|
|
||||||
// width: 180rpx;
|
|
||||||
// height: 160rpx;
|
|
||||||
// border-radius: 10rpx;
|
|
||||||
// margin-right: 30rpx;
|
|
||||||
// }
|
|
||||||
// .coupon-main {
|
|
||||||
// .coupon-title {
|
|
||||||
// font-size: 30rpx;
|
|
||||||
// color: rgba(51,51,51,1);
|
|
||||||
// }
|
|
||||||
// .coupon-date {
|
|
||||||
// display: flex;
|
|
||||||
// align-items: center;
|
|
||||||
// margin: 29rpx 0 20rpx;
|
|
||||||
// > img {
|
|
||||||
// width: 24rpx;
|
|
||||||
// height: 24rpx;
|
|
||||||
// margin-right: 15rpx;
|
|
||||||
// }
|
|
||||||
// > view {
|
|
||||||
// font-size: 24rpx;
|
|
||||||
// color: rgba(153,153,153,1);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// .coupon-integral {
|
|
||||||
// font-size: 30rpx;
|
|
||||||
// font-weight: 500;
|
|
||||||
// color: rgba(255,120,15,1);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// .coupon-btn {
|
|
||||||
// margin-left: auto;
|
|
||||||
// width: 85rpx;
|
|
||||||
// // height: 42rpx;
|
|
||||||
// border: 2rpx solid rgba(255,120,15,1);
|
|
||||||
// border-radius: 10rpx;
|
|
||||||
// font-size: 26rpx;
|
|
||||||
// color: rgba(255,120,15,1);
|
|
||||||
// line-height: 42rpx;
|
|
||||||
// text-align: center;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
<view class="concerns-container">
|
<view class="concerns-container">
|
||||||
<view v-for="(info, index) in list" :key="index">
|
<view v-for="(info, index) in list" :key="index">
|
||||||
<view class="daren-item">
|
<view class="daren-item">
|
||||||
<image class="head" :src="info.friend_tomavatar"></image>
|
<image class="head" :src="info.friend_tomavatar" @click="viewDetails(info.friend_tomid)"></image>
|
||||||
<text class="name">{{ info.friend_tomname || '' }}</text>
|
<text class="name" @click="viewDetails(info.friend_tomid)">{{ info.friend_tomname || '' }}</text>
|
||||||
<view class="guanzhu" @click="changeType(info.friend_tomid)" v-if="info.friend_followstate == 1">取消关注</view>
|
<view class="guanzhu" @click="changeType(info.friend_tomid)" v-if="info.friend_followstate == 1">取消关注</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -37,6 +37,11 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
viewDetails(id) {
|
||||||
|
this.$u.route('pageB/details/index', {
|
||||||
|
id: id
|
||||||
|
});
|
||||||
|
},
|
||||||
changeType(id) {
|
changeType(id) {
|
||||||
console.log(id);
|
console.log(id);
|
||||||
this.$u.api.attentionMember({
|
this.$u.api.attentionMember({
|
||||||
|
|||||||
@@ -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" v-if="memberInfo.level_rule">
|
||||||
<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;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -118,7 +121,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.body {
|
.body {
|
||||||
margin-top: 60rpx;
|
margin-top: 20rpx;
|
||||||
.title {
|
.title {
|
||||||
height: 88rpx;
|
height: 88rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -128,7 +131,7 @@ export default {
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: rgba(51,51,51,1);
|
color: rgba(51,51,51,1);
|
||||||
// border-bottom: #ECECEC 1rpx solid;
|
// border-bottom: #ECECEC 1rpx solid;
|
||||||
margin-bottom: 30rpx;
|
margin-bottom: 20rpx;
|
||||||
> image {
|
> image {
|
||||||
width: 29rpx;
|
width: 29rpx;
|
||||||
height: 36rpx;
|
height: 36rpx;
|
||||||
|
|||||||