Compare commits
29 Commits
lxb
...
1da6974fe3
| Author | SHA1 | Date | |
|---|---|---|---|
|
1da6974fe3
|
|||
|
bd996de410
|
|||
|
2ec14481fd
|
|||
|
b9b8384011
|
|||
| cdd0105acb | |||
| 6d00107944 | |||
| 04adc72d92 | |||
| 120e062fcd | |||
| 2851c8e0b2 | |||
|
|
8bb1cdfd39 | ||
| f21df2f107 | |||
|
ee08038a64
|
|||
| 280915560d | |||
|
41f4050768
|
|||
| b12a3c1722 | |||
|
4004f3715b
|
|||
| 208f27aa93 | |||
| 6eabd3a575 | |||
|
2ea9b89acc
|
|||
| 100f31c6f9 | |||
|
b2d284f666
|
|||
| dbafe8b4c1 | |||
| 185f5979b6 | |||
| 410a7850e6 | |||
| c931e87209 | |||
| 94636380f1 | |||
| 5abb3f2496 | |||
| a1b14b4f5e | |||
| dd71a0f32a |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
|||||||
/node_modules/*
|
/node_modules/*
|
||||||
unpackage
|
unpackage
|
||||||
manifest.json
|
manifest.json
|
||||||
|
deming.keystore
|
||||||
@@ -253,12 +253,51 @@ export default {
|
|||||||
tabLiveList(){
|
tabLiveList(){
|
||||||
return vm.$u.post('Specialci/tabLiveList')
|
return vm.$u.post('Specialci/tabLiveList')
|
||||||
},
|
},
|
||||||
|
// 商城-活动广告
|
||||||
|
getStoreActivity() {
|
||||||
|
return vm.$u.post('adv/storeActivity')
|
||||||
|
},
|
||||||
// 获取图文视频详情
|
// 获取图文视频详情
|
||||||
articleInfo({article_id}){
|
articleInfo({article_id}){
|
||||||
return vm.$u.post('article/articleInfo',{article_id})
|
return vm.$u.post('article/articleInfo',{article_id})
|
||||||
},
|
},
|
||||||
getStoreInfo({id}){
|
getStoreInfo({id}){
|
||||||
return vm.$u.post('Store/getStoreInfo',{id})
|
return vm.$u.post('Store/getStoreInfo',{id})
|
||||||
|
},
|
||||||
|
// 评论标签+数量
|
||||||
|
getEvaluateSpec({ id }) {
|
||||||
|
return vm.$u.post('Specialci/getEvaluateSpec', {
|
||||||
|
goods_id: id,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获取商品评论
|
||||||
|
getAllEvalue({ goods_id, page, type }) {
|
||||||
|
return vm.$u.post('Specialci/getAllEvalue', {
|
||||||
|
goods_id: goods_id,
|
||||||
|
page: page,
|
||||||
|
type: type,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 搜索发现列表
|
||||||
|
searchwordlist() {
|
||||||
|
return vm.$u.post('ShopSearch/searchwordlist')
|
||||||
|
},
|
||||||
|
// 提交试穿订单
|
||||||
|
saveGoodsTry({ member_name, member_mobile, area_info, address_detail, goods_id, num, store_id, appointment_time }) {
|
||||||
|
return vm.$u.post('Order/saveGoodsTry', {
|
||||||
|
member_name: member_name,
|
||||||
|
member_mobile: member_mobile,
|
||||||
|
area_info: area_info,
|
||||||
|
address_detail: address_detail,
|
||||||
|
goods_id: goods_id,
|
||||||
|
num: num,
|
||||||
|
store_id: store_id,
|
||||||
|
appointment_time: appointment_time,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 达人上架商品
|
||||||
|
goodsShelves({live_id}){
|
||||||
|
return vm.$u.post('Specialci/goodsShelves',{live_id})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -240,6 +240,14 @@ export default {
|
|||||||
getAfterSaleList({ page }) {
|
getAfterSaleList({ page }) {
|
||||||
return vm.$u.post('order/afterSaleList', { page: page });
|
return vm.$u.post('order/afterSaleList', { page: page });
|
||||||
},
|
},
|
||||||
|
// 试穿列表
|
||||||
|
goodsTryOrderList() {
|
||||||
|
return vm.$u.post('order/goodsTryOrderList');
|
||||||
|
},
|
||||||
|
// 试穿订单确认完成
|
||||||
|
goodsTryConfirm({ id }) {
|
||||||
|
return vm.$u.post('order/goodsTryConfirm', { id: id });
|
||||||
|
},
|
||||||
// 订单详情
|
// 订单详情
|
||||||
getOrderInfo({ order_id }) {
|
getOrderInfo({ order_id }) {
|
||||||
return vm.$u.post('Order/orderInfo', { order_id: order_id });
|
return vm.$u.post('Order/orderInfo', { order_id: order_id });
|
||||||
@@ -262,6 +270,9 @@ export default {
|
|||||||
getOrderEvaluateInfo({ id }) {
|
getOrderEvaluateInfo({ id }) {
|
||||||
return vm.$u.post('Order/getOrderEvaluateInfo', { id: id });
|
return vm.$u.post('Order/getOrderEvaluateInfo', { id: id });
|
||||||
},
|
},
|
||||||
|
orderLogistics({ id }) {
|
||||||
|
return vm.$u.post('Order/orderLogistics', { order_id: id });
|
||||||
|
},
|
||||||
// 订单评价/修改评价
|
// 订单评价/修改评价
|
||||||
updateOrderEvaluate({ id, content, scores_one, scores_two, scores_three, file }) {
|
updateOrderEvaluate({ id, content, scores_one, scores_two, scores_three, file }) {
|
||||||
let params = {
|
let params = {
|
||||||
@@ -326,6 +337,62 @@ export default {
|
|||||||
code: code,
|
code: code,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 送洗列表-平台订单 实体店订单
|
||||||
|
sendLaundryOrderList({ type, page }) {
|
||||||
|
return vm.$u.post('member/sendLaundryOrderList', {
|
||||||
|
type: type,
|
||||||
|
page: page,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 送洗-获取衣服类型
|
||||||
|
getClothesTypeList() {
|
||||||
|
return vm.$u.post('member/getClothesTypeList');
|
||||||
|
},
|
||||||
|
// 送洗评价
|
||||||
|
sendOrderComment({ id, comment }) {
|
||||||
|
return vm.$u.post('member/sendOrderComment', {
|
||||||
|
id: id,
|
||||||
|
comment: comment,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 送洗确认完成
|
||||||
|
sendLaundryOrderConfirm({ id }) {
|
||||||
|
return vm.$u.post('member/sendOrderConfirm', {
|
||||||
|
id: id,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 提交送洗
|
||||||
|
sendLaundrySave({
|
||||||
|
type,
|
||||||
|
tid,
|
||||||
|
condition,
|
||||||
|
member_name,
|
||||||
|
member_phone,
|
||||||
|
area_info,
|
||||||
|
address_info,
|
||||||
|
goods_name,
|
||||||
|
order_id,
|
||||||
|
goods_id,
|
||||||
|
goods_images,
|
||||||
|
}) {
|
||||||
|
return vm.$u.post('member/sendLaundrySave', {
|
||||||
|
type: type,
|
||||||
|
tid: tid,
|
||||||
|
condition: condition,
|
||||||
|
member_name: member_name,
|
||||||
|
member_phone: member_phone,
|
||||||
|
area_info: area_info,
|
||||||
|
address_info: address_info,
|
||||||
|
goods_name: goods_name,
|
||||||
|
order_id: order_id,
|
||||||
|
goods_id: goods_id,
|
||||||
|
goods_images: goods_images,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 送洗评论列表
|
||||||
|
sendCommentList() {
|
||||||
|
return vm.$u.post('member/sendCommentList');
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import Vuex from 'vuex'
|
import Vuex from 'vuex'
|
||||||
|
import {
|
||||||
|
mapMutations
|
||||||
|
} from 'vuex';
|
||||||
|
|
||||||
Vue.use(Vuex)
|
Vue.use(Vuex)
|
||||||
|
|
||||||
const store = new Vuex.Store({
|
const store = new Vuex.Store({
|
||||||
@@ -12,10 +16,12 @@ const store = new Vuex.Store({
|
|||||||
pintuangroup_headid: '', // 拼团团长id 有为开团 无为参团
|
pintuangroup_headid: '', // 拼团团长id 有为开团 无为参团
|
||||||
groupbuyInfo: {}, // 秒杀详情
|
groupbuyInfo: {}, // 秒杀详情
|
||||||
loadmore: {}, // 下拉加载返回的数据
|
loadmore: {}, // 下拉加载返回的数据
|
||||||
|
hasLogin: false, // 登录状态
|
||||||
|
token: "" // 储存token
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
getOrderAddress(state) {
|
getOrderAddress(state) {
|
||||||
return state.orderAddress;
|
return state.orderAddress || {};
|
||||||
},
|
},
|
||||||
getGoodsType(state) {
|
getGoodsType(state) {
|
||||||
return state.goodsDetails.type;
|
return state.goodsDetails.type;
|
||||||
@@ -25,6 +31,23 @@ const store = new Vuex.Store({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
|
// 登录
|
||||||
|
loginIn(state, token) {
|
||||||
|
state.hasLogin = true;
|
||||||
|
state.token = token;
|
||||||
|
uni.setStorage({
|
||||||
|
key: "token",
|
||||||
|
data: token
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 退出登录
|
||||||
|
logout(state) {
|
||||||
|
state.hasLogin = false;
|
||||||
|
state.token = "";
|
||||||
|
uni.removeStorage({
|
||||||
|
key: "token"
|
||||||
|
})
|
||||||
|
},
|
||||||
setOrderType(state, type) {
|
setOrderType(state, type) {
|
||||||
state.orderType = type;
|
state.orderType = type;
|
||||||
},
|
},
|
||||||
@@ -48,7 +71,7 @@ const store = new Vuex.Store({
|
|||||||
},
|
},
|
||||||
setLoadMore(state, info) {
|
setLoadMore(state, info) {
|
||||||
state.loadmore = info;
|
state.loadmore = info;
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
export default store;
|
export default store;
|
||||||
115
components/comment/index.vue
Normal file
115
components/comment/index.vue
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
<template>
|
||||||
|
<view class="comment-item">
|
||||||
|
<view class="user">
|
||||||
|
<u-avatar :src="content.member_avatar" class="avatar" size="60"></u-avatar>
|
||||||
|
<text class="name">{{ content.geval_frommembername }}</text>
|
||||||
|
<u-rate v-if="reply" :disabled='true' count="count" v-model="rate" size="23" active-color="#FF780F" inactive-color="#F0EDF1" gutter="10"></u-rate>
|
||||||
|
</view>
|
||||||
|
<view class="content">
|
||||||
|
<view class="text">{{ content.geval_content }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="image-container">
|
||||||
|
<image :src="src" v-for="(src, index) in content.geval_image" :key="index"></image>
|
||||||
|
</view>
|
||||||
|
<view class="reply" v-if="reply && content.geval_explain">
|
||||||
|
<view class="title">掌柜回复:</view>
|
||||||
|
<view class="content u-line-4">{{ content.geval_explain }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="time" v-if="reply">
|
||||||
|
<image src="/static/image/common/20.png"></image>
|
||||||
|
<view class="value">{{ content.geval_addtime }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
/*
|
||||||
|
* @description 显示评价
|
||||||
|
* @property {Boolean} reply 是否显示回复/时间/评分
|
||||||
|
**/
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
count: 5,
|
||||||
|
rate: 2,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
content: Object,
|
||||||
|
reply: Boolean,
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
if(this.content.hasOwnProperty('scores_two')) this.rate = this.content.scores_two;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.comment-item {
|
||||||
|
background-color: #ffffff;
|
||||||
|
.user {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
.name {
|
||||||
|
margin: 0 20rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: rgba(153,153,153,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
.text {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: rgba(51,51,51,1);
|
||||||
|
line-height: 40rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
}
|
||||||
|
> image {
|
||||||
|
width: 210rpx;
|
||||||
|
height: 210rpx;
|
||||||
|
border-radius: 10px;
|
||||||
|
&:not(:nth-child(3n)) {
|
||||||
|
margin-right: 30rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.image-container {
|
||||||
|
margin: 20rpx 0;
|
||||||
|
> image {
|
||||||
|
width: 210rpx;
|
||||||
|
height: 210rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
&:not(:nth-child(3n)) {
|
||||||
|
margin-right: 30rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.reply {
|
||||||
|
padding: 30rpx;
|
||||||
|
background: rgba(240,238,238,1);
|
||||||
|
border-radius: 10rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: rgba(102,102,102,1);
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
.title {
|
||||||
|
margin-bottom: 16rpx;
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
line-height: 36rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.time {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
> image {
|
||||||
|
width: 28rpx;
|
||||||
|
height: 28rpx;
|
||||||
|
margin-right: 12rpx;
|
||||||
|
}
|
||||||
|
.value {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: rgba(153,153,153,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="zhibo">
|
<view class="zhibo" @click="zhibo">
|
||||||
<image class="head"></image>
|
<image class="head" :src="image"></image>
|
||||||
<view class="user">
|
<view class="user">
|
||||||
<view class="name">
|
<view class="name">
|
||||||
<image></image>
|
<image></image>
|
||||||
<text>这是名字</text>
|
<text class="u-line-1" style="width:130rpx">{{name}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="pingbi">
|
<view class="pingbi">
|
||||||
<image></image>
|
<image></image>
|
||||||
<text>屏蔽用户</text>
|
<text>1屏蔽用户</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -70,6 +70,19 @@ export default {
|
|||||||
return {
|
return {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
zhibo(){
|
||||||
|
this.$u.route({
|
||||||
|
url:"/pages/zhibo/index",
|
||||||
|
params:{
|
||||||
|
url:this.url,
|
||||||
|
id:this.zid,
|
||||||
|
rid:this.rid
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props:['name','image','url','zid','rid']
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -42,17 +42,6 @@ export default {
|
|||||||
// this.loadStatus = "nomore";
|
// this.loadStatus = "nomore";
|
||||||
// this.tpage--;
|
// this.tpage--;
|
||||||
// })
|
// })
|
||||||
// this.$parent.callback({ page: this.tpage }).then(length => {
|
|
||||||
// if(length == 0) {
|
|
||||||
// this.tpage--;
|
|
||||||
// this.status = 'nomore';
|
|
||||||
// } else {
|
|
||||||
// this.status = 'loading';
|
|
||||||
// }
|
|
||||||
// }).catch(() => {
|
|
||||||
// this.loadStatus = "nomore";
|
|
||||||
// this.tpage--;
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -118,19 +118,11 @@ export default {
|
|||||||
// latitude,
|
// latitude,
|
||||||
}).then((res)=>{
|
}).then((res)=>{
|
||||||
if (res.errCode == 0) {
|
if (res.errCode == 0) {
|
||||||
uni.redirectTo({
|
this.$refs.uToast.show({
|
||||||
url: '/pageE/more/Address'
|
title: res.message,
|
||||||
});
|
type: 'success',
|
||||||
// this.$refs.uToast.show({
|
back: true,
|
||||||
// title: res.message,
|
})
|
||||||
// type: 'success',
|
|
||||||
// // url: '/pageE/more/Address',
|
|
||||||
// callback() {
|
|
||||||
// uni.redirectTo({
|
|
||||||
// url: '/pageE/more/Address'
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
} else {
|
} else {
|
||||||
this.showToast(res.message, 'warning');
|
this.showToast(res.message, 'warning');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="comment">
|
<view class="comment">
|
||||||
<view class="user-info">
|
<view class="user-info">
|
||||||
<image src="@/pageE/static/mine/23.png" class="user-avatar"></image>
|
<image :src="info.member_avatar" class="user-avatar"></image>
|
||||||
<view class="user-name">***雪</view>
|
<view class="user-name">{{ info.member_nickname }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="user-comment">
|
<view class="user-comment">
|
||||||
<view class="text u-line-2">宝贝收到了和卖家描述的一样,质量不错,很漂亮一直想买这样的杯子,这个蓝色的稍微有点小瑕疵,不过自己用没问题没问题没问题</view>
|
<view class="text u-line-2">{{ info.comment }}</view>
|
||||||
<view class="image">
|
<view class="image">
|
||||||
<image v-for="(src, index) in ImageList" :key="index" :src="src" mode="aspectFit"></image>
|
<image v-for="(src, index) in info.images" :key="index" :src="src" mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -15,14 +15,10 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {}
|
||||||
ImageList: [
|
},
|
||||||
require('@/pageE/static/mine/23.png'),
|
props: {
|
||||||
require('@/pageE/static/mine/23.png'),
|
info: Object,
|
||||||
require('@/pageE/static/mine/23.png'),
|
|
||||||
require('@/pageE/static/mine/23.png')
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -12,9 +12,11 @@
|
|||||||
<image :src="goods.goods_image"></image>
|
<image :src="goods.goods_image"></image>
|
||||||
<view class="goods-text">
|
<view class="goods-text">
|
||||||
<view class="goods-name u-line-2">{{ goods.goods_name }}</view>
|
<view class="goods-name u-line-2">{{ goods.goods_name }}</view>
|
||||||
<view class="goods-sku u-line-1" v-if="order.order_state !== 20 && order.order_state !== 40">XL;红色条纹XL;红色条纹XL;红色条纹</view>
|
<view class="goods-sku u-line-1" v-if="order.order_state !== 20 && order.order_state !== 40 && goods.goods_spec">
|
||||||
<view class="goods-time u-line-1" v-if="order.order_state == 10 || order.order_state == 10">距离结束:23:23:38</view>
|
<text v-for="(spec, index) in goods.goods_spec" :key="index">{{ spec + ';' }}</text>
|
||||||
<view class="goods-price u-line-1" v-if="order.order_state == 20 || order.order_state == 40">总价:¥99.00,实付款¥99</view>
|
</view>
|
||||||
|
<view class="goods-time u-line-1" v-if="order.order_state == 10 || order.order_state == 10">结束时间:{{ order.add_time * 1000 | date('yyyy-mm-dd hh:MM') }}</view>
|
||||||
|
<view class="goods-price u-line-1" v-if="order.order_state == 20 || order.order_state == 40">总价:¥{{ goods.goods_price }},实付款¥{{ goods.goods_pay_price }}</view>
|
||||||
<view class="goods-date" v-if="order.order_state == 20 || order.order_state == 40">
|
<view class="goods-date" v-if="order.order_state == 20 || order.order_state == 40">
|
||||||
<image src="@/pageE/static/mine/26.png"></image>
|
<image src="@/pageE/static/mine/26.png"></image>
|
||||||
<view>{{ order.add_time | date }}</view>
|
<view>{{ order.add_time | date }}</view>
|
||||||
@@ -27,13 +29,14 @@
|
|||||||
<view class="logistics" v-if="order.order_state == 30" @click="toOtherPage('Logistics')">查看物流</view>
|
<view class="logistics" v-if="order.order_state == 30" @click="toOtherPage('Logistics')">查看物流</view>
|
||||||
<view class="comment" v-if="order.order_state == 40 && order.evaluation_state == 0" @click="toOtherPage('Comment')">立即评价</view>
|
<view class="comment" v-if="order.order_state == 40 && order.evaluation_state == 0" @click="toOtherPage('Comment')">立即评价</view>
|
||||||
<view class="calcel" v-if="order.order_state == 10" @click="cancelOrder">取消支付</view>
|
<view class="calcel" v-if="order.order_state == 10" @click="cancelOrder">取消支付</view>
|
||||||
<view class="payment" v-if="order.order_state == 10">立即支付</view>
|
<view class="payment" v-if="order.order_state == 10" @click="payNow(order.pay_sn, order.order_amount)">立即支付</view>
|
||||||
<view class="service" v-if="order.order_state == 20">联系官方客服</view>
|
<view class="service" v-if="order.order_state == 20">联系官方客服</view>
|
||||||
<view class="submit" v-if="order.order_state == 20">提交官方审核</view>
|
<view class="submit" v-if="order.order_state == 20">提交官方审核</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import common from '@/static/js/common.js';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -46,6 +49,14 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.viewState();
|
this.viewState();
|
||||||
},
|
},
|
||||||
|
filters: {
|
||||||
|
// timeLine(timestamp) {
|
||||||
|
// const timestamp = 0.5*60*60*1000;
|
||||||
|
// const now = new Date().getTime();
|
||||||
|
// let line = now - timestamp * 1000;
|
||||||
|
// return common.getLineTime({ timestamp: line });
|
||||||
|
// }
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
viewState() {
|
viewState() {
|
||||||
let state;
|
let state;
|
||||||
@@ -85,6 +96,7 @@ export default {
|
|||||||
if(res.errCode == 0) {
|
if(res.errCode == 0) {
|
||||||
this.$emit("refreshOrderList", { reload: 'again' });
|
this.$emit("refreshOrderList", { reload: 'again' });
|
||||||
}
|
}
|
||||||
|
this.$u.toast(res.message);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
toOtherPage(url) {
|
toOtherPage(url) {
|
||||||
@@ -92,6 +104,12 @@ export default {
|
|||||||
oid: this.order.order_id,
|
oid: this.order.order_id,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
payNow(pay_sn, order_amount) {
|
||||||
|
this.$u.route('/pageC/cart/cashier', {
|
||||||
|
pay_sn: pay_sn,
|
||||||
|
price: order_amount,
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -114,6 +132,7 @@ export default {
|
|||||||
height: 50rpx;
|
height: 50rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
margin-right: 15rpx;
|
margin-right: 15rpx;
|
||||||
|
background-color: aquamarine;
|
||||||
}
|
}
|
||||||
.store-name {
|
.store-name {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
|
|||||||
192
components/mine/order-item/try.vue
Normal file
192
components/mine/order-item/try.vue
Normal file
@@ -0,0 +1,192 @@
|
|||||||
|
<template>
|
||||||
|
<view class="order-item">
|
||||||
|
<view class="order-title">
|
||||||
|
<view class="store-info">
|
||||||
|
<image :src="order.store_avatar"></image>
|
||||||
|
<view class="store-name">{{ order.store_name }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="order-status">{{ state }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="goods-info">
|
||||||
|
<view class="goods-item">
|
||||||
|
<image :src="order.goods_image"></image>
|
||||||
|
<view class="goods-text">
|
||||||
|
<view class="goods-name u-line-2">{{ order.goods_name }}</view>
|
||||||
|
<!-- <view class="goods-sku u-line-1" v-if="order.order_state !== 20 && order.order_state !== 40 && goods.goods_spec">
|
||||||
|
<text v-for="(spec, index) in goods.goods_spec" :key="index">{{ spec + ';' }}</text>
|
||||||
|
</view> -->
|
||||||
|
<!-- <view class="goods-time u-line-1" v-if="order.order_state == 10 || order.order_state == 10">结束时间:{{ order.add_time * 1000 | date('yyyy-mm-dd hh:MM') }}</view> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="order-btn" v-if="order.goods_try_order_status == 20">
|
||||||
|
<view class="logistics" @click="confirmOrder">确认完成</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import common from '@/static/js/common.js';
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
state: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
order: Object
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.viewState();
|
||||||
|
},
|
||||||
|
filters: {},
|
||||||
|
methods: {
|
||||||
|
// "goods_try_order_status": 0, 试穿订单状态 0:待处理订单 20:同意 40:拒绝此订单 50:完成
|
||||||
|
viewState() {
|
||||||
|
let state;
|
||||||
|
switch (this.order.goods_try_order_status) {
|
||||||
|
case 0:
|
||||||
|
state = '等待商家回复';
|
||||||
|
break;
|
||||||
|
case 20:
|
||||||
|
state = '商家已接单';
|
||||||
|
break;
|
||||||
|
case 40:
|
||||||
|
state = '商家已拒绝';
|
||||||
|
break;
|
||||||
|
case 50:
|
||||||
|
state = '订单已结束';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
this.state = state;
|
||||||
|
},
|
||||||
|
confirmOrder() {
|
||||||
|
this.$u.api.goodsTryConfirm({
|
||||||
|
id: this.order.goods_try_id,
|
||||||
|
}).then(res => {
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
this.$emit("refreshOrderList");
|
||||||
|
}
|
||||||
|
this.$u.toast(res.message);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
toOtherPage(url) {
|
||||||
|
this.$u.route('/pageE/order/' + url, {
|
||||||
|
oid: this.order.order_id,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.order-item {
|
||||||
|
width: 690rpx;
|
||||||
|
background: rgba(255,255,255,1);
|
||||||
|
border-radius: 20rpx;
|
||||||
|
padding: 30rpx;
|
||||||
|
.order-title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
.store-info {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
> image {
|
||||||
|
width: 50rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 15rpx;
|
||||||
|
background-color: aquamarine;
|
||||||
|
}
|
||||||
|
.store-name {
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: rgba(51,51,51,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.order-status {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: rgba(255,120,15,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.goods-info {
|
||||||
|
.goods-item {
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 28rpx;
|
||||||
|
> image {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 180rpx;
|
||||||
|
height: 160rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
}
|
||||||
|
.goods-text {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
.goods-name {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: rgba(51,51,51,1);
|
||||||
|
line-height: 38rpx;
|
||||||
|
}
|
||||||
|
.goods-sku {
|
||||||
|
max-width: 230rpx;
|
||||||
|
background: rgba(236,236,236,1);
|
||||||
|
border-radius: 6rpx;
|
||||||
|
padding: 10rpx 15rpx;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: rgba(153,153,153,1);
|
||||||
|
}
|
||||||
|
.goods-time {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: rgba(255,49,49,1);
|
||||||
|
}
|
||||||
|
.goods-price {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: rgba(253,211,96,1);
|
||||||
|
}
|
||||||
|
.goods-date {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: rgba(153,153,153,1);
|
||||||
|
> image {
|
||||||
|
width: 24rpx;
|
||||||
|
height: 24rpx;
|
||||||
|
margin-right: 21rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.order-btn {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
@mixin btn-class($width, $color) {
|
||||||
|
width: $width;
|
||||||
|
height: 60rpx;
|
||||||
|
border: 2rpx solid $color;
|
||||||
|
color: $color;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
padding: 15rpx 23rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
&:not(:last-child) {
|
||||||
|
margin-right: 30rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.logistics, .comment, .payment {
|
||||||
|
@include btn-class($width: 160rpx, $color: rgba(255,119,15,1));
|
||||||
|
}
|
||||||
|
.calcel {
|
||||||
|
@include btn-class($width: 160rpx, $color: rgba(155,153,153,1));
|
||||||
|
}
|
||||||
|
.service {
|
||||||
|
@include btn-class($width: 216rpx, $color: rgba(155,153,153,1));
|
||||||
|
}
|
||||||
|
.submit {
|
||||||
|
@include btn-class($width: 216rpx, $color: rgba(255,119,15,1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
<swiper-item class="swiper-item list" v-for="(_, i) in classifyList" :key="i">
|
<swiper-item class="swiper-item list" v-for="(_, i) in classifyList" :key="i">
|
||||||
<!-- 最多显示3个 -->
|
<!-- 最多显示3个 -->
|
||||||
<sitem :info="info" v-for="(info, index) in groupList.slice(0, 3)" :key="index"></sitem>
|
<sitem :info="info" v-for="(info, index) in groupList.slice(0, 3)" :key="index"></sitem>
|
||||||
<u-empty text="暂无拼团商品" mode="list" color="#000" v-if="!groupList.length"></u-empty>
|
<u-empty text="暂无拼团商品" mode="list" color="#000" v-if="!groupList.length" style="margin: 0 auto;"></u-empty>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
@@ -23,17 +23,41 @@ export default {
|
|||||||
components:{
|
components:{
|
||||||
sitem
|
sitem
|
||||||
},
|
},
|
||||||
props: {
|
|
||||||
groupList: Array,
|
|
||||||
classifyList: Array,
|
|
||||||
},
|
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
current: 0,
|
current: -1,
|
||||||
swiperCurrent: 0,
|
swiperCurrent: 0,
|
||||||
|
groupList: [], // 拼团商品
|
||||||
|
classifyList: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
current(value) {
|
||||||
|
this.getPinTuanList(this.classifyList[value].gc_id);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getGoodsClass();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 获取优惠券拼团分类
|
||||||
|
getGoodsClass() {
|
||||||
|
this.$u.api.getGoodsClass().then(res => {
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
this.classifyList = res.data;
|
||||||
|
this.current = 0;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 拼团列表
|
||||||
|
getPinTuanList(id) {
|
||||||
|
this.$u.api.getPinTuanList({
|
||||||
|
page: 0,
|
||||||
|
gc_id: id,
|
||||||
|
}).then(res => {
|
||||||
|
this.groupList = res.data;
|
||||||
|
})
|
||||||
|
},
|
||||||
tabsChange(index) {
|
tabsChange(index) {
|
||||||
this.swiperCurrent = index;
|
this.swiperCurrent = index;
|
||||||
},
|
},
|
||||||
@@ -52,7 +76,9 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.group{
|
.group{
|
||||||
|
background-color: #ffffff;
|
||||||
.top {
|
.top {
|
||||||
|
padding: 0 30rpx;
|
||||||
height: 90rpx;
|
height: 90rpx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -67,18 +93,11 @@ export default {
|
|||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// .label{
|
|
||||||
// display: flex;
|
|
||||||
// font-size: 24rpx;
|
|
||||||
// color: #999;
|
|
||||||
// >text{
|
|
||||||
// margin-right: 34rpx;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
.list {
|
.list {
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0 30rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-top: 21rpx;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -16,19 +16,26 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toDetailsPage() {
|
toDetailsPage() {
|
||||||
this.$u.api.getPinTuanDetails({
|
// this.$u.api.getPinTuanDetails({
|
||||||
pintuan_id: this.info.pintuan_id,
|
// pintuan_id: this.info.pintuan_id,
|
||||||
}).then(res => {
|
// }).then(res => {
|
||||||
if(res.errCode == 0) {
|
// if(res.errCode == 0) {
|
||||||
const goods = {
|
// const goods = {
|
||||||
goods: res.data.data,
|
// goods: res.data.data,
|
||||||
type: 2,
|
// type: 2,
|
||||||
}
|
// }
|
||||||
this.$store.commit('setGoodsDetails', goods);
|
// this.$store.commit('setGoodsDetails', goods);
|
||||||
this.$store.commit('setGoodsId', this.info.pintuan_id);
|
// this.$store.commit('setGoodsId', this.info.pintuan_id);
|
||||||
|
// this.$u.route({
|
||||||
|
// url: 'pageB/sdetails/index',
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// })
|
||||||
this.$u.route({
|
this.$u.route({
|
||||||
url: 'pageB/sdetails/index',
|
url: 'pageB/sdetails/index',
|
||||||
})
|
params: {
|
||||||
|
id: this.info.pintuan_id,
|
||||||
|
type: 2,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +1,28 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view class="top">
|
<view class="top">商品推荐</view>
|
||||||
商品推荐
|
|
||||||
</view>
|
|
||||||
<view>
|
<view>
|
||||||
<u-tabs-swiper ref="uTabs" :list="classifyList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="current" font-size="24" :show-bar="false" @change="tabsChange" height="60" ></u-tabs-swiper>
|
<u-tabs-swiper ref="uTabs" :list="classifyList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="current" font-size="24" :show-bar="false" @change="tabsChange" height="60" ></u-tabs-swiper>
|
||||||
</view>
|
</view>
|
||||||
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" :style="{height: swiperHeight}">
|
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" :style="{height: swiperHeight}">
|
||||||
<swiper-item class="swiper-item" v-for="(_, index) in classifyList" :key="index">
|
<swiper-item class="swiper-item" v-for="(_, index) in classifyList" :key="index">
|
||||||
<!-- <scroll-view scroll-y style="height: 800rpx;width: 100%;"> -->
|
|
||||||
<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" :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" v-if="!goodsList.length"></u-empty>
|
||||||
<!-- </scroll-view> -->
|
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
<!-- 加载更多 -->
|
<!-- 加载更多 -->
|
||||||
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20"></u-loadmore>
|
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20" @loadmore="loadMore" v-if="goodsList.length>=pageSize"></u-loadmore>
|
||||||
<!-- <loadmore ref="loadmore" @callback="getGoodsRecommend" bgColor="#FFF" :page="page"></loadmore> -->
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import item from "./item";
|
import item from "./item";
|
||||||
import loadmore from "@/components/loadmore/index";
|
|
||||||
export default {
|
export default {
|
||||||
name:"list",
|
name:"list",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
pageSize: 12,
|
||||||
current: -1,
|
current: -1,
|
||||||
swiperCurrent: 0,
|
swiperCurrent: 0,
|
||||||
goodsList: [],
|
goodsList: [],
|
||||||
@@ -40,10 +35,10 @@ export default {
|
|||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
item,
|
item,
|
||||||
loadmore
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
current(index) {
|
current(index) {
|
||||||
|
this.page = 1;
|
||||||
const id = this.classifyList[index].gc_id;
|
const id = this.classifyList[index].gc_id;
|
||||||
this.getGoodsRecommend({gc_id: id});
|
this.getGoodsRecommend({gc_id: id});
|
||||||
}
|
}
|
||||||
@@ -61,19 +56,17 @@ export default {
|
|||||||
page: this.page,
|
page: this.page,
|
||||||
reload: false,
|
reload: false,
|
||||||
}).then(length => {
|
}).then(length => {
|
||||||
console.log(length);
|
// console.log(length);
|
||||||
if(length == 0) {
|
if(length == 0) {
|
||||||
this.page--;
|
this.page--;
|
||||||
this.loadStatus = 'nomore';
|
this.loadStatus = 'nomore';
|
||||||
} else {
|
} else {
|
||||||
this.loadStatus = 'loading';
|
this.loadStatus = 'loadmore';
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loadStatus = "nomore";
|
this.loadStatus = "nomore";
|
||||||
this.page--;
|
this.page--;
|
||||||
})
|
})
|
||||||
// this.$refs.loadmore.reachBottom();
|
|
||||||
// this.getGoodsRecommend(this.classifyList[this.current].gc_id);
|
|
||||||
},
|
},
|
||||||
getGoodsClassRecommend(gc_id) {
|
getGoodsClassRecommend(gc_id) {
|
||||||
this.$u.api.getGoodsClassRecommend().then(res => {
|
this.$u.api.getGoodsClassRecommend().then(res => {
|
||||||
@@ -81,7 +74,6 @@ export default {
|
|||||||
// 初始化 current
|
// 初始化 current
|
||||||
this.current = 0;
|
this.current = 0;
|
||||||
this.classifyList = res.data.gc_recommend;
|
this.classifyList = res.data.gc_recommend;
|
||||||
// this.getGoodsRecommend(this.classifyList[0].gc_id);
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -91,6 +83,7 @@ export default {
|
|||||||
gc_id: gc_id,
|
gc_id: gc_id,
|
||||||
})
|
})
|
||||||
if (res.errCode == 0) {
|
if (res.errCode == 0) {
|
||||||
|
this.timer = true;
|
||||||
if(reload) this.goodsList = res.data.goodsList;
|
if(reload) this.goodsList = res.data.goodsList;
|
||||||
else this.goodsList.push(...res.data.goodsList);
|
else this.goodsList.push(...res.data.goodsList);
|
||||||
// console.log(this.goodsList);
|
// console.log(this.goodsList);
|
||||||
@@ -124,6 +117,10 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.list{
|
.list{
|
||||||
|
background-color: #ffffff;
|
||||||
|
padding: 30rpx {
|
||||||
|
top: 0;
|
||||||
|
};
|
||||||
.top {
|
.top {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
height: 90rpx;
|
height: 90rpx;
|
||||||
@@ -131,22 +128,6 @@ export default {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
// .label{
|
|
||||||
// display: flex;
|
|
||||||
// color: #999;
|
|
||||||
// flex-wrap: wrap;
|
|
||||||
// >text{
|
|
||||||
// margin-right: 34rpx;
|
|
||||||
// margin-bottom: 10rpx;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// .item{
|
|
||||||
// display: flex;
|
|
||||||
// flex-wrap: wrap;
|
|
||||||
// justify-content: space-between;
|
|
||||||
// margin-top: 20rpx;
|
|
||||||
|
|
||||||
// }
|
|
||||||
.goods-item {
|
.goods-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|||||||
@@ -16,18 +16,25 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toDetailsPage() {
|
toDetailsPage() {
|
||||||
this.$u.api.getGoodsDetails({ id: this.info.goods_id }).then(res => {
|
// this.$u.api.getGoodsDetails({ id: this.info.goods_id }).then(res => {
|
||||||
if (res.errCode == 0) {
|
// if (res.errCode == 0) {
|
||||||
const goods = {
|
// const goods = {
|
||||||
goods: res.data,
|
// goods: res.data,
|
||||||
type: 1,
|
// type: 1,
|
||||||
}
|
// }
|
||||||
this.$store.commit('setGoodsDetails', goods);
|
// this.$store.commit('setGoodsDetails', goods);
|
||||||
this.$store.commit('setGoodsId', this.info.goods_id);
|
// this.$store.commit('setGoodsId', this.info.goods_id);
|
||||||
|
// this.$u.route({
|
||||||
|
// url: 'pageB/sdetails/index',
|
||||||
|
// })
|
||||||
|
// // console.log(this.goodsInfo.mobile_body);
|
||||||
|
// }
|
||||||
|
// })
|
||||||
this.$u.route({
|
this.$u.route({
|
||||||
url: 'pageB/sdetails/index',
|
url: 'pageB/sdetails/index',
|
||||||
})
|
params: {
|
||||||
// console.log(this.goodsInfo.mobile_body);
|
id: this.info.goods_id,
|
||||||
|
type: 1,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -35,23 +35,30 @@ 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: {
|
methods: {
|
||||||
toDetailsPage() {
|
toDetailsPage() {
|
||||||
this.$u.api.getPinTuanDetails({
|
// this.$u.api.getPinTuanDetails({
|
||||||
pintuan_id: this.recommendData.pintuan_id
|
// pintuan_id: this.recommendData.pintuan_id
|
||||||
}).then(res => {
|
// }).then(res => {
|
||||||
if(res.errCode == 0) {
|
// if(res.errCode == 0) {
|
||||||
const goods = {
|
// const goods = {
|
||||||
goods: res.data.data,
|
// goods: res.data.data,
|
||||||
type: 2,
|
// type: 2,
|
||||||
}
|
// }
|
||||||
this.$store.commit('setGoodsDetails', goods);
|
// this.$store.commit('setGoodsDetails', goods);
|
||||||
this.$store.commit('setGoodsId', this.recommendData.pintuan_id);
|
// this.$store.commit('setGoodsId', this.recommendData.pintuan_id);
|
||||||
|
// this.$u.route({
|
||||||
|
// url: 'pageB/sdetails/index',
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// })
|
||||||
this.$u.route({
|
this.$u.route({
|
||||||
url: 'pageB/sdetails/index',
|
url: 'pageB/sdetails/index',
|
||||||
})
|
params: {
|
||||||
|
id: this.recommendData.pintuan_id,
|
||||||
|
type: 2,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -60,6 +67,9 @@ export default {
|
|||||||
</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;
|
||||||
@@ -75,6 +85,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.connect{
|
.connect{
|
||||||
|
padding: 30rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
.user {
|
.user {
|
||||||
|
|||||||
@@ -45,6 +45,9 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.seckill{
|
.seckill{
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 30rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
.top{
|
.top{
|
||||||
height: 60rpx;
|
height: 60rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -26,20 +26,27 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
spikeGoods() {
|
spikeGoods() {
|
||||||
// console.log(this.item.groupbuy_id);
|
// console.log(this.item.groupbuy_id);
|
||||||
this.$u.api.getSpikeInfo({
|
// this.$u.api.getSpikeInfo({
|
||||||
groupbuy_id: this.item.groupbuy_id
|
// groupbuy_id: this.item.groupbuy_id
|
||||||
}).then(res => {
|
// }).then(res => {
|
||||||
if(res.errCode == 0) {
|
// if(res.errCode == 0) {
|
||||||
const goods = {
|
// const goods = {
|
||||||
goods: res.data.goodsInfo,
|
// goods: res.data.goodsInfo,
|
||||||
type: 3, // 商品详情 1普通 2拼团 3秒杀 4优惠券
|
// type: 3, // 商品详情 1普通 2拼团 3秒杀 4优惠券
|
||||||
}
|
// }
|
||||||
this.$store.commit('setGoodsDetails', goods);
|
// this.$store.commit('setGoodsDetails', goods);
|
||||||
this.$store.commit('setGroupbuyInfo', res.data.groupbuyInfo);
|
// this.$store.commit('setGroupbuyInfo', res.data.groupbuyInfo);
|
||||||
this.$store.commit('setGoodsId', this.item.groupbuy_id);
|
// this.$store.commit('setGoodsId', this.item.groupbuy_id);
|
||||||
|
// this.$u.route({
|
||||||
|
// url: 'pageB/sdetails/index',
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// })
|
||||||
this.$u.route({
|
this.$u.route({
|
||||||
url: 'pageB/sdetails/index',
|
url: 'pageB/sdetails/index',
|
||||||
})
|
params: {
|
||||||
|
id: this.item.groupbuy_id,
|
||||||
|
type: 3,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -42,37 +42,51 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
spikeGoods() {
|
spikeGoods() {
|
||||||
// console.log(this.item.groupbuy_id);
|
// console.log(this.item.groupbuy_id);
|
||||||
this.$u.api.getSpikeInfo({
|
// this.$u.api.getSpikeInfo({
|
||||||
groupbuy_id: this.item.groupbuy_id
|
// groupbuy_id: this.item.groupbuy_id
|
||||||
}).then(res => {
|
// }).then(res => {
|
||||||
if(res.errCode == 0) {
|
// if(res.errCode == 0) {
|
||||||
const goods = {
|
// const goods = {
|
||||||
goods: res.data.goodsInfo,
|
// goods: res.data.goodsInfo,
|
||||||
type: 3, // 商品详情 1普通 2拼团 3秒杀 4优惠券
|
// type: 3, // 商品详情 1普通 2拼团 3秒杀 4优惠券
|
||||||
}
|
// }
|
||||||
this.$store.commit('setGoodsDetails', goods);
|
// this.$store.commit('setGoodsDetails', goods);
|
||||||
this.$store.commit('setGroupbuyInfo', res.data.groupbuyInfo);
|
// this.$store.commit('setGroupbuyInfo', res.data.groupbuyInfo);
|
||||||
this.$store.commit('setGoodsId', this.item.groupbuy_id);
|
// this.$store.commit('setGoodsId', this.item.groupbuy_id);
|
||||||
|
// this.$u.route({
|
||||||
|
// url: 'pageB/sdetails/index',
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// })
|
||||||
this.$u.route({
|
this.$u.route({
|
||||||
url: 'pageB/sdetails/index',
|
url: 'pageB/sdetails/index',
|
||||||
})
|
params: {
|
||||||
|
id: this.item.groupbuy_id,
|
||||||
|
type: 3,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
toDetailsPage() {
|
toDetailsPage() {
|
||||||
this.$u.api.getPinTuanDetails({
|
// this.$u.api.getPinTuanDetails({
|
||||||
pintuan_id: this.item.pintuan_id
|
// pintuan_id: this.item.pintuan_id
|
||||||
}).then(res => {
|
// }).then(res => {
|
||||||
if(res.errCode == 0) {
|
// if(res.errCode == 0) {
|
||||||
const goods = {
|
// const goods = {
|
||||||
goods: res.data.data,
|
// goods: res.data.data,
|
||||||
type: 2,
|
// type: 2,
|
||||||
}
|
// }
|
||||||
this.$store.commit('setGoodsDetails', goods);
|
// this.$store.commit('setGoodsDetails', goods);
|
||||||
this.$store.commit('setGoodsId', this.item.pintuan_id);
|
// this.$store.commit('setGoodsId', this.item.pintuan_id);
|
||||||
|
// this.$u.route({
|
||||||
|
// url: 'pageB/sdetails/index',
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
// })
|
||||||
this.$u.route({
|
this.$u.route({
|
||||||
url: 'pageB/sdetails/index',
|
url: 'pageB/sdetails/index',
|
||||||
})
|
params: {
|
||||||
|
id: this.item.pintuan_id,
|
||||||
|
type: 2,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ export default {
|
|||||||
num = this.couponList.length
|
num = this.couponList.length
|
||||||
? this.couponList.length > 4 ? 4 : this.couponList.length
|
? this.couponList.length > 4 ? 4 : this.couponList.length
|
||||||
: 1
|
: 1
|
||||||
this.swiperHeight = (97 + 10) * num - 10 + 'px';
|
this.swiperHeight = (97 + 10) * num + 'px';
|
||||||
},
|
},
|
||||||
toCouponPage() {
|
toCouponPage() {
|
||||||
this.$u.route({
|
this.$u.route({
|
||||||
@@ -93,8 +93,11 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.coupon-swiper {
|
.coupon-swiper {
|
||||||
|
background-color: #ffffff;
|
||||||
|
margin-bottom: 40rpx;
|
||||||
.top {
|
.top {
|
||||||
padding-top: 30rpx;
|
padding: 0 30rpx;
|
||||||
|
height: 90rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@@ -109,11 +112,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.swiper-coupon-item {
|
.swiper-coupon-item {
|
||||||
|
padding: 0 30rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
// padding: 30rpx {
|
|
||||||
// top: 0;
|
|
||||||
// };
|
|
||||||
.coupon-item {
|
.coupon-item {
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "deming",
|
"name" : "deming",
|
||||||
"appid" : "__UNI__62A680B",
|
"appid" : "__UNI__EBFF00A",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.0.0",
|
"versionName" : "1.0.0",
|
||||||
"versionCode" : "100",
|
"versionCode" : "100",
|
||||||
@@ -18,7 +18,12 @@
|
|||||||
},
|
},
|
||||||
/* 模块配置 */
|
/* 模块配置 */
|
||||||
"modules" : {
|
"modules" : {
|
||||||
"OAuth" : {}
|
"OAuth" : {},
|
||||||
|
"Share" : {},
|
||||||
|
"Push" : {},
|
||||||
|
"Maps" : {},
|
||||||
|
"LivePusher" : {},
|
||||||
|
"Payment" : {}
|
||||||
},
|
},
|
||||||
/* 应用发布信息 */
|
/* 应用发布信息 */
|
||||||
"distribute" : {
|
"distribute" : {
|
||||||
@@ -37,6 +42,7 @@
|
|||||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
|
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
|
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
|
||||||
@@ -46,6 +52,7 @@
|
|||||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
|
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
|
||||||
|
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -58,7 +65,14 @@
|
|||||||
"qq" : {
|
"qq" : {
|
||||||
"appid" : "101884160"
|
"appid" : "101884160"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"maps" : {
|
||||||
|
"amap" : {
|
||||||
|
"appkey_ios" : "eafe430aa31fa033dcf45a0e87032653",
|
||||||
|
"appkey_android" : "8045e8a4cd6d544690c786265b248f91"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"share" : {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -8,11 +8,11 @@
|
|||||||
<view class="title">手机登录</view>
|
<view class="title">手机登录</view>
|
||||||
<view class="labales">
|
<view class="labales">
|
||||||
<!-- <text></text> -->
|
<!-- <text></text> -->
|
||||||
<input type="tel" placeholder="请输入您的手机号" v-model="member_mobile" />
|
<input type="tel" placeholder="请输入您的手机号" maxlength="11" v-model="member_mobile" />
|
||||||
</view>
|
</view>
|
||||||
<view class="labales">
|
<view class="labales">
|
||||||
<!-- <text></text> -->
|
<!-- <text></text> -->
|
||||||
<input type="tel" placeholder="请输入验证码" v-model="sms_code" />
|
<input type="number" placeholder="请输入验证码" maxlength="6" v-model="sms_code" />
|
||||||
<!-- <text class="identifying" @click="getCode">{{text}}</text> -->
|
<!-- <text class="identifying" @click="getCode">{{text}}</text> -->
|
||||||
<identifying @tochange="tochange" :smslog_type="smslog_type" :member_mobile="member_mobile"></identifying>
|
<identifying @tochange="tochange" :smslog_type="smslog_type" :member_mobile="member_mobile"></identifying>
|
||||||
</view>
|
</view>
|
||||||
@@ -22,7 +22,8 @@
|
|||||||
<view>
|
<view>
|
||||||
<view></view>
|
<view></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>
|
<text class="pact_text" v-for="(item,index) in pact_text" :key="index" @click="pact_click(index)"> {{item.text}}
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<u-checkbox-group @change="checkboxGroupChange" size="27">
|
<u-checkbox-group @change="checkboxGroupChange" size="27">
|
||||||
<u-checkbox @change="checkboxChange" v-model="item.checked" v-for="(item, index) in list" :key="index" :name="item.name"
|
<u-checkbox @change="checkboxChange" v-model="item.checked" v-for="(item, index) in list" :key="index" :name="item.name"
|
||||||
@@ -60,6 +61,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import identifying from '@/components/logininput/identifying'
|
import identifying from '@/components/logininput/identifying'
|
||||||
|
import { mapMutations } from 'vuex';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -96,9 +98,10 @@
|
|||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
// 数据的请求
|
// 数据的请求
|
||||||
this.apiwelcome()
|
this.apiwelcome();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
...mapMutations(['loginIn']),
|
||||||
apiwelcome() {
|
apiwelcome() {
|
||||||
this.$u.api.sendSmsCode({
|
this.$u.api.sendSmsCode({
|
||||||
|
|
||||||
@@ -115,6 +118,7 @@
|
|||||||
},
|
},
|
||||||
// 用户登录
|
// 用户登录
|
||||||
loginOn() {
|
loginOn() {
|
||||||
|
let me = this;
|
||||||
// uni.navigateTo({
|
// uni.navigateTo({
|
||||||
// url: '/pageE/zhibo/index'
|
// url: '/pageE/zhibo/index'
|
||||||
// });
|
// });
|
||||||
@@ -159,7 +163,7 @@
|
|||||||
})
|
})
|
||||||
return false
|
return false
|
||||||
} else {
|
} else {
|
||||||
uni.setStorageSync('token', res.data.token);//存储一个字符传值
|
me.loginIn(res.data.token); //存储一个字符传值
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pageA/topick/topick'
|
url: '/pageA/topick/topick'
|
||||||
})
|
})
|
||||||
@@ -178,7 +182,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 存储接口请求所需token
|
// 存储接口请求所需token
|
||||||
uni.setStorageSync('token', res.data.token);//存储一个字符传值
|
me.loginIn(res.data.token); //存储一个字符传值
|
||||||
// // 注册返回参数
|
// // 注册返回参数
|
||||||
// this.$refs.uToast.show({
|
// this.$refs.uToast.show({
|
||||||
// title: res.message,
|
// title: res.message,
|
||||||
@@ -196,7 +200,7 @@
|
|||||||
},
|
},
|
||||||
// qq授权登录
|
// qq授权登录
|
||||||
rect_qq() {
|
rect_qq() {
|
||||||
console.log("授权Q")
|
console.log("授权QQ")
|
||||||
var vm = this;
|
var vm = this;
|
||||||
uni.getProvider({
|
uni.getProvider({
|
||||||
service: 'oauth',
|
service: 'oauth',
|
||||||
@@ -296,10 +300,12 @@
|
|||||||
width: 630rpx;
|
width: 630rpx;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.u-checkbox__icon-wrap .u-icon {
|
.u-checkbox__icon-wrap .u-icon {
|
||||||
width: 26rpx !important;
|
width: 26rpx !important;
|
||||||
height: 26rpx;
|
height: 26rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.more_Login text {
|
.more_Login text {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
|
|||||||
123
pageB/comment/index.vue
Normal file
123
pageB/comment/index.vue
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
<template>
|
||||||
|
<scroll-view scroll-y class="comment" @scrolltolower="loadMore">
|
||||||
|
<view class="label-list">
|
||||||
|
<view v-for="(label, index) in evaluateSpec" :key="index" :class="{'active': current == index}" @click="current=index">{{ index + '(' + label + ')' }}</view>
|
||||||
|
</view>
|
||||||
|
<view class="comment-container">
|
||||||
|
<view v-for="(item, index) in evalueList" :key="index" class="itme">
|
||||||
|
<comment :reply="true" :content="item"></comment>
|
||||||
|
</view>
|
||||||
|
<u-empty text="暂无评论" mode="list" v-if="!evalueList.length" margin-top="120" color="#333"></u-empty>
|
||||||
|
</view>
|
||||||
|
<!-- 加载更多 -->
|
||||||
|
<u-loadmore :status="loadStatus" bgColor="#EEEBEE" margin-top="20" margin-bottom="20" v-if="evalueList.length >= 12"></u-loadmore>
|
||||||
|
</scroll-view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import comment from "@/components/comment/index";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
id: Number,
|
||||||
|
current: '全部',
|
||||||
|
page: 0,
|
||||||
|
evalueList: [],
|
||||||
|
evaluateSpec: {},
|
||||||
|
loadStatus: 'loadmore',
|
||||||
|
timer: true,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
comment
|
||||||
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
this.id = option.id;
|
||||||
|
// this.getAllEvalue();
|
||||||
|
this.getEvaluateSpec();
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
current(value) {
|
||||||
|
this.page = 0;
|
||||||
|
this.getAllEvalue({ type: value });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
loadMore() {
|
||||||
|
if(this.evalueList.length < 12) return false;
|
||||||
|
if(!this.timer) return false;
|
||||||
|
this.loadStatus = "loading";
|
||||||
|
this.page++;
|
||||||
|
this.getAllEvalue({ type: this.current, load: 'more' }).then(length => {
|
||||||
|
if(length == 0) {
|
||||||
|
this.page--;
|
||||||
|
this.loadStatus = 'nomore';
|
||||||
|
} else {
|
||||||
|
this.loadStatus = 'loading';
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.loadStatus = "nomore";
|
||||||
|
this.page--;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getEvaluateSpec() {
|
||||||
|
this.$u.api.getEvaluateSpec({
|
||||||
|
id: this.id,
|
||||||
|
}).then(res => {
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
this.evaluateSpec = res.data;
|
||||||
|
this.getAllEvalue();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async getAllEvalue({ type, load } = {}) {
|
||||||
|
let params = {
|
||||||
|
goods_id: this.id,
|
||||||
|
page: this.page,
|
||||||
|
}
|
||||||
|
if(type) Object.assign(params, { type: type });
|
||||||
|
const res = await this.$u.api.getAllEvalue(params);
|
||||||
|
if (res.errCode == 0) {
|
||||||
|
if(load) this.evalueList.push(...res.data);
|
||||||
|
else this.evalueList = res.data;
|
||||||
|
} else {
|
||||||
|
this.evalueList = [];
|
||||||
|
}
|
||||||
|
return res.data.length;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.comment {
|
||||||
|
height: calc(100vh - var(--window-top));
|
||||||
|
background-color: #EEEBEE;
|
||||||
|
padding-bottom: 30rpx;
|
||||||
|
.label-list {
|
||||||
|
padding: 30rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
margin-bottom: 14rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
> view {
|
||||||
|
box-sizing: content-box;
|
||||||
|
padding: 16rpx 20rpx;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
margin: 0 20rpx 20rpx 0;
|
||||||
|
background: rgba(236,236,236,1);
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: rgba(153,153,153,1);
|
||||||
|
}
|
||||||
|
.active {
|
||||||
|
background: rgba(255,120,15,1);
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.comment-container {
|
||||||
|
.itme {
|
||||||
|
padding: 30rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="tloos">
|
<!-- 普通商品 tool -->
|
||||||
|
<view class="tloos" v-if="type == 1">
|
||||||
<view class="navs">
|
<view class="navs">
|
||||||
<image src="/static/image/common/18.png"></image>
|
<image src="/static/image/common/18.png"></image>
|
||||||
店铺
|
店铺
|
||||||
@@ -13,6 +14,28 @@
|
|||||||
<view class="button" style="background:rgba(253,211,96,1);" @click="buy(2)">加入购物车</view>
|
<view class="button" style="background:rgba(253,211,96,1);" @click="buy(2)">加入购物车</view>
|
||||||
<view class="button" style="background:rgba(255,120,15,1);" @click="buy(1)">立即购买</view>
|
<view class="button" style="background:rgba(255,120,15,1);" @click="buy(1)">立即购买</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 拼团 tool -->
|
||||||
|
<view class="group-tool" v-if="type==2">
|
||||||
|
<view class="launch" @click="settlementOrder">发起拼团</view>
|
||||||
|
<view class="involvement" @click="showGroupUser=true">参与拼团</view>
|
||||||
|
</view>
|
||||||
|
<!-- 秒杀 tool -->
|
||||||
|
<view class="spike-tool" v-if="type==3">
|
||||||
|
<view class="left">
|
||||||
|
<view>
|
||||||
|
<image src="/static/image/common/18.png"></image>
|
||||||
|
<text>店铺</text>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<image src="/static/image/common/19.png"></image>
|
||||||
|
<text>客服</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="btn" v-if="groupbuyInfo.groupbuy_state == 20 && 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>
|
||||||
|
{{ groupbuyInfo.groupbuy_state == 32 ? '时间已结束' : (groupbuyInfo.inventory > groupbuyInfo.groupbuy_buy_quantity ? '立即秒杀' : '已售空') }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<u-popup v-model="show" mode="bottom">
|
<u-popup v-model="show" mode="bottom">
|
||||||
<scroll-view scroll-y="true" class="popup">
|
<scroll-view scroll-y="true" class="popup">
|
||||||
<view>
|
<view>
|
||||||
@@ -40,9 +63,9 @@
|
|||||||
import guige from "./guige"
|
import guige from "./guige"
|
||||||
export default {
|
export default {
|
||||||
name:"tloos",
|
name:"tloos",
|
||||||
props: ['id', 'info'],
|
props: ['id', 'info', 'type'],
|
||||||
components:{
|
components:{
|
||||||
guige
|
guige,
|
||||||
},
|
},
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
@@ -107,6 +130,69 @@ export default {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.group-tool {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 98rpx;
|
||||||
|
display: flex;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: rgba(255,255,255,1);
|
||||||
|
z-index: 99;
|
||||||
|
.launch {
|
||||||
|
flex: 1;
|
||||||
|
background: rgba(253,211,96,1);
|
||||||
|
line-height: 98rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.involvement {
|
||||||
|
flex: 1;
|
||||||
|
background: rgba(255,120,15,1);
|
||||||
|
line-height: 98rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.spike-tool {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 98rpx;
|
||||||
|
display: flex;
|
||||||
|
z-index: 99;
|
||||||
|
.left {
|
||||||
|
width: 190rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
> view {
|
||||||
|
text-align: center;
|
||||||
|
> image {
|
||||||
|
width: 35rpx;
|
||||||
|
height: 35rpx;
|
||||||
|
margin-bottom: 15rpx;
|
||||||
|
}
|
||||||
|
> text {
|
||||||
|
display: block;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: rgba(102,102,102,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.btn {
|
||||||
|
flex: 1;
|
||||||
|
height: 98rpx;
|
||||||
|
line-height: 98rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: rgba(255,255,255,1);
|
||||||
|
background: rgba(255,120,15,1);
|
||||||
|
}
|
||||||
|
.cannot {
|
||||||
|
background: rgba(221,221,221,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
.tloos{
|
.tloos{
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="photo">
|
<view class="photo">
|
||||||
<view class="back">
|
<view class="back">
|
||||||
<image></image>
|
<u-icon name="close" color="#999999" :size="30"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<swiper class="swiper">
|
<swiper class="swiper">
|
||||||
<swiper-item>
|
<swiper-item>
|
||||||
@@ -34,11 +34,7 @@
|
|||||||
.back{
|
.back{
|
||||||
padding-top: 28rpx;
|
padding-top: 28rpx;
|
||||||
padding-right: 31rpx;
|
padding-right: 31rpx;
|
||||||
>image{
|
text-align: right;
|
||||||
width: 31rpx;
|
|
||||||
height: 31rpx;
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.swiper{
|
.swiper{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@@ -9,10 +9,13 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="num">剩余数量{{ groupbuyInfo.inventory - groupbuyInfo.groupbuy_buy_quantity }}件</view>
|
<view class="num">剩余数量{{ groupbuyInfo.inventory - groupbuyInfo.groupbuy_buy_quantity }}件</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<view class="right" v-if="!isSpike">
|
||||||
<view class="title">秒杀倒计时</view>
|
<view class="title">秒杀倒计时</view>
|
||||||
<view class="time">{{ spikeTime }}</view>
|
<view class="time">{{ spikeTime }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="right" v-else>
|
||||||
|
<view class="title">时间已结束</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="title u-line-2">
|
<view class="title u-line-2">
|
||||||
@@ -25,10 +28,20 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="hr"></view>
|
<view class="hr"></view>
|
||||||
<!-- <navs :value="领券"></navs> -->
|
<!-- <navs :value="领券"></navs> -->
|
||||||
<navs :value="'产品规格'"></navs>
|
<navs :value="'产品规格'" @click.native="showSpec=true"></navs>
|
||||||
<!-- <navs :value="'产品颜色'"></navs> -->
|
<!-- <navs :value="'产品颜色'"></navs> -->
|
||||||
<!-- <navs :value="'选择尺码'"></navs> -->
|
<!-- <navs :value="'选择尺码'"></navs> -->
|
||||||
<!-- <navs v-for="(value, index) in goodsInfo.spec_name" :value="value" :key="index"></navs> -->
|
<view class="comment">
|
||||||
|
<view class="title">
|
||||||
|
<view class="left">商品评价({{ evaluate.evaluate_num }})</view>
|
||||||
|
<view class="right" @click="viewComment">
|
||||||
|
<text>查看全部</text>
|
||||||
|
<image src="/static/image/common/1.png"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<comment :reply="false" :content="evaluate" v-if="evaluate.evaluate_num"></comment>
|
||||||
|
<view class="comment-none">暂无评价</view>
|
||||||
|
</view>
|
||||||
<view class="hr"></view>
|
<view class="hr"></view>
|
||||||
<view class="group-user" v-if="groupUser.length">
|
<view class="group-user" v-if="groupUser.length">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
@@ -39,7 +52,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="bottom">
|
<view class="bottom">
|
||||||
<view class="left" @click="showGroupUser=true">
|
<view class="left" @click="showGroupUser=true" v-if="user_suc.length">
|
||||||
<view class="avatar">
|
<view class="avatar">
|
||||||
<image v-for="(user, i) in user_suc" :src="user[0].member_avatar" :key="i"></image>
|
<image v-for="(user, i) in user_suc" :src="user[0].member_avatar" :key="i"></image>
|
||||||
</view>
|
</view>
|
||||||
@@ -62,7 +75,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<u-popup v-model="showGroupUser" mode="center">
|
<u-popup v-model="showGroupUser" mode="center" z-index="10078">
|
||||||
<view class="launch-container">
|
<view class="launch-container">
|
||||||
<view class="title u-line-1">正在拼团</view>
|
<view class="title u-line-1">正在拼团</view>
|
||||||
<scroll-view class="launch-view">
|
<scroll-view class="launch-view">
|
||||||
@@ -71,6 +84,7 @@
|
|||||||
<image class="avatar" :src="user[0].member_avatar"></image>
|
<image class="avatar" :src="user[0].member_avatar"></image>
|
||||||
<view class="name u-line-1">{{ user[0].member_nickname }}</view>
|
<view class="name u-line-1">{{ user[0].member_nickname }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="pintuan-none" v-if="!groupUser.length">暂无拼团</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<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>
|
||||||
@@ -96,13 +110,48 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="rich">
|
<view class="rich">
|
||||||
<rich-text :nodes="goodsInfo.mobile_body"></rich-text>
|
<rich-text :nodes="goodsInfo.mobile_body"></rich-text>
|
||||||
|
</view>
|
||||||
|
<!-- 选择规格数量 -->
|
||||||
|
<u-popup v-model="showSpec" mode="bottom">
|
||||||
|
<scroll-view scroll-y="true" class="spec-popup">
|
||||||
|
<view>
|
||||||
|
<view class="head">
|
||||||
|
<image class="image" :src="goodsInfo.goods_image"></image>
|
||||||
|
<view class="info">
|
||||||
|
<text class="u-line-2">{{goodsInfo.goods_name}}</text>
|
||||||
|
<text>¥{{goodsInfo.goods_price}}</text>
|
||||||
|
</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>
|
||||||
|
<view class="num">
|
||||||
|
<text>购买数量</text>
|
||||||
|
<u-number-box v-model="goodsNumber" @change="valChange"></u-number-box>
|
||||||
|
</view>
|
||||||
|
<view style="height:100rpx"></view>
|
||||||
|
</view>
|
||||||
|
<u-toast ref="uToast" />
|
||||||
|
</scroll-view>
|
||||||
|
</u-popup>
|
||||||
|
<!-- 普通商品 tool -->
|
||||||
|
<view class="tloos" v-if="type == 1">
|
||||||
|
<view class="navs">
|
||||||
|
<image src="/static/image/common/18.png"></image>
|
||||||
|
店铺
|
||||||
|
</view>
|
||||||
|
<view class="navs" style="margin-right:30rpx">
|
||||||
|
<image src="/static/image/common/19.png"></image>
|
||||||
|
客服
|
||||||
|
</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(255,120,15,1);" @click="settlementOrder">立即购买</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 拼团 tool -->
|
<!-- 拼团 tool -->
|
||||||
<view class="group-tool" v-if="type==2">
|
<view class="group-tool" v-if="type==2">
|
||||||
<view class="launch" @click="settlementOrder">发起拼团</view>
|
<view class="launch" @click="settlementOrder">发起拼团</view>
|
||||||
<view class="involvement" @click="showGroupUser=true">参与拼团</view>
|
<view class="involvement" @click="showGroupUser=true">参与拼团</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 秒杀 -->
|
<!-- 秒杀 tool -->
|
||||||
<view class="spike-tool" v-if="type==3">
|
<view class="spike-tool" v-if="type==3">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view>
|
<view>
|
||||||
@@ -119,99 +168,115 @@
|
|||||||
{{ groupbuyInfo.groupbuy_state == 32 ? '时间已结束' : (groupbuyInfo.inventory > groupbuyInfo.groupbuy_buy_quantity ? '立即秒杀' : '已售空') }}
|
{{ groupbuyInfo.groupbuy_state == 32 ? '时间已结束' : (groupbuyInfo.inventory > groupbuyInfo.groupbuy_buy_quantity ? '立即秒杀' : '已售空') }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 普通商品 tool -->
|
<!-- <tloos @buy="buy" @xuanze="xuanze" :id="id" :info="goodsInfo" :type="type"></tloos> -->
|
||||||
<tloos @buy="buy" @xuanze="xuanze" :id="goodsInfo.goods_commonid" :info="goodsInfo" v-if="type==1"></tloos>
|
|
||||||
<u-toast ref="uToast" />
|
<u-toast ref="uToast" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
/*
|
import comment from "@/components/comment/index";
|
||||||
* 详情是请求完存在store的,在这里从store取值
|
import navs from "../components/sdetails/navs";
|
||||||
**/
|
import guige from "../components/sdetails/guige"
|
||||||
import navs from "../components/sdetails/navs"
|
import tloos from "../components/sdetails/tloos";
|
||||||
import tloos from "../components/sdetails/tloos"
|
|
||||||
export default {
|
export default {
|
||||||
name: "sdetails",
|
name: "sdetails",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [], // 轮播图列表
|
list: [], // 轮播图列表
|
||||||
goodsInfo: {},
|
goodsInfo: {}, // 商品信息
|
||||||
info:{},
|
glist: [], // 规格列表
|
||||||
glist:[],
|
id: 0, // 商品id/秒杀id/拼团 id
|
||||||
id:0, // 商品id
|
|
||||||
type: '', // 商品类型 商品详情 1普通 2拼团 3秒杀 4优惠券
|
type: '', // 商品类型 商品详情 1普通 2拼团 3秒杀 4优惠券
|
||||||
groupUser: [], // 拼团用户
|
groupUser: [], // 拼团用户
|
||||||
user_suc: [], // 拼团成功用户
|
user_suc: [], // 拼团成功用户
|
||||||
avatarWidth: '',
|
|
||||||
pintuan_id: '', // 拼团id
|
|
||||||
showGroupUser: false, // 拼团
|
showGroupUser: false, // 拼团
|
||||||
showInvolvementUser: false, // 参团
|
showInvolvementUser: false, // 参团
|
||||||
involvemenGroupInfo: [], // 参团的人
|
involvemenGroupInfo: [], // 参团的人
|
||||||
groupbuyInfo: {}, // 秒杀详情
|
groupbuyInfo: {}, // 秒杀详情
|
||||||
spikeTime: '',
|
spikeTime: '',
|
||||||
timer: '', // 时间定时器
|
isSpike: false, // 是否超过秒杀时间
|
||||||
|
timer: '', // 秒杀时间定时器
|
||||||
|
spec_id: '', // 规格 id, 下单用的
|
||||||
|
evaluate: {}, // 评价内容
|
||||||
|
showSpec: false, // 是否显示选择规格
|
||||||
|
goodsNumber: 1,
|
||||||
|
sel: "", // 拼接的规格
|
||||||
|
quanxuan: false, // 规格是否选择
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
comment,
|
||||||
navs,
|
navs,
|
||||||
tloos
|
tloos,
|
||||||
|
guige,
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
sel(value){
|
||||||
|
this.xuanze(value);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
// this.init();
|
||||||
|
// console.log(option);
|
||||||
|
this.type = Number(option.type);
|
||||||
|
this.id = option.id;
|
||||||
|
this.getGoodsDetails(this.id);
|
||||||
|
this.setTitle();
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
// if(this.pintuan_id) {
|
this.showSpec = false;
|
||||||
// this.$u.api.getPinTuanDetails({
|
this.showGroupUser = false;
|
||||||
// pintuan_id: this.pintuan_id
|
this.showInvolvementUser = false;
|
||||||
// }).then(res => {
|
|
||||||
// if(res.errCode == 0) {
|
|
||||||
// const goods = {
|
|
||||||
// goods: res.data.data,
|
|
||||||
// type: 2,
|
|
||||||
// }
|
|
||||||
// this.$store.commit('setGoodsDetails', goods);
|
|
||||||
// this.$store.commit('setGoodsId', this.pintuan_id);
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
this.init();
|
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
clearInterval(this.timer);
|
clearInterval(this.timer);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
// init() {
|
||||||
this.id = this.$store.state.goods_id;
|
// this.id = this.$store.state.goods_id;
|
||||||
this.type = this.$store.getters.getGoodsType;
|
// this.type = this.$store.getters.getGoodsType;
|
||||||
const info = this.$store.getters.getGoodsInfo;
|
// const info = this.$store.getters.getGoodsInfo;
|
||||||
if(this.type == 2) {
|
// // 拼团商品
|
||||||
this.user_suc = info.user_suc;
|
// if(this.type == 2) {
|
||||||
this.groupUser = info.user;
|
// this.user_suc = info.user_suc;
|
||||||
this.pintuan_id = info.pintuan_id;
|
// this.groupUser = info.user;
|
||||||
}
|
// this.pintuan_id = info.pintuan_id;
|
||||||
if (this.type == 3) {
|
// }
|
||||||
this.groupbuyInfo = this.$store.state.groupbuyInfo;
|
// // 秒杀商品
|
||||||
this.setSpikeTime();
|
// if (this.type == 3) {
|
||||||
}
|
// this.groupbuyInfo = this.$store.state.groupbuyInfo;
|
||||||
// console.log(this.groupbuyInfo);
|
// this.setSpikeTime();
|
||||||
this.goodsInfo = info.goods;
|
// }
|
||||||
// 设置轮播图
|
// // console.log(this.groupbuyInfo);
|
||||||
let list = [];
|
// this.goodsInfo = info.goods;
|
||||||
info.goods_image[0].forEach(item => {
|
// // 设置轮播图
|
||||||
|
// let list = [];
|
||||||
|
// info.goods_image[0].forEach(item => {
|
||||||
|
// let temp = {
|
||||||
|
// image: item
|
||||||
|
// }
|
||||||
|
// list.push(temp);
|
||||||
|
// })
|
||||||
|
// this.list = list;
|
||||||
|
// this.setTitle();
|
||||||
|
// },
|
||||||
|
setSwiperList(list) {
|
||||||
|
let img = [];
|
||||||
|
list.forEach(item => {
|
||||||
let temp = {
|
let temp = {
|
||||||
image: item
|
image: item
|
||||||
}
|
}
|
||||||
list.push(temp);
|
img.push(temp);
|
||||||
})
|
})
|
||||||
this.list = list;
|
this.list = img;
|
||||||
this.setTitle();
|
|
||||||
},
|
},
|
||||||
spikeGoods() {
|
spikeGoods() {
|
||||||
this.settlementOrder()
|
this.settlementOrder()
|
||||||
},
|
},
|
||||||
setSpikeTime() {
|
setSpikeTime(time) {
|
||||||
const time = this.groupbuyInfo.groupbuy_endtime;
|
// const time = this.groupbuyInfo.groupbuy_endtime;
|
||||||
this.timer = setInterval(() => {
|
this.timer = setInterval(() => {
|
||||||
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));
|
||||||
//计算出小时数
|
//计算出小时数
|
||||||
@@ -229,61 +294,111 @@ export default {
|
|||||||
// console.log(this.spikeTime);
|
// console.log(this.spikeTime);
|
||||||
}, 1000)
|
}, 1000)
|
||||||
},
|
},
|
||||||
buy(info){
|
addCart() {
|
||||||
if(info.type == 2){ // 加入购物车
|
|
||||||
this.$u.api.addCart({
|
this.$u.api.addCart({
|
||||||
goods_id: this.id,
|
goods_id: this.id,
|
||||||
quantity: info.value,
|
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',
|
type: res.errCode == 0 ? 'success' : 'warning',
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else if (info.type == 1) { // 支付
|
},
|
||||||
this.settlementOrder({num: info.value});
|
purchase() {
|
||||||
}
|
this.settlementOrder();
|
||||||
},
|
},
|
||||||
getGoodsDetails(id) {
|
getGoodsDetails(id) {
|
||||||
this.id = id;
|
switch (this.type) {
|
||||||
|
case 1:
|
||||||
|
this.ordinaryDetails(id);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
this.pinTuanDetails(id);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
this.spikeGoodsDetails(id);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 普通商品
|
||||||
|
ordinaryDetails(id) {
|
||||||
this.$u.api.getGoodsDetails({ id: id }).then((res)=>{
|
this.$u.api.getGoodsDetails({ id: id }).then((res)=>{
|
||||||
if (res.errCode == 0) {
|
if (res.errCode == 0) {
|
||||||
|
this.evaluate = res.data.goods_evaluate_info;
|
||||||
this.goodsInfo = res.data.goods;
|
this.goodsInfo = res.data.goods;
|
||||||
let list = [];
|
this.setSwiperList(res.data.goods_image[0]);
|
||||||
res.data.goods_image[0].forEach(item => {
|
|
||||||
let temp = {
|
|
||||||
image: item
|
|
||||||
}
|
|
||||||
list.push(temp);
|
|
||||||
})
|
|
||||||
this.list = list;
|
|
||||||
this.info = res.data.goods;
|
|
||||||
this.glist = res.data.spec_list;
|
this.glist = res.data.spec_list;
|
||||||
// console.log(this.goodsInfo.mobile_body);
|
// console.log(this.goodsInfo.mobile_body);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 下单
|
// 拼团
|
||||||
|
pinTuanDetails(id) {
|
||||||
|
this.$u.api.getPinTuanDetails({
|
||||||
|
pintuan_id: id
|
||||||
|
}).then(res => {
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
this.evaluate = res.data.data.goods_evaluate_info;
|
||||||
|
this.goodsInfo = res.data.data.goods;
|
||||||
|
this.setSwiperList(res.data.data.goods_image[0]);
|
||||||
|
this.glist = res.data.data.spec_list;
|
||||||
|
this.user_suc = res.data.data.user_suc;
|
||||||
|
this.groupUser =res.data.data.user;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 秒杀
|
||||||
|
spikeGoodsDetails(id) {
|
||||||
|
this.$u.api.getSpikeInfo({
|
||||||
|
groupbuy_id: id
|
||||||
|
}).then(res => {
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
this.groupbuyInfo = res.data.groupbuyInfo;
|
||||||
|
this.evaluate = res.data.goodsInfo.goods_evaluate_info;
|
||||||
|
this.goodsInfo = res.data.goodsInfo.goods;
|
||||||
|
this.setSwiperList(res.data.goodsInfo.goods_image[0]);
|
||||||
|
this.setSpikeTime(res.data.groupbuyInfo.groupbuy_endtime);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 试穿
|
||||||
|
tryDress() {
|
||||||
|
this.$u.route({
|
||||||
|
url: '/pageB/triedDress/index',
|
||||||
|
params: {
|
||||||
|
id: this.id,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
/*
|
/*
|
||||||
|
* @description 下单 订单步骤1:展示结算数据
|
||||||
* @params {Number} type 拼团或者开团
|
* @params {Number} type 拼团或者开团
|
||||||
|
* @params {Number} num 数量
|
||||||
|
* @params {Number} ifcart 结算方式 1:购物车 0:直接结算(立即购买/拼团/秒杀)
|
||||||
**/
|
**/
|
||||||
settlementOrder({type, num = 1} = {}) {
|
settlementOrder({type, num = this.goodsNumber, ifcart = 0} = {}) {
|
||||||
// ifcart 结算方式 1:购物车 0:直接结算(立即购买/拼团/秒杀)
|
|
||||||
let params = {
|
let params = {
|
||||||
ifcart: 0,
|
ifcart: ifcart,
|
||||||
cart_id: [this.goodsInfo.goods_id + '|' + num],
|
cart_id: [this.goodsInfo.goods_id + '|' + num],
|
||||||
}
|
}
|
||||||
if(this.type == 2) {
|
if(this.type == 2) {
|
||||||
if(type == 'involvement') {
|
if(type == 'involvement') {
|
||||||
Object.assign(params, {
|
Object.assign(params, {
|
||||||
pintuan_id: this.pintuan_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;
|
const userId = uni.getStorageSync('user_info').member.member_id;
|
||||||
this.$store.commit('setGroupHeadId', userId);
|
this.$store.commit('setGroupHeadId', userId);
|
||||||
Object.assign(params, {
|
Object.assign(params, {
|
||||||
pintuan_id: this.pintuan_id,
|
pintuan_id: this.id,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -297,16 +412,42 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 参团
|
||||||
involvemenGroup(user) {
|
involvemenGroup(user) {
|
||||||
this.involvemenGroupInfo = user;
|
this.involvemenGroupInfo = user;
|
||||||
this.showGroupUser = false;
|
this.showGroupUser = false;
|
||||||
this.showInvolvementUser = true;
|
this.showInvolvementUser = true;
|
||||||
// console.log(this.involvemenGroupInfo);
|
// console.log(this.involvemenGroupInfo);
|
||||||
},
|
},
|
||||||
xuanze(id){
|
valChange(e) {
|
||||||
console.log(id)
|
// console.log(this.value)
|
||||||
// this.getGoodsDetails(this.glist[id])
|
|
||||||
},
|
},
|
||||||
|
self(){
|
||||||
|
// console.log(this.$refs.guige)
|
||||||
|
let index = 0;
|
||||||
|
let arr = [];
|
||||||
|
for(let i in this.goodsInfo.spec_value){
|
||||||
|
// console.log(i)
|
||||||
|
// console.log(this.$refs.guige[index++].select)
|
||||||
|
// index++;
|
||||||
|
let sel = this.$refs.guige[index++].select
|
||||||
|
if(sel != 0){
|
||||||
|
arr.push(sel)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// console.log(arr.length)
|
||||||
|
if(arr.length == index){
|
||||||
|
this.sel = arr.join("|")
|
||||||
|
this.quanxuan = true
|
||||||
|
// console.log(this.sel)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
xuanze(id){
|
||||||
|
// console.log(id)
|
||||||
|
this.getGoodsDetails(this.glist[id])
|
||||||
|
this.id = this.glist[id];
|
||||||
|
},
|
||||||
|
// 设置页面标题
|
||||||
setTitle() {
|
setTitle() {
|
||||||
let title = '';
|
let title = '';
|
||||||
switch (this.type) {
|
switch (this.type) {
|
||||||
@@ -329,6 +470,14 @@ export default {
|
|||||||
title: title
|
title: title
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
viewComment() {
|
||||||
|
this.$u.route({
|
||||||
|
url: 'pageB/comment/index',
|
||||||
|
params: {
|
||||||
|
id: this.goodsInfo.goods_id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -336,6 +485,7 @@ export default {
|
|||||||
.sdetails {
|
.sdetails {
|
||||||
padding-bottom: 98rpx;
|
padding-bottom: 98rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
background-color: #EEEBEE;
|
||||||
.spike-view {
|
.spike-view {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 396rpx;
|
top: 396rpx;
|
||||||
@@ -397,7 +547,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.info {
|
.info {
|
||||||
|
background:rgba(255,255,255,1);
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
.title{
|
.title{
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
margin-bottom: 30rpx;
|
margin-bottom: 30rpx;
|
||||||
@@ -424,12 +576,42 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.comment {
|
||||||
|
margin-top: 20rpx;
|
||||||
|
background:rgba(255,255,255,1);
|
||||||
|
padding: 30rpx;
|
||||||
|
.title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
.left {
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: rgba(51,51,51,1);
|
||||||
|
}
|
||||||
|
.right {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: rgba(153,153,153,1);
|
||||||
|
> image {
|
||||||
|
width: 8rpx;
|
||||||
|
height: 16rpx;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.comment-none {
|
||||||
|
font-size: 26rpx;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 30rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
.hr {
|
.hr {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 20rpx;
|
height: 20rpx;
|
||||||
background-color: #ececec;
|
background-color: #ececec;
|
||||||
}
|
}
|
||||||
.group-user {
|
.group-user {
|
||||||
|
background: rgba(255,255,255,1);
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
.top {
|
.top {
|
||||||
margin-bottom: 28rpx;
|
margin-bottom: 28rpx;
|
||||||
@@ -580,6 +762,11 @@ export default {
|
|||||||
margin-right: 80rpx;
|
margin-right: 80rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.pintuan-none {
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #333;
|
||||||
|
margin: 100rpx auto 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -685,7 +872,7 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: rgba(255,255,255,1);
|
color: rgba(255,255,255,1);
|
||||||
z-index: 99;
|
z-index: 10076;
|
||||||
.launch {
|
.launch {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
background: rgba(253,211,96,1);
|
background: rgba(253,211,96,1);
|
||||||
@@ -706,7 +893,7 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 98rpx;
|
height: 98rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
z-index: 99;
|
z-index: 10076;
|
||||||
.left {
|
.left {
|
||||||
width: 190rpx;
|
width: 190rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -739,5 +926,82 @@ export default {
|
|||||||
background: rgba(221,221,221,1);
|
background: rgba(221,221,221,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.tloos{
|
||||||
|
background-color: #fff;
|
||||||
|
display: flex;
|
||||||
|
position: fixed;
|
||||||
|
height: 98rpx;
|
||||||
|
width: 100%;
|
||||||
|
bottom:0;
|
||||||
|
border-top: 1rpx solid #ececec;
|
||||||
|
z-index: 10076;
|
||||||
|
.navs{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #666;
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-left: 30rpx;
|
||||||
|
>image{
|
||||||
|
width: 35rpx;
|
||||||
|
height: 35rpx;
|
||||||
|
margin-bottom: 15rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
.button{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
line-height: 98rpx;
|
||||||
|
text-align: center;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.spec-popup {
|
||||||
|
padding: 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
max-height: 750rpx;
|
||||||
|
.head{
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
.image{
|
||||||
|
width: 195rpx;
|
||||||
|
height: 195rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.info{
|
||||||
|
display: flex;
|
||||||
|
padding: 21rpx 0;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-left: 27rpx;
|
||||||
|
flex-direction: column;
|
||||||
|
>text:first-child{
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
>text:last-child{
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #ff3131;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.num{
|
||||||
|
height: 84rpx;
|
||||||
|
display: flex;
|
||||||
|
border-bottom: #ececec solid 2rpx;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
>text{
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,19 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="search">
|
<view class="search">
|
||||||
<view class="sosuo">
|
|
||||||
<image></image>
|
|
||||||
<u-search placeholder="搜索您需要的商品" v-model="keyword" height="60" :action-style="{
|
|
||||||
'font-size':'32rpx',
|
|
||||||
'color':'#FF780F',
|
|
||||||
'overflow':'unset'
|
|
||||||
}"
|
|
||||||
@search="search"
|
|
||||||
></u-search>
|
|
||||||
</view>
|
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view class="title">搜索发现</view>
|
<view class="title">搜索发现</view>
|
||||||
<view class="label">
|
<view class="label">
|
||||||
<text>这是标签</text>
|
<text v-for="(label, index) in searchwordlist" :key="index" @click="search(label.word)">{{ label.word }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -23,17 +13,40 @@ export default {
|
|||||||
name:"search",
|
name:"search",
|
||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
keyword:""
|
keyword: "",
|
||||||
|
searchwordlist: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
this.getWordList();
|
||||||
|
},
|
||||||
|
// 点击搜索按钮
|
||||||
|
onNavigationBarButtonTap(e) {
|
||||||
|
if(e.index == 0) this.search(this.keyword);
|
||||||
|
},
|
||||||
|
// 输入框文本变化
|
||||||
|
onNavigationBarSearchInputChanged(e) {
|
||||||
|
this.keyword = e.text;
|
||||||
|
},
|
||||||
|
// 点击键盘搜索按钮
|
||||||
|
onNavigationBarSearchInputConfirmed(value) {
|
||||||
|
this.search(this.keyword);
|
||||||
|
},
|
||||||
methods:{
|
methods:{
|
||||||
|
getWordList() {
|
||||||
|
this.$u.api.searchwordlist().then(res => {
|
||||||
|
this.searchwordlist = res.data;
|
||||||
|
})
|
||||||
|
},
|
||||||
search(value){
|
search(value){
|
||||||
// console.log(value)
|
// console.log(value)
|
||||||
|
if(!value) this.$u.toast('搜索内容不可为空');
|
||||||
this.$u.route({
|
this.$u.route({
|
||||||
url: "/pageB/search/out",
|
url: "/pageB/search/out",
|
||||||
params: {
|
params: {
|
||||||
value,
|
value: value,
|
||||||
type:"shop"
|
type: "shop",
|
||||||
|
order: 'goods_salenum'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -67,6 +80,7 @@ export default {
|
|||||||
}
|
}
|
||||||
.label{
|
.label{
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
> text {
|
> text {
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
margin-right: 30rpx;
|
margin-right: 30rpx;
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="out">
|
<view class="out">
|
||||||
<view class="sosuo">
|
|
||||||
<image></image>
|
|
||||||
<u-search placeholder="搜索您需要的商品" v-model="keyword" height="60" :show-action="false"></u-search>
|
|
||||||
</view>
|
|
||||||
<u-tabs-swiper v-if="type == 'dianpu'" @change="tabsChange" :show-bar="false" :bold="false" :font-size="32" active-color="#FF780F" ref="uTabs" :list="list" :is-scroll="false" style="border-bottom: 1px solid #ececec;flex-shrink:0" height="88"></u-tabs-swiper>
|
<u-tabs-swiper v-if="type == 'dianpu'" @change="tabsChange" :show-bar="false" :bold="false" :font-size="32" active-color="#FF780F" ref="uTabs" :list="list" :is-scroll="false" style="border-bottom: 1px solid #ececec;flex-shrink:0" height="88"></u-tabs-swiper>
|
||||||
<swiper v-if="type == 'dianpu'" class="swiper" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
|
<swiper v-if="type == 'dianpu'" class="swiper" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
|
||||||
<swiper-item>
|
<swiper-item>
|
||||||
@@ -16,18 +12,18 @@
|
|||||||
<swiper-item>
|
<swiper-item>
|
||||||
<scroll-view :scroll-y="true" style="height:100%">
|
<scroll-view :scroll-y="true" style="height:100%">
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<darenItem style="margin-top:20rpx;margin-right:23rpx;box-shadow:0rpx 3rpx 7rpx 0rpx rgba(153, 153, 153, 0.35);" v-for="item in 50"></darenItem>
|
<!-- <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> -->
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
<view v-else style=" display: flex;flex-direction: column;height: calc(100vh - 88rpx);">
|
<view v-else style=" display: flex;flex-direction: column;height: calc(100vh - 88rpx);">
|
||||||
<view class="select">
|
<view class="select">
|
||||||
<view @click="sx(0)" data-type="xl">销量</view>
|
<view @click="sx(0)" class="xz" data-type="xl">销量</view>
|
||||||
<view class="xz" @click="sx(1)">
|
<view class="xz" @click="sx(1)">
|
||||||
<text>价格</text>
|
<text>价格</text>
|
||||||
<view class="jiage">
|
<view class="jiage">
|
||||||
<view class="top"></view>
|
<view class="top topxz"></view>
|
||||||
<view class="bottom bottomxz"></view>
|
<view class="bottom bottomxz"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -38,7 +34,6 @@
|
|||||||
<scroll-view :scroll-y="true" style="height:100%">
|
<scroll-view :scroll-y="true" style="height:100%">
|
||||||
<view style="padding-top:30rpx">
|
<view style="padding-top:30rpx">
|
||||||
<shop v-for="(i,j) in shoplist[0]" :key="j" :name="i.goods_name" :id="i.goods_id" :commonid="i.goods_commonid" :image="i.goods_image"></shop>
|
<shop v-for="(i,j) in shoplist[0]" :key="j" :name="i.goods_name" :id="i.goods_id" :commonid="i.goods_commonid" :image="i.goods_image"></shop>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
@@ -56,8 +51,6 @@
|
|||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -162,6 +155,11 @@ export default {
|
|||||||
shoplist:[]
|
shoplist:[]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onLoad(o){
|
||||||
|
this.type = o.type
|
||||||
|
this.keyword = o.value
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
tabsChange(index) {
|
tabsChange(index) {
|
||||||
this.swiperCurrent = index;
|
this.swiperCurrent = index;
|
||||||
@@ -189,10 +187,5 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(o){
|
|
||||||
this.type = o.type
|
|
||||||
this.keyword = o.value
|
|
||||||
this.search()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
BIN
pageB/static/cart.png
Normal file
BIN
pageB/static/cart.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.4 KiB |
283
pageB/triedDress/index.vue
Normal file
283
pageB/triedDress/index.vue
Normal file
@@ -0,0 +1,283 @@
|
|||||||
|
<template>
|
||||||
|
<view class="tried">
|
||||||
|
<view class="user-info">
|
||||||
|
<view>
|
||||||
|
<label for="name">试穿人:</label>
|
||||||
|
<input type="text" id="name" placeholder="" v-model="name" />
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<label for="phone">手机号:</label>
|
||||||
|
<input type="text" id="phone" placeholder="" maxlength="11" v-model="phone" />
|
||||||
|
</view>
|
||||||
|
<view class="area" @click="show=true">
|
||||||
|
<label for="address">省市区:</label>
|
||||||
|
<input type="text" id="address" placeholder="" v-model="address" disabled />
|
||||||
|
<view>
|
||||||
|
<image src="/static/image/mine/24.png"></image>
|
||||||
|
<text>定位</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<label for="area">详细地址:</label>
|
||||||
|
<input type="text" id="area" placeholder="" v-model="area" />
|
||||||
|
</view>
|
||||||
|
<view @click="showTime=true">
|
||||||
|
<label for="time">预约时间:</label>
|
||||||
|
<input type="text" id="time" placeholder="" disabled v-model="time" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<u-picker mode="time" v-model="showTime" :params="params" @confirm="chooseDate"></u-picker>
|
||||||
|
<view class="goods-container">
|
||||||
|
<view class="store">
|
||||||
|
<image :src="store.store_avatar"></image>
|
||||||
|
<text>{{ store.store_name }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="goods">
|
||||||
|
<image :src="goodsInfo.goods_image"></image>
|
||||||
|
<view class="right">
|
||||||
|
<view class="name u-line-2">{{ goodsInfo.goods_name }}</view>
|
||||||
|
<u-number-box v-model="number" bg-color="#FFFFFF" :min="1" :input-width="38" :input-height="38" color="#FF780F"></u-number-box>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="edit-btn" @click="confirmBtn">确认试穿</view>
|
||||||
|
<u-select v-model="show"
|
||||||
|
mode="mutil-column-auto"
|
||||||
|
:list="areaList"
|
||||||
|
value-name="area_id"
|
||||||
|
label-name="area_name"
|
||||||
|
child-name="_child"
|
||||||
|
@confirm="setArea">
|
||||||
|
</u-select>
|
||||||
|
<u-toast ref="uToast" />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
show: false,
|
||||||
|
areaList: [],
|
||||||
|
checked: false, // 是否设为默认地址
|
||||||
|
name: '',
|
||||||
|
phone: '',
|
||||||
|
address: '', // 选择地址
|
||||||
|
area: '', // 详细地址
|
||||||
|
time: '',
|
||||||
|
showTime: false,
|
||||||
|
number: 1, // 商品数量
|
||||||
|
area_id: '', // 地区id 省
|
||||||
|
city_id: '', // 城市id
|
||||||
|
goodsInfo: {},
|
||||||
|
store: {},
|
||||||
|
params: {
|
||||||
|
year: true,
|
||||||
|
month: true,
|
||||||
|
day: true,
|
||||||
|
hour: true,
|
||||||
|
minute: true,
|
||||||
|
second: false
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getAreaData();
|
||||||
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
this.ordinaryDetails(option.id);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
verification() {
|
||||||
|
if(this.$u.test.isEmpty(this.name)) {
|
||||||
|
this.$u.toast('姓名不可为空');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(this.$u.test.isEmpty(this.phone)) {
|
||||||
|
this.$u.toast('手机号不可为空');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(!this.$u.test.mobile(this.phone)) {
|
||||||
|
this.$u.toast('请填写正确的新手机号');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(this.$u.test.isEmpty(this.address)) {
|
||||||
|
this.$u.toast('地址不可为空');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(this.$u.test.isEmpty(this.area)) {
|
||||||
|
this.$u.toast('详细地址不可为空');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(this.$u.test.isEmpty(this.time)) {
|
||||||
|
this.$u.toast('预约时间不可为空');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(new Date(this.time) < new Date()) {
|
||||||
|
this.$u.toast('预约时间错误');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
chooseDate(e) {
|
||||||
|
let time = e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute;
|
||||||
|
this.time = time;
|
||||||
|
},
|
||||||
|
confirmBtn() {
|
||||||
|
if(!this.verification()) return false;
|
||||||
|
this.$u.api.saveGoodsTry({
|
||||||
|
member_name: this.name,
|
||||||
|
member_mobile: this.phone,
|
||||||
|
area_info: this.address,
|
||||||
|
address_detail: this.area,
|
||||||
|
goods_id: this.goodsInfo.goods_id,
|
||||||
|
num: this.number,
|
||||||
|
store_id: this.store.store_id,
|
||||||
|
appointment_time: new Date(this.time),
|
||||||
|
}).then(res => {
|
||||||
|
this.$u.toast(res.message);
|
||||||
|
if (res.errCode == 0) {
|
||||||
|
// this.$u.route({ type: 'navigateBack' });
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getAreaData() {
|
||||||
|
this.$u.api.getArea().then((res)=>{
|
||||||
|
if (res.errCode == 0) {
|
||||||
|
this.areaList = res.data;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
setArea(area) {
|
||||||
|
// console.log(area);
|
||||||
|
this.area_id = area[0].value;
|
||||||
|
this.city_id = area[1].value;
|
||||||
|
let temp = '';
|
||||||
|
area.forEach(e => {
|
||||||
|
temp += e.label + ' ';
|
||||||
|
});
|
||||||
|
this.address = temp;
|
||||||
|
},
|
||||||
|
ordinaryDetails(id) {
|
||||||
|
this.$u.api.getGoodsDetails({ id: id }).then((res)=>{
|
||||||
|
if (res.errCode == 0) {
|
||||||
|
this.goodsInfo = res.data.goods;
|
||||||
|
this.store = res.data.store;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.tried {
|
||||||
|
.user-info {
|
||||||
|
border-top: 1rpx solid rgba(235,235,235,1);
|
||||||
|
> view {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
height: 98rpx;
|
||||||
|
padding: 30rpx;
|
||||||
|
border-bottom: 2rpx solid rgba(235,235,235,1);
|
||||||
|
font-size: 30rpx;
|
||||||
|
> label {
|
||||||
|
width: 150rpx;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
> input {
|
||||||
|
flex: 1;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.area {
|
||||||
|
padding: 0 30rpx;
|
||||||
|
display: flex;
|
||||||
|
> input {
|
||||||
|
padding: 30rpx 0;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
> view {
|
||||||
|
margin-left: 30rpx;
|
||||||
|
width: 50rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 22rpx;
|
||||||
|
color: rgba(255,120,15,1);
|
||||||
|
> image {
|
||||||
|
width: 26rpx;
|
||||||
|
height: 32rpx;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.goods-container {
|
||||||
|
padding: 30rpx;
|
||||||
|
.store {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
|
> image {
|
||||||
|
width: 60rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 16rpx;
|
||||||
|
background-color: antiquewhite;
|
||||||
|
}
|
||||||
|
> text {
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: rgba(51,51,51,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.goods {
|
||||||
|
display: flex;
|
||||||
|
> image {
|
||||||
|
width: 180rpx;
|
||||||
|
height: 160rpx;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
background-color: aquamarine;
|
||||||
|
}
|
||||||
|
.right {
|
||||||
|
flex: 1;
|
||||||
|
.name {
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: rgba(51,51,51,1);
|
||||||
|
line-height: 44rpx;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
}
|
||||||
|
/deep/ .u-numberbox {
|
||||||
|
border: 1rpx solid rgba(217,215,215,1);
|
||||||
|
.u-icon-minus, .u-icon-plus {
|
||||||
|
width: 38rpx;
|
||||||
|
.u-icon {
|
||||||
|
.u-icon__icon {
|
||||||
|
font-size: 11rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.u-number-input {
|
||||||
|
margin: 0;
|
||||||
|
border: 1rpx solid rgba(229,229,229,1) {
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.edit-btn {
|
||||||
|
margin: 122rpx auto 0;
|
||||||
|
width: 690rpx;
|
||||||
|
height: 98rpx;
|
||||||
|
background: rgba(255,119,15,1);
|
||||||
|
border-radius: 49rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color:rgba(255,255,255,1);
|
||||||
|
line-height: 98rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="order">
|
<view class="order">
|
||||||
<view class="info-address" @click="changeAddress">
|
<view class="info-address" @click="changeAddress" v-if="JSON.stringify(addressInfo) != '{}'">
|
||||||
<image src="../static/image/2.png" class="address-icon"></image>
|
<image src="../static/image/2.png" class="address-icon"></image>
|
||||||
<view class="address">
|
<view class="address">
|
||||||
<view class="user-info">
|
<view class="user-info">
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<image src="../static/image/1.png" class="right"></image>
|
<image src="../static/image/1.png" class="right"></image>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-else class="address-none" @click="changeAddress">请选择地址</view>
|
||||||
<view class="main">
|
<view class="main">
|
||||||
<view v-for="(item, index) in orderInfo.store_cart_list" :key="index">
|
<view v-for="(item, index) in orderInfo.store_cart_list" :key="index">
|
||||||
<view class="goods-info">
|
<view class="goods-info">
|
||||||
@@ -68,13 +69,13 @@
|
|||||||
<u-popup v-model="couponStatus" mode="bottom">
|
<u-popup v-model="couponStatus" mode="bottom">
|
||||||
<scroll-view class="coupon-choose" scroll-y style="height: 800rpx;" v-if="this.couponType.type == 1">
|
<scroll-view class="coupon-choose" scroll-y style="height: 800rpx;" v-if="this.couponType.type == 1">
|
||||||
<view class="title">优惠券详情</view>
|
<view class="title">优惠券详情</view>
|
||||||
<view class="text">店铺优惠券</view>
|
<view class="text">平台优惠券</view>
|
||||||
<Coupon :couponInfo="coupon" @use="useCoupon($event)" :goodsClass="goodsClass" v-for="(coupon, index) in orderInfo.store_voucher_all_list" :key="index"></Coupon>
|
<Coupon :couponInfo="coupon" @use="useCoupon($event)" :goodsClass="goodsClass" v-for="(coupon, index) in orderInfo.store_voucher_all_list" :key="index"></Coupon>
|
||||||
<u-empty text="无可用优惠券" mode="coupon" v-if="!orderInfo.store_voucher_all_list.length"></u-empty>
|
<u-empty text="无可用优惠券" mode="coupon" v-if="!orderInfo.store_voucher_all_list.length"></u-empty>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<scroll-view class="coupon-choose" scroll-y style="height: 800rpx;" v-if="this.couponType.type == 2">
|
<scroll-view class="coupon-choose" scroll-y style="height: 800rpx;" v-if="this.couponType.type == 2">
|
||||||
<view class="title">优惠券详情</view>
|
<view class="title">优惠券详情</view>
|
||||||
<view class="text">平台优惠券</view>
|
<view class="text">店铺优惠券</view>
|
||||||
<Coupon :couponInfo="coupon" @use="useCoupon($event)" :goodsClass="goodsClass" v-for="(coupon, index) in orderInfo.store_voucher_list[this.couponType.store_id]" :key="index"></Coupon>
|
<Coupon :couponInfo="coupon" @use="useCoupon($event)" :goodsClass="goodsClass" v-for="(coupon, index) in orderInfo.store_voucher_list[this.couponType.store_id]" :key="index"></Coupon>
|
||||||
<u-empty text="无可用优惠券" mode="coupon" v-if="!orderInfo.store_voucher_list[this.couponType.store_id].length"></u-empty>
|
<u-empty text="无可用优惠券" mode="coupon" v-if="!orderInfo.store_voucher_list[this.couponType.store_id].length"></u-empty>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
@@ -121,7 +122,6 @@ export default {
|
|||||||
choiceCoupon: {}, // 使用的平台优惠券
|
choiceCoupon: {}, // 使用的平台优惠券
|
||||||
goodsClass: [],
|
goodsClass: [],
|
||||||
orderType: '', // 订单类型 1 普通订单 2 拼团订单 3 秒杀订单 4 优惠券 5 购物车订单
|
orderType: '', // 订单类型 1 普通订单 2 拼团订单 3 秒杀订单 4 优惠券 5 购物车订单
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -147,16 +147,19 @@ 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(this.orderType);
|
||||||
console.log(this.orderInfo);
|
// console.log(this.orderInfo);
|
||||||
this.getGoodsClass();
|
this.getGoodsClass();
|
||||||
|
this.setTotalPrice();
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
this.storeCoupon = {};
|
||||||
|
this.choiceCoupon = {};
|
||||||
// 判断是不是从选择地址页面返回
|
// 判断是不是从选择地址页面返回
|
||||||
if(JSON.stringify(this.$store.state.orderAddress) == '{}') {
|
if(JSON.stringify(this.$store.state.orderAddress) == '{}') {
|
||||||
this.$store.commit('updateAddress', this.orderInfo.address_info);
|
if(this.orderInfo.address_info) this.$store.commit('updateAddress', this.orderInfo.address_info);
|
||||||
} else {
|
} else {
|
||||||
this.addressInfo = this.$store.state.orderAddress;
|
if(this.$store.getters.getOrderAddress) this.addressInfo = this.$store.state.orderAddress;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
@@ -165,22 +168,8 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
'$store.state.orderAddress'(value) {
|
'$store.state.orderAddress'(value) {
|
||||||
this.addressInfo = value;
|
this.addressInfo = value;
|
||||||
this.getFreight();
|
if(JSON.stringify(value) != '{}') this.getFreight();
|
||||||
},
|
},
|
||||||
// storeCoupon: {
|
|
||||||
// deep: true,
|
|
||||||
// handler() {
|
|
||||||
// console.log(222);
|
|
||||||
// this.setTotalPrice(); // 计算总价
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// choiceCoupon: {
|
|
||||||
// deep: true,
|
|
||||||
// handler() {
|
|
||||||
// console.log(111);
|
|
||||||
// this.setTotalPrice(); // 计算总价
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 如果有pintuangroup_headid为参团不然为开团
|
// 如果有pintuangroup_headid为参团不然为开团
|
||||||
@@ -205,9 +194,14 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
intermediate() {
|
intermediate() {
|
||||||
if(this.orderType == 2) this.withImmediate();
|
if(this.orderType == 2) {
|
||||||
|
this.withImmediate();
|
||||||
|
} else if(this.orderType == 1) {
|
||||||
|
this.sendOrder(0);
|
||||||
|
}
|
||||||
else this.sendOrder(1);
|
else this.sendOrder(1);
|
||||||
},
|
},
|
||||||
|
// @params {Number} ifcart 是否是购物车商品
|
||||||
sendOrder(ifcart) {
|
sendOrder(ifcart) {
|
||||||
// 拼接后端需要的数据形式
|
// 拼接后端需要的数据形式
|
||||||
let id = [], temp = '';
|
let id = [], temp = '';
|
||||||
@@ -236,21 +230,27 @@ export default {
|
|||||||
if(JSON.stringify(this.choiceCoupon) != '{}') {
|
if(JSON.stringify(this.choiceCoupon) != '{}') {
|
||||||
coupon.push(0 + '|' + this.choiceCoupon.voucher_id)
|
coupon.push(0 + '|' + this.choiceCoupon.voucher_id)
|
||||||
}
|
}
|
||||||
|
// 验证是否选择地址
|
||||||
|
if(!this.addressInfo || JSON.stringify(this.addressInfo) == '{}') {
|
||||||
|
this.$u.toast('收货地址不能为空');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
let params = {
|
let params = {
|
||||||
ifcart: ifcart,
|
ifcart: ifcart,
|
||||||
cart_id: id,
|
cart_id: id,
|
||||||
address_id: this.addressInfo.address_id,
|
address_id: this.addressInfo.address_id,
|
||||||
buy_city_id: this.addressInfo.city_id,
|
buy_city_id: this.addressInfo.city_id,
|
||||||
voucher_id: coupon,
|
|
||||||
}
|
}
|
||||||
|
if(coupon.length) Object.assign(params, { voucher_id: coupon });
|
||||||
if(this.orderType == 2) {
|
if(this.orderType == 2) {
|
||||||
Object.assign(params, { pintuan_id: this.orderInfo.pintuan_id })
|
Object.assign(params, { pintuan_id: this.orderInfo.pintuan_id });
|
||||||
if(this.orderInfo.pintuangroup_id) Object.assign(params, { pintuangroup_id: this.orderInfo.pintuangroup_id })
|
if(this.orderInfo.pintuangroup_id) Object.assign(params, { pintuangroup_id: this.orderInfo.pintuangroup_id });
|
||||||
}
|
}
|
||||||
// console.log(params);
|
// console.log(params);
|
||||||
this.$u.api.sendOrder(params).then(res => {
|
this.$u.api.sendOrder(params).then(res => {
|
||||||
if(res.errCode == 0) {
|
if(res.errCode == 0) {
|
||||||
this.$u.route({
|
this.$u.route({
|
||||||
|
type: 'redirect',
|
||||||
url: '/pageC/cart/cashier',
|
url: '/pageC/cart/cashier',
|
||||||
params: {
|
params: {
|
||||||
pay_sn: res.data.pay_sn,
|
pay_sn: res.data.pay_sn,
|
||||||
@@ -297,6 +297,7 @@ export default {
|
|||||||
},
|
},
|
||||||
setTotalPrice() {
|
setTotalPrice() {
|
||||||
const goods = this.orderInfo.store_goods_total;
|
const goods = this.orderInfo.store_goods_total;
|
||||||
|
console.log(this.freight);
|
||||||
const freight = this.freight;
|
const freight = this.freight;
|
||||||
let price = 0;
|
let price = 0;
|
||||||
// 商品价格加上运费
|
// 商品价格加上运费
|
||||||
@@ -391,6 +392,14 @@ export default {
|
|||||||
height: 22rpx;
|
height: 22rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.address-none {
|
||||||
|
height: 150rpx;
|
||||||
|
line-height: 150rpx;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
background:rgba(255,255,255,1);
|
||||||
|
text-align: center;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
.main {
|
.main {
|
||||||
margin-bottom: 50rpx;
|
margin-bottom: 50rpx;
|
||||||
> view {
|
> view {
|
||||||
|
|||||||
@@ -54,24 +54,10 @@ export default {
|
|||||||
// getProvider() {
|
// getProvider() {
|
||||||
// uni.getProvider({service: 'payment'})
|
// uni.getProvider({service: 'payment'})
|
||||||
// },
|
// },
|
||||||
// 支付宝支付
|
payOrder(provider, orderInfo) {
|
||||||
payByAlipay (orderInfo) {
|
|
||||||
uni.requestPayment({
|
uni.requestPayment({
|
||||||
provider: 'alipay',
|
provider: provider,
|
||||||
orderInfo: orderInfo, //支付宝订单数据
|
orderInfo: orderInfo, //订单数据
|
||||||
success: function (res) {
|
|
||||||
console.log('success:' + JSON.stringify(res));
|
|
||||||
},
|
|
||||||
fail: function (err) {
|
|
||||||
console.log('fail:' + JSON.stringify(err));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 微信支付
|
|
||||||
payByWxpay (orderInfo) {
|
|
||||||
uni.requestPayment({
|
|
||||||
provider: 'wxpay',
|
|
||||||
orderInfo: orderInfo, //微信订单数据
|
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
console.log('success:' + JSON.stringify(res));
|
console.log('success:' + JSON.stringify(res));
|
||||||
},
|
},
|
||||||
@@ -86,11 +72,15 @@ export default {
|
|||||||
payment_code: this.pay_way,
|
payment_code: this.pay_way,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if(res.errCode == 0) {
|
if(res.errCode == 0) {
|
||||||
// this.$u.toast(res.message);
|
let orderInfo, provider;
|
||||||
// uni.navigateBack();
|
if(res.data.payment_code == 'wxpay_app') {
|
||||||
const orderInfo = JSON.parse(res.data.content);
|
provider = 'wxpay';
|
||||||
console.log(orderInfo);
|
orderInfo = JSON.parse(res.data.content);
|
||||||
this.pay_way == 'wxpay_app' ? this.payByWxpay(orderInfo) : this.payByAlipay(orderInfo);
|
} else if(res.data.payment_code == 'alipay_app') {
|
||||||
|
provider = 'alipay';
|
||||||
|
orderInfo = res.data.content;
|
||||||
|
}
|
||||||
|
this.payOrder(provider, orderInfo);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
</view>
|
</view>
|
||||||
<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" :style="{height: swiperHeight}">
|
<swiper :current="swiperCurrent" @transition="transition" @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="height: 800rpx;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>
|
<SpecialGoods v-for="(item, index) in pinTuanList" :key="index" :item="item" type='group'></SpecialGoods>
|
||||||
<!-- <loadmore ref="loadmore" @callback="getPinTuanList" bgColor="#FFF"></loadmore> -->
|
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20" v-if="pinTuanList.length>=pageSize" @loadmore="onreachBottom"></u-loadmore>
|
||||||
<u-empty text="暂无商品" mode="list" color="#000" v-if="!pinTuanList.length"></u-empty>
|
<u-empty text="暂无商品" mode="list" color="#000" v-if="!pinTuanList.length"></u-empty>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
@@ -15,22 +15,22 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import loadmore from "@/components/loadmore/index";
|
|
||||||
import SpecialGoods from "../../components/shop/special-shop/index";
|
import SpecialGoods from "../../components/shop/special-shop/index";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
pageSize: 12,
|
||||||
tabList: [],
|
tabList: [],
|
||||||
current: -1,
|
current: -1,
|
||||||
swiperCurrent: 0,
|
swiperCurrent: 0,
|
||||||
page: 0,
|
page: 0,
|
||||||
pinTuanList: [],
|
pinTuanList: [],
|
||||||
swiperHeight: '',
|
swiperHeight: '',
|
||||||
timer: '', // 限制下拉刷新
|
timer: true, // 限制下拉刷新
|
||||||
|
loadStatus: 'loadmore',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
loadmore,
|
|
||||||
SpecialGoods,
|
SpecialGoods,
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
@@ -39,8 +39,7 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
current(index) {
|
current(index) {
|
||||||
// console.log(this.tabList);
|
this.getPinTuanList({ id: this.tabList[index].gc_id, load: 'reload' });
|
||||||
this.getPinTuanList({id: this.tabList[index].gc_id });
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -54,14 +53,39 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 拼团列表
|
// 拼团列表
|
||||||
async getPinTuanList({ id, page }) {
|
async getPinTuanList({ id, page, load }) {
|
||||||
const res = await this.$u.api.getPinTuanList({
|
const res = await this.$u.api.getPinTuanList({
|
||||||
page: this.page,
|
page: this.page,
|
||||||
gc_id: id,
|
gc_id: id,
|
||||||
})
|
})
|
||||||
this.pinTuanList = res.data;
|
this.timer = true;
|
||||||
|
if (res.errCode == 0) {
|
||||||
|
if(load == 'reload') this.pinTuanList = res.data;
|
||||||
|
else if(load == 'loadmore') this.pinTuanList.push(...res.data);
|
||||||
|
}
|
||||||
return res.data.length;
|
return res.data.length;
|
||||||
},
|
},
|
||||||
|
// scroll-view到底部加载更多
|
||||||
|
onreachBottom() {
|
||||||
|
if(!this.timer) return false;
|
||||||
|
this.loadStatus = "loading";
|
||||||
|
this.page++;
|
||||||
|
this.getPinTuanList({
|
||||||
|
id: this.tabList[this.current].gc_id,
|
||||||
|
load: 'loadmore',
|
||||||
|
}).then(length => {
|
||||||
|
console.log(length);
|
||||||
|
if(length == 0) {
|
||||||
|
this.page--;
|
||||||
|
this.loadStatus = 'nomore';
|
||||||
|
} else {
|
||||||
|
this.loadStatus = 'loadmore';
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.loadStatus = "nomore";
|
||||||
|
this.page--;
|
||||||
|
})
|
||||||
|
},
|
||||||
// tabs通知swiper切换
|
// tabs通知swiper切换
|
||||||
tabsChange(index) {
|
tabsChange(index) {
|
||||||
this.swiperCurrent = index;
|
this.swiperCurrent = index;
|
||||||
@@ -78,24 +102,6 @@ export default {
|
|||||||
this.swiperCurrent = current;
|
this.swiperCurrent = current;
|
||||||
this.current = current;
|
this.current = current;
|
||||||
},
|
},
|
||||||
// scroll-view到底部加载更多
|
|
||||||
onreachBottom() {
|
|
||||||
this.$$refs.loadmore.reachBottom();
|
|
||||||
// if(!this.timer) return false;
|
|
||||||
// this.loadStatus = "loading";
|
|
||||||
// this.page++;
|
|
||||||
// this.getPinTuanList().then(length => {
|
|
||||||
// if(length == 0) {
|
|
||||||
// this.page--;
|
|
||||||
// this.status = 'nomore';
|
|
||||||
// } else {
|
|
||||||
// this.status = 'loading';
|
|
||||||
// }
|
|
||||||
// }).catch(() => {
|
|
||||||
// this.loadStatus = "nomore";
|
|
||||||
// this.page--;
|
|
||||||
// })
|
|
||||||
},
|
|
||||||
setViewHeight() {
|
setViewHeight() {
|
||||||
const res = uni.getSystemInfoSync();
|
const res = uni.getSystemInfoSync();
|
||||||
this.swiperHeight = res.windowHeight - (88 / 2) + 'px';
|
this.swiperHeight = res.windowHeight - (88 / 2) + 'px';
|
||||||
|
|||||||
@@ -67,6 +67,34 @@ export default {
|
|||||||
onLoad() {
|
onLoad() {
|
||||||
this.getUserInfo();
|
this.getUserInfo();
|
||||||
},
|
},
|
||||||
|
// 监听头像裁剪
|
||||||
|
created() {
|
||||||
|
// uni.$on('uAvatarCropper', path => {
|
||||||
|
// const url = this.$u.http.config.baseUrl + '/Upload/uploadfile';
|
||||||
|
// this.avatar = path;
|
||||||
|
// // 可以在此上传到服务端
|
||||||
|
// // uni.uploadFile({
|
||||||
|
// // url: 'http://www.example.com/upload',
|
||||||
|
// // filePath: path,
|
||||||
|
// // name: 'file',
|
||||||
|
// // complete: (res) => {
|
||||||
|
// // console.log(res);
|
||||||
|
// // }
|
||||||
|
// // });
|
||||||
|
// common.uploadFile({
|
||||||
|
// url: url,
|
||||||
|
// name: 'avatar',
|
||||||
|
// filePath: path
|
||||||
|
// }).then(result => {
|
||||||
|
// // console.log(result);
|
||||||
|
// this.$set(this, 'avatar', result.file_path);
|
||||||
|
// // this.avatar = result.file_path;
|
||||||
|
// this.uploadPath = result.file_name;
|
||||||
|
// }, error => {
|
||||||
|
// this.$u.toast(error);
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
},
|
||||||
onNavigationBarButtonTap(e) {
|
onNavigationBarButtonTap(e) {
|
||||||
if( e.index == 0 ) uni.navigateBack();
|
if( e.index == 0 ) uni.navigateBack();
|
||||||
},
|
},
|
||||||
@@ -94,6 +122,17 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 头像裁剪
|
||||||
|
// chooseAvatar() {
|
||||||
|
// this.$u.route({
|
||||||
|
// url: '/uview-ui/components/u-avatar-cropper/u-avatar-cropper',
|
||||||
|
// params: {
|
||||||
|
// destWidth: 300,
|
||||||
|
// rectWidth: 200,
|
||||||
|
// fileType: 'jpg',
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// },
|
||||||
getUserInfo() {
|
getUserInfo() {
|
||||||
this.$u.api.getMemberInfo().then(res => {
|
this.$u.api.getMemberInfo().then(res => {
|
||||||
if (res.errCode == 0) {
|
if (res.errCode == 0) {
|
||||||
@@ -117,6 +156,7 @@ export default {
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.errCode == 0) {
|
if (res.errCode == 0) {
|
||||||
this.getUserInfo();
|
this.getUserInfo();
|
||||||
|
this.$u.toast(res.message);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
<view class="integral-top">
|
<view class="integral-top">
|
||||||
<view>
|
<view>
|
||||||
<view class="title">总积分</view>
|
<view class="title">总积分</view>
|
||||||
<view class="value">{{ memberInfo.member_points }}</view>
|
<view class="value">{{ memberInfo.member_points || 0 }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<view class="title">经验值</view>
|
<view class="title">经验值</view>
|
||||||
<view class="value">{{ memberInfo.member_exppoints }}</view>
|
<view class="value">{{ memberInfo.member_exppoints || 0 }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="viewProgress">
|
<view @click="viewProgress">
|
||||||
<view class="title">预计进度</view>
|
<view class="title">预计进度</view>
|
||||||
|
|||||||
@@ -13,11 +13,25 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import common from '@/static/js/common.js';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
nodes: '<h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1><h1>2</h1>'
|
nodes: '',
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getMemberPointsStat();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getMemberPointsStat() {
|
||||||
|
this.$u.api.getMemberPointsStat().then((res)=>{
|
||||||
|
if (res.errCode == 0) {
|
||||||
|
const nodes = res.data.grade_rule;
|
||||||
|
this.nodes = common.unescapeHTML(nodes);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -3,20 +3,11 @@
|
|||||||
<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="88" ></u-tabs-swiper>
|
||||||
<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%;">
|
<scroll-view scroll-y style="height: 100%;" @scrolltolower="onreachBottom">
|
||||||
<view v-for="(coupon, index) in couponList" :key="index" class="coupon-item">
|
<view v-for="(coupon, index) in couponList" :key="index" class="coupon-item">
|
||||||
<!-- <img src="../static/mine/23.png" />
|
|
||||||
<view class="coupon-main">
|
|
||||||
<view class="coupon-title">萌店十元优惠券</view>
|
|
||||||
<view class="coupon-date">
|
|
||||||
<img src="../static/mine/26.png" />
|
|
||||||
<view>2020.05.17-2020.06.17</view>
|
|
||||||
</view>
|
|
||||||
<view class="coupon-integral">299积分</view>
|
|
||||||
</view>
|
|
||||||
<view class="coupon-btn">兑换</view> -->
|
|
||||||
<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.length"></u-empty>
|
<u-empty text="暂无优惠券" mode="coupon" color="#000" v-if="!couponList.length"></u-empty>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
@@ -28,12 +19,15 @@ import Coupon from "@/components/mine/coupon/index";
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
pageSize: 1,
|
||||||
swiperHeight: '',
|
swiperHeight: '',
|
||||||
couponCurrent: 0,
|
couponCurrent: 0,
|
||||||
swiperCouponCurrent: 0,
|
swiperCouponCurrent: 0,
|
||||||
couponGroupList: [],
|
couponGroupList: [],
|
||||||
couponList: [],
|
couponList: [],
|
||||||
page: 0,
|
page: 0,
|
||||||
|
loadStatus: 'loadmore',
|
||||||
|
timer: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -46,32 +40,51 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
couponCurrent(index) {
|
couponCurrent(index) {
|
||||||
const id = this.couponGroupList[index].gc_id;
|
const id = this.couponGroupList[index].gc_id;
|
||||||
this.getCouponList({ gc_id: id });
|
this.getCouponList({ gc_id: id, load: 'reload' });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
onreachBottom() {
|
||||||
|
if(!this.timer) return false;
|
||||||
|
this.loadStatus = "loading";
|
||||||
|
this.page++;
|
||||||
|
this.getCouponList({
|
||||||
|
gc_id: this.couponGroupList[this.couponCurrent].gc_id,
|
||||||
|
load: 'loadmore',
|
||||||
|
}).then(length => {
|
||||||
|
if(length == 0) {
|
||||||
|
this.page--;
|
||||||
|
this.loadStatus = 'nomore';
|
||||||
|
} else {
|
||||||
|
this.loadStatus = 'loading';
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.loadStatus = "nomore";
|
||||||
|
this.page--;
|
||||||
|
})
|
||||||
|
},
|
||||||
getGoodsClass() {
|
getGoodsClass() {
|
||||||
this.$u.api.getGoodsClass().then(res => {
|
this.$u.api.getGoodsClass().then(res => {
|
||||||
if(res.errCode == 0) {
|
if(res.errCode == 0) {
|
||||||
this.couponGroupList = res.data;
|
this.couponGroupList = res.data;
|
||||||
this.getCouponList(this.couponGroupList[0].gc_id);
|
this.getCouponList({ gc_id: this.couponGroupList[0].gc_id, load: 'reload' });
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCouponList({ gc_id }) {
|
async getCouponList({ gc_id, load }) {
|
||||||
this.$u.api.getCouponList({
|
const res = await this.$u.api.getCouponList({
|
||||||
page: this.page,
|
page: this.page,
|
||||||
gc_id: gc_id,
|
gc_id: gc_id,
|
||||||
}).then(res => {
|
|
||||||
if(res.errCode == 0) {
|
|
||||||
this.couponList = res.data;
|
|
||||||
} else {
|
|
||||||
this.couponList = [];
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
this.timer = true;
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
if(load == 'reload') this.couponList = res.data;
|
||||||
|
else if(load == 'loadmore') this.couponList.push(...res.data);
|
||||||
|
}
|
||||||
|
return res.data.length;
|
||||||
},
|
},
|
||||||
exchangeCoupon(id) {
|
exchangeCoupon(id) {
|
||||||
console.log(id);
|
// console.log(id);
|
||||||
|
|
||||||
},
|
},
|
||||||
couponTabsChange(index) {
|
couponTabsChange(index) {
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="progress">
|
<view class="progress" v-if="memberInfo">
|
||||||
<view class="header">
|
<view class="header">
|
||||||
<view class="line-progress">
|
<view class="line-progress">
|
||||||
<view class="rank-value">lv1</view>
|
<view class="rank-value">lv{{ memberInfo.member_level }}</view>
|
||||||
<view class="line-box">
|
<view class="line-box">
|
||||||
<u-line-progress :percent="70" :show-percent="false" inactive-color="#FFFFFF" active-color="#F1A36B" height="30"></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>78/99</text>
|
<text>{{ memberInfo.member_exppoints | percentExp(rank[memberInfo.member_level - 1])}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="rank-value">lv2</view>
|
<view class="rank-value">lv{{ memberInfo.member_level + 1 }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="exp-value">经验值<span>78</span></view>
|
<view class="exp-value">经验值<span>{{ memberInfo.member_exppoints }}</span></view>
|
||||||
<view class="distance">距离下一级还需要21经验值</view>
|
<view class="distance">距离下一级还需要{{ memberInfo.member_exppoints | residualExp(rank[memberInfo.member_level - 1]) }}经验值</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="body">
|
<view class="body">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
@@ -66,8 +66,37 @@ export default {
|
|||||||
min: 5000,
|
min: 5000,
|
||||||
max: '--',
|
max: '--',
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
percent: 0,
|
||||||
|
memberInfo: {},
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
filters: {
|
||||||
|
percentExp(value, rank) {
|
||||||
|
// console.log(rank);
|
||||||
|
let result = '0/0';
|
||||||
|
if(rank) result = value + '/' + rank.max;
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
residualExp(value, rank) {
|
||||||
|
let result = 0;
|
||||||
|
if(rank) result = rank.max - value;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.getMemberPointsStat();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getMemberPointsStat() {
|
||||||
|
this.$u.api.getMemberPointsStat().then((res)=>{
|
||||||
|
if (res.errCode == 0) {
|
||||||
|
this.memberInfo = res.data;
|
||||||
|
this.percent = (this.memberInfo.member_exppoints / this.rank[this.memberInfo.member_level - 1].max) * 100;
|
||||||
|
// console.log(this.percent);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
@on-uploaded="setImageList"
|
@on-uploaded="setImageList"
|
||||||
>
|
>
|
||||||
<view slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
|
<view slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
|
||||||
<img src="../static/mine/27.png" />
|
<image src="../static/mine/27.png"></image>
|
||||||
</view>
|
</view>
|
||||||
</u-upload>
|
</u-upload>
|
||||||
</view>
|
</view>
|
||||||
@@ -102,7 +102,7 @@ export default {
|
|||||||
background: rgba(236,236,236,1);
|
background: rgba(236,236,236,1);
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
> img {
|
> image {
|
||||||
margin-top: 48rpx;
|
margin-top: 48rpx;
|
||||||
width: 54rpx;
|
width: 54rpx;
|
||||||
height: 49rpx;
|
height: 49rpx;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
:auto-upload="false"
|
:auto-upload="false"
|
||||||
>
|
>
|
||||||
<view slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
|
<view slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
|
||||||
<img src="../static/mine/27.png" />
|
<image src="../static/mine/27.png"></image>
|
||||||
</view>
|
</view>
|
||||||
</u-upload>
|
</u-upload>
|
||||||
</view>
|
</view>
|
||||||
@@ -56,16 +56,16 @@ export default {
|
|||||||
},
|
},
|
||||||
addOrderEvaluate() {
|
addOrderEvaluate() {
|
||||||
if(!this.verifyParams()) return false;
|
if(!this.verifyParams()) return false;
|
||||||
console.log(this.logistics);
|
// console.log(this.logistics);
|
||||||
console.log(this.service);
|
// console.log(this.service);
|
||||||
console.log(this.describe);
|
// console.log(this.describe);
|
||||||
this.$u.api.updateOrderEvaluate({
|
this.$u.api.updateOrderEvaluate({
|
||||||
id: this.orderId,
|
id: this.orderId,
|
||||||
content: this.content,
|
content: this.content,
|
||||||
scores_one: this.logistics,
|
scores_one: this.logistics,
|
||||||
scores_two: this.service,
|
scores_two: this.service,
|
||||||
scores_three: this.describe,
|
scores_three: this.describe,
|
||||||
file: '',
|
file: '', // 只传文件名
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -94,7 +94,7 @@ export default {
|
|||||||
background: rgba(236,236,236,1);
|
background: rgba(236,236,236,1);
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
> img {
|
> image {
|
||||||
margin-top: 48rpx;
|
margin-top: 48rpx;
|
||||||
width: 54rpx;
|
width: 54rpx;
|
||||||
height: 49rpx;
|
height: 49rpx;
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
<view class="logistics" v-if="state == '1'" @click="toOtherPage('Logistics')">查看物流</view>
|
<view class="logistics" v-if="state == '1'" @click="toOtherPage('Logistics')">查看物流</view>
|
||||||
<view class="comment" v-if="state == '2'" @click="toOtherPage('Comment')">立即评价</view>
|
<view class="comment" v-if="state == '2'" @click="toOtherPage('Comment')">立即评价</view>
|
||||||
<view class="cancel" v-if="state == '6'" @click="cancelOrder">取消支付</view>
|
<view class="cancel" v-if="state == '6'" @click="cancelOrder">取消支付</view>
|
||||||
<view class="payment" v-if="state == '6'">立即支付</view>
|
<view class="payment" v-if="state == '6'" @click="payNow">立即支付</view>
|
||||||
<view class="service" v-if="state == '7'">联系官方客服</view>
|
<view class="service" v-if="state == '7'">联系官方客服</view>
|
||||||
<view class="submit" v-if="state == '7'">提交官方审核</view>
|
<view class="submit" v-if="state == '7'">提交官方审核</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -186,6 +186,12 @@ export default {
|
|||||||
title: title
|
title: title
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
payNow() {
|
||||||
|
this.$u.route('/pageC/cart/cashier', {
|
||||||
|
pay_sn: this.orderInfo.pay_sn,
|
||||||
|
price: this.orderInfo.order_amount,
|
||||||
|
});
|
||||||
|
},
|
||||||
toOtherPage(url) {
|
toOtherPage(url) {
|
||||||
this.$u.route('/pageE/order/' + url, {
|
this.$u.route('/pageE/order/' + url, {
|
||||||
oid: this.orderInfo.order_id,
|
oid: this.orderInfo.order_id,
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
<scroll-view scroll-y style="height: 100%;" @scrolltolower="reachBottom">
|
<scroll-view scroll-y style="height: 100%;" @scrolltolower="reachBottom">
|
||||||
<view>
|
<view>
|
||||||
<view class="item-container" v-for="order in orderList" :key="order.order_id">
|
<view class="item-container" v-for="order in orderList" :key="order.order_id">
|
||||||
<OrderItem :order="order" @refreshOrderList="getOrderList"></OrderItem>
|
<OrderItem :order="order" @refreshOrderList="refreshOrderList" v-if="current != 4"></OrderItem>
|
||||||
|
<TryOrderItem :order="order" @refreshOrderList="refreshOrderList" v-else></TryOrderItem>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<u-empty text="暂无订单" mode="order" color="#000000" v-if="!orderList.length"></u-empty>
|
<u-empty text="暂无订单" mode="order" color="#000000" v-if="!orderList.length"></u-empty>
|
||||||
@@ -20,6 +21,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import OrderItem from '@/components/mine/order-item/index'
|
import OrderItem from '@/components/mine/order-item/index'
|
||||||
|
import TryOrderItem from '@/components/mine/order-item/try'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -48,13 +50,23 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
OrderItem
|
OrderItem,
|
||||||
|
TryOrderItem,
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
current(value) {
|
current(value, origin) {
|
||||||
|
if((origin == 4 && value != 4) || (value == 4 && origin != 4)) {
|
||||||
|
this.orderList = [];
|
||||||
|
}
|
||||||
this.page = 0;
|
this.page = 0;
|
||||||
// again 重新请求列表 不然往列表里添加
|
// again 重新请求列表 不然往列表里添加
|
||||||
value == 6 ? this.getAfterSaleList({ reload: 'again' }): this.getOrderList({ reload: 'again' });
|
if(value == 6) {
|
||||||
|
this.getAfterSaleList({ reload: 'again' });
|
||||||
|
} else if(value == 4) {
|
||||||
|
this.goodsTryOrderList({ reload: 'again' });
|
||||||
|
} else {
|
||||||
|
this.getOrderList({ reload: 'again' });
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
@@ -89,6 +101,16 @@ export default {
|
|||||||
}
|
}
|
||||||
return type;
|
return type;
|
||||||
},
|
},
|
||||||
|
refreshOrderList() {
|
||||||
|
this.page = 0;
|
||||||
|
if(this.current == 6) {
|
||||||
|
this.getAfterSaleList({ reload: 'again' });
|
||||||
|
} else if(this.current == 4) {
|
||||||
|
this.goodsTryOrderList({ reload: 'again' });
|
||||||
|
} else {
|
||||||
|
this.getOrderList({ reload: 'again' });
|
||||||
|
}
|
||||||
|
},
|
||||||
async getOrderList({ reload = '' } = {}) {
|
async getOrderList({ reload = '' } = {}) {
|
||||||
const type = this.setOrderType();
|
const type = this.setOrderType();
|
||||||
const res = await this.$u.api.getOrderList({
|
const res = await this.$u.api.getOrderList({
|
||||||
@@ -113,6 +135,17 @@ export default {
|
|||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
|
async goodsTryOrderList({ reload = '' } = {}) {
|
||||||
|
const res = await this.$u.api.goodsTryOrderList({
|
||||||
|
page: this.page,
|
||||||
|
})
|
||||||
|
this.timer = true;
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
if(reload) this.orderList = res.data.list;
|
||||||
|
else this.orderList.push(...res.data.list);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
},
|
||||||
reachBottom() {
|
reachBottom() {
|
||||||
// 大于15条才会加载更多
|
// 大于15条才会加载更多
|
||||||
if(this.orderList.length < 15) return false;
|
if(this.orderList.length < 15) return false;
|
||||||
@@ -122,6 +155,7 @@ export default {
|
|||||||
this.page++;
|
this.page++;
|
||||||
let promise;
|
let promise;
|
||||||
if(this.current == 6) promise = this.getAfterSaleList();
|
if(this.current == 6) promise = this.getAfterSaleList();
|
||||||
|
else if(this.current == 4) promise = this.goodsTryOrderList();
|
||||||
else promise = this.getOrderList();
|
else promise = this.getOrderList();
|
||||||
promise.then(res => {
|
promise.then(res => {
|
||||||
this.loadStatus.splice(this.current, 1, "nomore");
|
this.loadStatus.splice(this.current, 1, "nomore");
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="logistics">
|
<view class="logistics">
|
||||||
<view class="logistics-info">
|
<view class="logistics-info">
|
||||||
<view class="express">
|
<!-- <view class="express">
|
||||||
<image src="../static/mine/23.png"></image>
|
<image src="../static/mine/23.png"></image>
|
||||||
<view class="dispatcher-info">
|
<view class="dispatcher-info">
|
||||||
<view>派件员:xxx</view>
|
<view>派件员:xxx</view>
|
||||||
<view>手机:123456789</view>
|
<view>手机:123456789</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<view class="express-status">
|
<view class="express-status">
|
||||||
<image src="../static/mine/23.png"></image>
|
<image :src="expressInfo.goods_image"></image>
|
||||||
<view>
|
<view>
|
||||||
<view class="status">物流状态:已签收</view>
|
<view class="status">物流状态:{{ expressInfo.is_check }}</view>
|
||||||
<view>承运来源:百世快递</view>
|
<view>承运来源:{{ expressInfo.express_name || '' }}</view>
|
||||||
<view>运单编号:3253463464777</view>
|
<view>运单编号:{{ expressInfo.shipping_code || '' }}</view>
|
||||||
<view>官方电话:4009-565-656</view>
|
<view>官方电话:{{ expressInfo.express_phone || '' }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -22,8 +22,8 @@
|
|||||||
<view class="title">物流跟踪</view>
|
<view class="title">物流跟踪</view>
|
||||||
<view class="main">
|
<view class="main">
|
||||||
<view v-for="(item, index) in list" :key="index" class="logistics-item">
|
<view v-for="(item, index) in list" :key="index" class="logistics-item">
|
||||||
<view class="info u-line-2">{{ item.address }}</view>
|
<view class="info u-line-2">{{ item.content }}</view>
|
||||||
<view class="date">{{ item.date }}</view>
|
<view class="date">{{ item.kd_time }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -33,24 +33,23 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [
|
list: [],
|
||||||
{
|
expressInfo: {},
|
||||||
address: '[北京市]【已签收,本人签收】,感谢使用百事快递,期待再次为您服务[北京市]【已签收,本人签收】,感谢使用百事快递,期待再次为您服务[北京市]【已签收,本人签收】,感谢使用百事快递,期待再次为您服务',
|
|
||||||
date: '2019-12-25 09:38:21'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
address: '[北京市]【已签收,本人签收】,感谢使用百事快递,期待再次为您服务',
|
|
||||||
date: '2019-12-25 09:38:21'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
address: '[北京市]【已签收,本人签收】,感谢使用百事快递,期待再次为您服务',
|
|
||||||
date: '2019-12-15 09:38:20'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
address: '卖家已发货',
|
|
||||||
date: '2019-12-15 09:38:20'
|
|
||||||
}
|
}
|
||||||
]
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
this.getOrderLogistics(option.oid);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getOrderLogistics(id) {
|
||||||
|
this.$u.api.orderLogistics({ id: 16 }).then(res => {
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
this.expressInfo = res.data.express_info;
|
||||||
|
this.list = res.data.express_list;
|
||||||
|
} else {
|
||||||
|
this.list = [];
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,16 +14,14 @@
|
|||||||
<view>退出登录</view>
|
<view>退出登录</view>
|
||||||
<image src="../static/mine/21.png"></image>
|
<image src="../static/mine/21.png"></image>
|
||||||
</view>
|
</view>
|
||||||
<u-action-sheet
|
<u-action-sheet v-model="sheetStatus" :list="list" :tips="tips" :border-radius="20" @click="choiceOption">
|
||||||
v-model="sheetStatus"
|
|
||||||
:list="list"
|
|
||||||
:tips="tips"
|
|
||||||
:border-radius="20"
|
|
||||||
@click="choiceOption">
|
|
||||||
</u-action-sheet>
|
</u-action-sheet>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import {
|
||||||
|
mapMutations
|
||||||
|
} from 'vuex';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -34,8 +32,7 @@ export default {
|
|||||||
fontSize: 24
|
fontSize: 24
|
||||||
},
|
},
|
||||||
sheetStatus: false,
|
sheetStatus: false,
|
||||||
list: [
|
list: [{
|
||||||
{
|
|
||||||
text: '换个账号登录',
|
text: '换个账号登录',
|
||||||
color: '#FF780F',
|
color: '#FF780F',
|
||||||
fontSize: 28
|
fontSize: 28
|
||||||
@@ -46,8 +43,7 @@ export default {
|
|||||||
fontSize: 28
|
fontSize: 28
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
settingList: [
|
settingList: [{
|
||||||
{
|
|
||||||
title: '个人信息',
|
title: '个人信息',
|
||||||
link: '../mine/MineInfo'
|
link: '../mine/MineInfo'
|
||||||
},
|
},
|
||||||
@@ -75,10 +71,13 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
...mapMutations(['logout']),
|
||||||
|
// 退出登录选择 0:切换账号 | 1:退出登录
|
||||||
choiceOption(index) {
|
choiceOption(index) {
|
||||||
console.log(index);
|
console.log(index);
|
||||||
|
if (index == 1) {
|
||||||
// console.log(`点击了第${index + 1}项,内容为:${this.list[index].text}`)
|
this.logout();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
toNextPage(url, ...params) {
|
toNextPage(url, ...params) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@@ -92,6 +91,7 @@ export default {
|
|||||||
.setting {
|
.setting {
|
||||||
min-height: calc(100vh - var(--window-top));
|
min-height: calc(100vh - var(--window-top));
|
||||||
background-color: #ECECEC;
|
background-color: #ECECEC;
|
||||||
|
|
||||||
.list-item {
|
.list-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -102,6 +102,7 @@ export default {
|
|||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: rgba(51, 51, 51, 1);
|
color: rgba(51, 51, 51, 1);
|
||||||
|
|
||||||
>image {
|
>image {
|
||||||
width: 14rpx;
|
width: 14rpx;
|
||||||
height: 24rpx;
|
height: 24rpx;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
name: '',
|
name: '',
|
||||||
time: '',
|
time: '',
|
||||||
address: '四川省攀枝花市银江镇',
|
address: '',
|
||||||
params: {
|
params: {
|
||||||
year: true,
|
year: true,
|
||||||
month: true,
|
month: true,
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export default {
|
|||||||
const res = await this.$u.api.getBrowseList({ page: this.page });
|
const res = await this.$u.api.getBrowseList({ page: this.page });
|
||||||
this.timer = false;
|
this.timer = false;
|
||||||
if(res.errCode == 0) {
|
if(res.errCode == 0) {
|
||||||
this.historyList = res.data.storeInfo;
|
this.historyList.push(...res.data.storeInfo);
|
||||||
}
|
}
|
||||||
return res.data.storeInfo.length;
|
return res.data.storeInfo.length;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,27 +2,43 @@
|
|||||||
<view class="wash">
|
<view class="wash">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
<u-tabs-swiper ref="tabs" :list="list" :is-scroll="false" active-color="#FF780F" :current="current" font-size="32" :show-bar="false" @change="tabsChange" height="88"></u-tabs-swiper>
|
<u-tabs-swiper ref="tabs" :list="list" :is-scroll="false" active-color="#FF780F" :current="current" font-size="32" :show-bar="false" @change="tabsChange" height="88"></u-tabs-swiper>
|
||||||
|
<u-icon name="arrow-down-fill" :color="current == 0 ? '#FF780F' : '#333333'" size="17" class="order-icon" :style="{ left: list[0].name == '平台历史订单' ? '236rpx' : '252rpx' }"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<swiper :current="swiperCurrent" @animationfinish="animationfinish">
|
<swiper :current="swiperCurrent" @animationfinish="animationfinish">
|
||||||
<swiper-item class="swiper-item">
|
<swiper-item class="swiper-item">
|
||||||
<scroll-view scroll-y class="order-list">
|
<scroll-view scroll-y class="order-list" @scrolltolower="loadmore">
|
||||||
<view v-for="(item, index) in 6" :key="index" class="order-item">
|
<view v-for="(item, index) in orderList" :key="index" class="order-item">
|
||||||
<view class="order-title">
|
<view class="order-title">
|
||||||
<view class="order-text">订单状态</view>
|
<view class="order-text">订单状态</view>
|
||||||
<view class="order-status">已预约</view>
|
<view class="order-status">{{ item.order_status | viewStatus }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-info">
|
<view class="order-info">
|
||||||
<image src="../static/mine/23.png"></image>
|
<image src="../static/mine/23.png"></image>
|
||||||
<view>
|
<view v-if="item.deliver_goods_type == 2 && item.order_status == 20">
|
||||||
<view>骑手名字:xxx</view>
|
<view>骑手名字:{{ item.takeawayer_name || '' }}</view>
|
||||||
<view>联系方式:123456789</view>
|
<view>联系方式:{{ item.member_phone || '' }}</view>
|
||||||
<view>所属公司:xx公司</view>
|
<view>所属公司:{{ item.company || '' }}</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="item.order_status == 0">
|
||||||
|
<view>正在等待接单</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="item.order_status == 40">
|
||||||
|
<view>商家已拒绝</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="item.order_status == 50">
|
||||||
|
<view>交易已完成</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="item.deliver_goods_type == 1 && item.order_status == 20">
|
||||||
|
<view>商家在正路途中,请耐心等待</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="send-btn">
|
<view class="send-btn" v-if="item.order_status == 20 || item.order_status == 50">
|
||||||
<view class="btn" v-if="btn_show">
|
<view class="btn" v-if="item.order_status == 20" @click="sendLaundryOrderConfirm(item.laundry_id)">
|
||||||
确认完成
|
确认完成
|
||||||
</view>
|
</view>
|
||||||
|
<view class="btn" v-if="item.order_status == 50" @click="toComment(item.laundry_id)">
|
||||||
|
去评价
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
@@ -34,8 +50,8 @@
|
|||||||
</swiper-item>
|
</swiper-item>
|
||||||
<swiper-item class="swiper-item">
|
<swiper-item class="swiper-item">
|
||||||
<scroll-view scroll-y class="comment">
|
<scroll-view scroll-y class="comment">
|
||||||
<view v-for="(item, index) in 3" :key="index" class="comment-item">
|
<view v-for="(comment, index) in commentList" :key="index" class="comment-item">
|
||||||
<Comment></Comment>
|
<Comment :info="comment"></Comment>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
@@ -51,7 +67,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import Comment from '@/components/mine/comment/index'
|
import Comment from '@/components/mine/comment/index';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -65,44 +81,124 @@ export default {
|
|||||||
}],
|
}],
|
||||||
current: 0,
|
current: 0,
|
||||||
swiperCurrent: 0,
|
swiperCurrent: 0,
|
||||||
btn_show:true
|
btn_show:true,
|
||||||
|
page: 1,
|
||||||
|
orderList: [],
|
||||||
|
timer: true,
|
||||||
|
commentList: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Comment
|
Comment
|
||||||
},
|
},
|
||||||
|
filters: {
|
||||||
|
viewStatus(status) {
|
||||||
|
let state;
|
||||||
|
switch (status) {
|
||||||
|
case 0:
|
||||||
|
state = '等待接单';
|
||||||
|
break;
|
||||||
|
case 20:
|
||||||
|
state = '已接单';
|
||||||
|
break;
|
||||||
|
case 40:
|
||||||
|
state = '交易失败';
|
||||||
|
break;
|
||||||
|
case 50:
|
||||||
|
state = '交易成功';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return state;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
current(index) {
|
||||||
|
if(index == 1) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pageE/tool/WashOrder'
|
||||||
|
});
|
||||||
|
this.showPopup = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.current = 0;
|
this.current = 0;
|
||||||
this.swiperCurrent = 0;
|
this.swiperCurrent = 0;
|
||||||
this.showPopup= false
|
this.showPopup = false;
|
||||||
|
this.sendLaundryOrderList();
|
||||||
|
this.sendCommentList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async sendLaundryOrderList({ load = 'reload' } = {}) {
|
||||||
|
let type = this.list[0].name == '平台历史订单' ? 1 : 2;
|
||||||
|
const res = await this.$u.api.sendLaundryOrderList({
|
||||||
|
type: type,
|
||||||
|
page: this.page,
|
||||||
|
})
|
||||||
|
this.timer = false;
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
// this.orderList = res.data.list;
|
||||||
|
// console.log(...res.data.list);
|
||||||
|
if(load == 'loadmore') this.orderList = this.orderList.concat(res.data.list);
|
||||||
|
else if(load == 'reload') this.orderList = res.data.list;
|
||||||
|
} else {
|
||||||
|
this.orderList = [];
|
||||||
|
}
|
||||||
|
return res.data.list.length;
|
||||||
|
},
|
||||||
|
sendLaundryOrderConfirm(id) {
|
||||||
|
this.$u.api.sendLaundryOrderConfirm({ id: id }).then(res => {
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
this.sendLaundryOrderList();
|
||||||
|
}
|
||||||
|
this.$u.toast(res.message);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
loadmore() {
|
||||||
|
if(!this.timer) return false;
|
||||||
|
this.loadStatus = "loading";
|
||||||
|
this.page++;
|
||||||
|
this.sendLaundryOrderList({ load: 'loadmore' }).then(length => {
|
||||||
|
if(length == 0) {
|
||||||
|
this.page--;
|
||||||
|
this.status = 'nomore';
|
||||||
|
} else {
|
||||||
|
this.status = 'loading';
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.loadStatus = "nomore";
|
||||||
|
this.page--;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 送洗评论列表
|
||||||
|
sendCommentList() {
|
||||||
|
this.$u.api.sendCommentList().then(res => {
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
this.commentList = res.data.list;
|
||||||
|
} else {
|
||||||
|
this.commentList = [];
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
toComment(id) {
|
||||||
|
this.$u.route('/pageE/tool/washComment', {
|
||||||
|
id: id
|
||||||
|
});
|
||||||
|
},
|
||||||
tabsChange(index) {
|
tabsChange(index) {
|
||||||
this.swiperCurrent = index;
|
this.swiperCurrent = index;
|
||||||
this.toApplyPage(index);
|
if (index == 0){
|
||||||
|
this.showPopup = !this.showPopup;
|
||||||
|
} else {
|
||||||
|
this.showPopup = false;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
animationfinish(e) {
|
animationfinish(e) {
|
||||||
let current = e.detail.current;
|
let current = e.detail.current;
|
||||||
this.swiperCurrent = current;
|
this.swiperCurrent = current;
|
||||||
this.current = current;
|
this.current = current;
|
||||||
this.toApplyPage(current);
|
|
||||||
},
|
|
||||||
toApplyPage(index) {
|
|
||||||
console.log(index)
|
|
||||||
var that = this;
|
|
||||||
if(index == 1) {
|
|
||||||
this.showPopup = false
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pageE/tool/WashOrder'
|
|
||||||
});
|
|
||||||
}else if(index ==0){
|
|
||||||
this.history();
|
|
||||||
}else{
|
|
||||||
this.showPopup = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
history(){
|
|
||||||
this.showPopup = true;
|
|
||||||
},
|
},
|
||||||
replaces(e){
|
replaces(e){
|
||||||
if(e == 1){
|
if(e == 1){
|
||||||
@@ -110,6 +206,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.$set(this.list,0,{name: '平台历史订单'} )
|
this.$set(this.list,0,{name: '平台历史订单'} )
|
||||||
}
|
}
|
||||||
|
this.sendLaundryOrderList();
|
||||||
},
|
},
|
||||||
onTap(){
|
onTap(){
|
||||||
this.showPopup = false
|
this.showPopup = false
|
||||||
@@ -125,10 +222,15 @@ export default {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
> uni-swiper {
|
> uni-swiper {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
height: 85vh;
|
|
||||||
}
|
}
|
||||||
.title {
|
.title {
|
||||||
|
position: relative;
|
||||||
|
.order-icon {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
transform: translate(0, -50%);
|
||||||
|
z-index: 9;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.swiper-item {
|
.swiper-item {
|
||||||
padding-top: 20rpx;
|
padding-top: 20rpx;
|
||||||
@@ -140,7 +242,7 @@ export default {
|
|||||||
.order-item {
|
.order-item {
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
width: 690rpx;
|
width: 690rpx;
|
||||||
height: 362rpx;
|
// height: 362rpx;
|
||||||
background: rgba(255,255,255,1);
|
background: rgba(255,255,255,1);
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
@@ -183,7 +285,6 @@ export default {
|
|||||||
.btn{
|
.btn{
|
||||||
width: 154rpx;
|
width: 154rpx;
|
||||||
height: 54rpx;
|
height: 54rpx;
|
||||||
background: RGBA(255, 254, 255, 1);
|
|
||||||
border-radius: 49rpx;
|
border-radius: 49rpx;
|
||||||
transform: translate(-50%, 0);
|
transform: translate(-50%, 0);
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
@@ -220,7 +321,6 @@ export default {
|
|||||||
justify-content: top;
|
justify-content: top;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
transition-duration: 0.3s;
|
transition-duration: 0.3s;
|
||||||
|
|
||||||
.popup_cont{
|
.popup_cont{
|
||||||
border-top: 1px solid RGBA(239, 236, 240, 1);
|
border-top: 1px solid RGBA(239, 236, 240, 1);
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
@@ -232,6 +332,7 @@ export default {
|
|||||||
font-weight:400;
|
font-weight:400;
|
||||||
color:rgba(102,102,102,1);
|
color:rgba(102,102,102,1);
|
||||||
padding-left: 41rpx;
|
padding-left: 41rpx;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,12 +3,13 @@
|
|||||||
<view>
|
<view>
|
||||||
<u-tabs-swiper ref="tabs" :list="list" :is-scroll="false" active-color="#FF780F" :current="current" font-size="32" :show-bar="false" @change="tabsChange" height="88" ></u-tabs-swiper>
|
<u-tabs-swiper ref="tabs" :list="list" :is-scroll="false" active-color="#FF780F" :current="current" font-size="32" :show-bar="false" @change="tabsChange" height="88" ></u-tabs-swiper>
|
||||||
</view>
|
</view>
|
||||||
<swiper :current="swiperCurrent" @animationfinish="animationfinish">
|
<swiper :current="swiperCurrent" @animationfinish="animationfinish" :style="{ height: swiperHeight }">
|
||||||
<swiper-item class="swiper-item">
|
<swiper-item class="swiper-item">
|
||||||
|
<scroll-view scroll-y="true" style="height: 100%;">
|
||||||
<view class="order-info">
|
<view class="order-info">
|
||||||
<view class="order-name" @click="order()">
|
<view class="order-name" @click="showPopup=true">
|
||||||
<view class="title titles" >
|
<view class="title titles" >
|
||||||
<text>选择订单:</text>
|
<text>选择订单:</text>
|
||||||
<image src="../../static/image/shop/2.png" mode=""></image>
|
<image src="../../static/image/shop/2.png" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
<u-icon name="arrow-dwon" color="#2979ff" size="28"></u-icon>
|
<u-icon name="arrow-dwon" color="#2979ff" size="28"></u-icon>
|
||||||
@@ -16,268 +17,440 @@
|
|||||||
<view class="choose-info" v-if="choose">
|
<view class="choose-info" v-if="choose">
|
||||||
<view class="store">
|
<view class="store">
|
||||||
<view>
|
<view>
|
||||||
<image src="../../static/image/mine/23.png" mode=""></image>胖胖的店
|
<image :src="checkedGoods.store.store_avatar"></image>{{ checkedGoods.store.store_name }}
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
订单编号:2222222222222
|
订单编号:{{ checkedGoods.order_sn }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="store_info">
|
<view class="store_info">
|
||||||
<view class="info_img">
|
<view class="info_img">
|
||||||
<image src="../../static/image/mine/23.png" mode="">
|
<image :src="checkedGoods.goods.goods_image" mode="">
|
||||||
</view>
|
</view>
|
||||||
<view class="info_txt">
|
<view class="info_txt">
|
||||||
<view class="content">
|
<view class="content u-line-2">
|
||||||
木糖少女小紫薯西装领连衣裙夏季新款女装夏收腰格子格纹裙子
|
{{ checkedGoods.goods.goods_name }}
|
||||||
</view>
|
</view>
|
||||||
<view class="much">
|
<view class="much">
|
||||||
<text>¥99</text>
|
<text>¥{{ checkedGoods.goods.goods_pay_price }}</text>
|
||||||
<text>x1</text>
|
<text>x{{ checkedGoods.goods.goods_num }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-name">
|
<view class="order-view order-phone">
|
||||||
<view class="title">送洗人:</view>
|
<view class="title">衣服状况:</view>
|
||||||
|
<input type="text" v-model="goodsStatus" />
|
||||||
|
</view>
|
||||||
|
<view class="order-view order-type" @click="showClothesType=true">
|
||||||
|
<view class="title">商品类型:</view>
|
||||||
|
<input type="text" v-model="type.label" disabled />
|
||||||
|
</view>
|
||||||
|
<view class="order-view order-name">
|
||||||
|
<view class="title">送洗人:</view>
|
||||||
<input type="text" v-model="name" />
|
<input type="text" v-model="name" />
|
||||||
</view>
|
</view>
|
||||||
<view class="order-phone">
|
<view class="order-view order-phone">
|
||||||
<view class="title">手机号:</view>
|
<view class="title">手机号:</view>
|
||||||
<input type="text" v-model="phone" />
|
<input type="text" v-model="phone" maxlength="11" />
|
||||||
</view>
|
</view>
|
||||||
<view class="order-area">
|
<view class="order-view order-area" @click="showAddress=true">
|
||||||
<view class="title">省市区:</view>
|
<view class="title">省市区:</view>
|
||||||
<input type="text" v-model="area" />
|
<input type="text" v-model="area" disabled />
|
||||||
<view class="location">
|
<view class="location">
|
||||||
<image src="../static/mine/28.png"></image>
|
<image src="../static/mine/28.png"></image>
|
||||||
<view>定位</view>
|
<view>定位</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-address">
|
<view class="order-view order-address">
|
||||||
<view class="title">详细地址:</view>
|
<view class="title">详细地址:</view>
|
||||||
<input type="text" v-model="address" />
|
<input type="text" v-model="address" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="upload-image">
|
<view class="upload-image">
|
||||||
<view class="title">上传商品图片</view>
|
<view class="title">上传商品图片</view>
|
||||||
<u-upload
|
<u-upload
|
||||||
ref="uUpload"
|
ref="platform"
|
||||||
@on-uploaded="onUploaded"
|
|
||||||
:custom-btn="true"
|
:custom-btn="true"
|
||||||
:max-count="count"
|
:max-count="count"
|
||||||
|
:action="uaction"
|
||||||
:auto-upload="false"
|
:auto-upload="false"
|
||||||
|
:header="uheader"
|
||||||
|
:form-data="uformData"
|
||||||
|
:name="uname"
|
||||||
|
@on-uploaded="setImageList"
|
||||||
>
|
>
|
||||||
<view slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
|
<view slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
|
||||||
<img src="../static/mine/27.png" />
|
<image src="../static/mine/27.png"></image>
|
||||||
</view>
|
</view>
|
||||||
</u-upload>
|
</u-upload>
|
||||||
</view>
|
</view>
|
||||||
<view class="wash-btn" @click="reset()">确认送洗</view>
|
<view class="wash-btn" @click="submitImage">确认送洗</view>
|
||||||
|
</scroll-view>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
<swiper-item class="swiper-item">
|
<swiper-item class="swiper-item">
|
||||||
<view class="order-info">
|
<view class="order-info">
|
||||||
<view class="order-name">
|
<view class="order-view order-name">
|
||||||
<view class="title">商品名称:</view>
|
<view class="title">商品名称:</view>
|
||||||
|
<input type="text" v-model="goodsName" />
|
||||||
|
</view>
|
||||||
|
<view class="order-view order-phone">
|
||||||
|
<view class="title">衣服状况:</view>
|
||||||
|
<input type="text" v-model="goodsStatus" />
|
||||||
|
</view>
|
||||||
|
<view class="order-view order-phone" @click="showClothesType=true">
|
||||||
|
<view class="title">商品类型:</view>
|
||||||
|
<input type="text" v-model="type.label" disabled />
|
||||||
|
</view>
|
||||||
|
<view class="order-view order-name">
|
||||||
|
<view class="title">送洗人:</view>
|
||||||
<input type="text" v-model="name" />
|
<input type="text" v-model="name" />
|
||||||
</view>
|
</view>
|
||||||
<view class="order-phone">
|
<view class="order-view order-phone">
|
||||||
<view class="title">商品类型:</view>
|
<view class="title">手机号:</view>
|
||||||
<input type="text" v-model="name" />
|
<input type="text" v-model="phone" maxlength="11" />
|
||||||
</view>
|
</view>
|
||||||
<view class="order-phone">
|
<view class="order-view order-area" @click="showAddress=true">
|
||||||
<view class="title">衣服状况:</view>
|
<view class="title">省市区:</view>
|
||||||
<input type="text" v-model="name" />
|
<input type="text" v-model="area" disabled />
|
||||||
</view>
|
|
||||||
<view class="order-name">
|
|
||||||
<view class="title">送洗人:</view>
|
|
||||||
<input type="text" v-model="name" />
|
|
||||||
</view>
|
|
||||||
<view class="order-area">
|
|
||||||
<view class="title">省市区:</view>
|
|
||||||
<input type="text" v-model="area" />
|
|
||||||
<view class="location">
|
<view class="location">
|
||||||
<image src="../static/mine/28.png"></image>
|
<image src="../static/mine/28.png"></image>
|
||||||
<view>定位</view>
|
<view>定位</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-address">
|
<view class="order-view order-address">
|
||||||
<view class="title">详细地址:</view>
|
<view class="title">详细地址:</view>
|
||||||
<input type="text" v-model="address" />
|
<input type="text" v-model="address" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="upload-image">
|
<view class="upload-image">
|
||||||
<view class="title">上传商品图片</view>
|
<view class="title">上传商品图片</view>
|
||||||
<u-upload
|
<u-upload
|
||||||
ref="uUpload"
|
ref="physical"
|
||||||
@on-uploaded="onUploaded"
|
|
||||||
:custom-btn="true"
|
:custom-btn="true"
|
||||||
:max-count="count"
|
:max-count="count"
|
||||||
|
:action="uaction"
|
||||||
:auto-upload="false"
|
:auto-upload="false"
|
||||||
|
:header="uheader"
|
||||||
|
:form-data="uformData"
|
||||||
|
:name="uname"
|
||||||
|
@on-uploaded="setImageList"
|
||||||
>
|
>
|
||||||
<view slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
|
<view slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
|
||||||
<img src="../static/mine/27.png" />
|
<image src="../static/mine/27.png"></image>
|
||||||
</view>
|
</view>
|
||||||
</u-upload>
|
</u-upload>
|
||||||
</view>
|
</view>
|
||||||
<view class="wash-btn">确认送洗</view>
|
<view class="wash-btn" @click="submitImage">确认送洗</view>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
<view class="popup" v-if="showPopup">
|
<u-select v-model="showClothesType" :list="typeList" value-name="id" label-name="name" @confirm="confirmType" :safe-area-inset-bottom="true" mode="single-column"></u-select>
|
||||||
<view class="popup_cont" >
|
<u-select v-model="showAddress"
|
||||||
|
mode="mutil-column-auto"
|
||||||
|
:list="areaList"
|
||||||
|
value-name="area_id"
|
||||||
|
label-name="area_name"
|
||||||
|
child-name="_child"
|
||||||
|
@confirm="setArea"
|
||||||
|
:safe-area-inset-bottom="true">
|
||||||
|
</u-select>
|
||||||
|
<u-popup v-model="showPopup" mode="bottom" border-radius="20">
|
||||||
|
<view class="order-popup">
|
||||||
<view class="check">
|
<view class="check">
|
||||||
<text>选择订单</text>
|
<text>选择订单</text>
|
||||||
<image src="../../static/image/common/17.png" @click="close()"></image>
|
<u-icon name="close" color="#A29FA3" size="32"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
<swiper style="height: 1000px;" vertical="true">
|
|
||||||
<swiper-item class="swiper-item">
|
|
||||||
<scroll-view scroll-y class="order-list">
|
<scroll-view scroll-y class="order-list">
|
||||||
<view v-for="(items, index) in 3" :key="items.index">
|
<u-radio-group v-model="value" @change="radioChange">
|
||||||
|
<view v-for="(items, index) in orderList" :key="index" class="order-item">
|
||||||
<view class="store">
|
<view class="store">
|
||||||
<view>
|
<view class="name">
|
||||||
<image src="../../static/image/mine/23.png" mode=""></image>胖胖的店
|
<image :src="items.extend_store.store_avatar" mode=""></image>
|
||||||
|
<text>{{ items.store_name }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view class="order-sn">
|
||||||
订单编号:2222222222222
|
订单编号:{{ items.order_sn }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="checkd">
|
<view class="checkd">
|
||||||
<radio-group @change="er">
|
<label class="radio-view" v-for="(item, index) in items.extend_order_goods" :key="index">
|
||||||
<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in checkLidt" :key="index">
|
|
||||||
<view class="radio">
|
<view class="radio">
|
||||||
<radio color="#F0AD4E" :value="item.id" :checked="a==item.id"/>
|
<u-radio color="#F0AD4E" :name="items.order_id + ' ' + item.goods_id" active-color="#FF780F" icon-size="34"></u-radio>
|
||||||
</view>
|
</view>
|
||||||
<view class="store_info">
|
<view class="store_info">
|
||||||
<view class="info_img">
|
<view class="info_img">
|
||||||
<image src="../../static/image/mine/23.png" mode="">
|
<image :src="item.goods_image" mode="">
|
||||||
</view>
|
</view>
|
||||||
<view class="info_txt">
|
<view class="info_txt">
|
||||||
<view class="content">
|
<view class="content u-line-2">
|
||||||
木糖少女小紫薯西装领连衣裙夏季新款女装夏收腰格子格纹裙子
|
{{ item.goods_name }}
|
||||||
</view>
|
</view>
|
||||||
<view class="much">
|
<view class="much">
|
||||||
<text>¥99</text>
|
<text>¥{{ item.goods_pay_price }}</text>
|
||||||
<text>x1</text>
|
<text>x{{ item.goods_num }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</label>
|
</label>
|
||||||
</radio-group>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</u-radio-group>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</swiper-item>
|
<view class="order-btn" @click="confirm">确认</view>
|
||||||
</swiper>
|
|
||||||
<view class="bottom_btn" style="width: 100%;background-color: #fff;">
|
|
||||||
<view class="wash-btn" @click="confirm()">确认</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
</u-popup>
|
||||||
|
<u-toast ref="uToast" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
items: [],
|
// items: [],
|
||||||
count: 4, // 最大图片数量
|
count: 4, // 最大图片数量
|
||||||
name: '',
|
type: {}, // 商品类型
|
||||||
phone: '',
|
name: '', // 送洗人
|
||||||
area: '',
|
phone: '', // 手机号
|
||||||
address: '',
|
area: '', // 省市区
|
||||||
|
goodsStatus: '', // 衣服状况
|
||||||
|
address: '', // 详细地址
|
||||||
|
goodsName: '', // 商品名称
|
||||||
list: [{
|
list: [{
|
||||||
name: '平台历史订单'
|
name: '平台历史订单'
|
||||||
}, {
|
}, {
|
||||||
name: '实体店历史订单'
|
name: '实体店历史订单'
|
||||||
}],
|
}],
|
||||||
|
typeList: [], // 商品类型列表
|
||||||
|
orderList: [], // 商品列表
|
||||||
|
page: 0,
|
||||||
current: 0,
|
current: 0,
|
||||||
swiperCurrent: 0,
|
swiperCurrent: 0,
|
||||||
|
areaList: [], // 地址列表
|
||||||
|
showClothesType: false,
|
||||||
|
showAddress: false,
|
||||||
showPopup : false,
|
showPopup : false,
|
||||||
a:"",
|
swiperHeight: '',
|
||||||
checkLidt:[
|
value: '', // radio
|
||||||
{id:'1'},
|
checkedGoods: {}, // 选中的商品
|
||||||
{id:'2'},
|
choose: false, // 是否选择了商品
|
||||||
{id:'3'}
|
filesArr: [], // 选择的图片
|
||||||
]
|
uploadImage: [], // 图片名称(后台返回)列表
|
||||||
|
uaction: this.$u.http.config.baseUrl + '/Upload/uploadfile', // 下面是上传图片的参数
|
||||||
|
uheader: {
|
||||||
|
"authorization": 'Bearer' + " " + uni.getStorageSync('token')
|
||||||
|
},
|
||||||
|
uname: 'common', // 与formData name 一样
|
||||||
|
uformData: {
|
||||||
|
name: 'common', // 其他图片
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
onShow() {
|
onShow() {
|
||||||
this.current = 0;
|
this.current = 0;
|
||||||
this.swiperCurrent = 0;
|
this.swiperCurrent = 0;
|
||||||
this.showPopup = false;
|
this.showPopup = false;
|
||||||
this.choose = false
|
this.choose = false;
|
||||||
},
|
},
|
||||||
submit() {
|
onLoad() {
|
||||||
this.$refs.uUpload.upload();
|
this.getOrderList();
|
||||||
|
this.setViewHeight();
|
||||||
|
this.getAreaData();
|
||||||
|
this.getClothesTypeList();
|
||||||
},
|
},
|
||||||
onUploaded(list) {
|
methods: {
|
||||||
console.log(list)
|
getClothesTypeList() {
|
||||||
},tabsChange(index) {
|
this.$u.api.getClothesTypeList().then(res => {
|
||||||
|
if (res.errCode == 0) {
|
||||||
|
this.typeList = res.data.typeList;
|
||||||
|
} else {
|
||||||
|
this.typeList = [];
|
||||||
|
}
|
||||||
|
console.log(this.typeList);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
confirmType(e) {
|
||||||
|
// console.log(e[0]);
|
||||||
|
this.type = e[0];
|
||||||
|
},
|
||||||
|
async getOrderList({ load = 'reload' } = {}) {
|
||||||
|
const res = await this.$u.api.getOrderList({
|
||||||
|
page: this.page,
|
||||||
|
// type: '40',
|
||||||
|
})
|
||||||
|
this.timer = true;
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
if(load == 'reload') this.orderList = res.data;
|
||||||
|
else this.orderList.push(...res.data);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
},
|
||||||
|
submitImage() {
|
||||||
|
// this.$refs.uUpload.upload();
|
||||||
|
this.current == 0 ? this.$refs.platform.upload() : this.$refs.physical.upload();
|
||||||
|
// this.confirmSend();
|
||||||
|
},
|
||||||
|
tabsChange(index) {
|
||||||
this.swiperCurrent = index;
|
this.swiperCurrent = index;
|
||||||
},
|
},
|
||||||
er(e){
|
setImageList(lists) {
|
||||||
console.log(e)
|
console.log(lists);
|
||||||
this.a =e.detail.value;
|
let imageList = [];
|
||||||
console.log(this.a)
|
lists.forEach(res => {
|
||||||
|
if(res.response.errCode == 0) imageList.push(res.response.data.file_name);
|
||||||
|
})
|
||||||
|
// console.log(imageList);
|
||||||
|
this.filesArr = imageList;
|
||||||
|
console.log(this.filesArr);
|
||||||
|
this.confirmSend();
|
||||||
|
},
|
||||||
|
validationParams() {
|
||||||
|
if (this.current == 1) {
|
||||||
|
if(this.$u.test.isEmpty(this.goodsName)) {
|
||||||
|
this.showToast('商品名称不能为空', 'warning');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(this.current == 0) {
|
||||||
|
if(JSON.stringify(this.checkedGoods) != '{}') {
|
||||||
|
this.showToast('订单不能为空', 'warning');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(this.$u.test.isEmpty(this.goodsStatus)) {
|
||||||
|
this.showToast('衣服状况不能为空', 'warning');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(JSON.stringify(this.type) != '{}') {
|
||||||
|
this.showToast('商品类型不能为空', 'warning');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(this.$u.test.isEmpty(this.name)) {
|
||||||
|
this.showToast('送洗人不能为空', 'warning');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(this.$u.test.isEmpty(this.phone)) {
|
||||||
|
this.showToast('手机号不能为空', 'warning');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(!this.$u.test.mobile(this.phone)) {
|
||||||
|
this.showToast('手机号错误', 'warning');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(this.$u.test.isEmpty(this.area)) {
|
||||||
|
this.showToast('地址不能为空', 'warning');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(this.$u.test.isEmpty(this.address)) {
|
||||||
|
this.showToast('详细地址不能为空', 'warning');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
confirmSend() {
|
||||||
|
if(!this.validationParams) return false;
|
||||||
|
let params = {
|
||||||
|
tid: this.type.value,
|
||||||
|
member_name: this.name,
|
||||||
|
area_info: this.area,
|
||||||
|
address_info: this.address,
|
||||||
|
goods_images: this.filesArr,
|
||||||
|
member_phone: this.phone,
|
||||||
|
condition: this.goodsStatus,
|
||||||
|
}
|
||||||
|
if(this.current == 0) {
|
||||||
|
Object.assign(params, {
|
||||||
|
type: 1,
|
||||||
|
order_id: this.checkedGoods.order_id,
|
||||||
|
goods_id: this.checkedGoods.goods.goods_id,
|
||||||
|
});
|
||||||
|
} else if(this.current == 1) {
|
||||||
|
Object.assign(params, {
|
||||||
|
type: 2,
|
||||||
|
goods_name: this.goodsName,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// console.log(params);
|
||||||
|
this.$u.api.sendLaundrySave(params).then(res => {
|
||||||
|
this.$u.toast(res.message);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
radioChange(e){
|
||||||
|
const ids = e.split(" ");
|
||||||
|
console.log(ids)
|
||||||
|
let checkedGoods = {};
|
||||||
|
this.orderList.forEach(order => {
|
||||||
|
if(order.order_id == ids[0]) {
|
||||||
|
Object.assign(checkedGoods, { store: order.extend_store });
|
||||||
|
Object.assign(checkedGoods, { order_sn: order.order_sn });
|
||||||
|
Object.assign(checkedGoods, { order_id: order.order_id });
|
||||||
|
order.extend_order_goods.forEach(goods => {
|
||||||
|
if(goods.goods_id == ids[1]) {
|
||||||
|
Object.assign(checkedGoods, { goods: goods });
|
||||||
|
this.checkedGoods = checkedGoods;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
setArea(area) {
|
||||||
|
// console.log(area);
|
||||||
|
this.area_id = area[0].value;
|
||||||
|
this.city_id = area[1].value;
|
||||||
|
let temp = '';
|
||||||
|
area.forEach(e => {
|
||||||
|
temp += e.label;
|
||||||
|
});
|
||||||
|
this.area = temp;
|
||||||
|
},
|
||||||
|
getAreaData() {
|
||||||
|
this.$u.api.getArea().then((res)=>{
|
||||||
|
if (res.errCode == 0) {
|
||||||
|
this.areaList = res.data;
|
||||||
|
} else {
|
||||||
|
this.areaList = [];
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
animationfinish(e) {
|
animationfinish(e) {
|
||||||
let current = e.detail.current;
|
let current = e.detail.current;
|
||||||
this.swiperCurrent = current;
|
this.swiperCurrent = current;
|
||||||
this.current = current;
|
this.current = current;
|
||||||
this.toApplyPage(current);
|
|
||||||
},
|
},
|
||||||
order(){
|
setViewHeight() {
|
||||||
this.showPopup = true;
|
const res = uni.getSystemInfoSync();
|
||||||
|
// this.swiperHeight = res.windowHeight - (88 / 2) + 'px';
|
||||||
|
this.swiperHeight = res.windowHeight + 'px';
|
||||||
},
|
},
|
||||||
toApplyPage(index) {
|
confirm(e){
|
||||||
console.log(index)
|
|
||||||
if(index == 1) {
|
|
||||||
this.showPopup = false;
|
this.showPopup = false;
|
||||||
this.choose = false
|
if(JSON.stringify(this.checkedGoods) != '{}'){
|
||||||
}
|
this.choose = true;
|
||||||
},
|
|
||||||
// replaces(){
|
|
||||||
// if(this.list[0].name=='实体店历史订单'){
|
|
||||||
// this.$set(this.list,0,{name: '平台历史订单'} )
|
|
||||||
// }else{
|
|
||||||
// this.$set(this.list,0,{name: '实体店历史订单'} )
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
confirm(){
|
|
||||||
this.showPopup = false;
|
|
||||||
if(this.a ==''){
|
|
||||||
this.choose =false
|
|
||||||
}else{
|
}else{
|
||||||
this.choose = true
|
this.choose = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
close(){
|
close(){
|
||||||
this.showPopup = false
|
this.showPopup = false
|
||||||
},
|
},
|
||||||
reset(){
|
showToast(message, type) {
|
||||||
this.choose = false
|
this.$refs.uToast.show({
|
||||||
|
title: message,
|
||||||
|
type: type,
|
||||||
|
})
|
||||||
},
|
},
|
||||||
radioChange: function(evt) {
|
|
||||||
for (let i = 0; i < this.items.length; i++) {
|
|
||||||
if (this.items[i].value === evt.target.value) {
|
|
||||||
this.current = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.wash-order {
|
.wash-order {
|
||||||
|
height: calc(100vh - 1rpx);
|
||||||
|
overflow: hidden;
|
||||||
border-top: 1rpx solid #ECECEC;
|
border-top: 1rpx solid #ECECEC;
|
||||||
> uni-swiper {
|
> uni-swiper {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
height: 95vh;
|
// height: 95vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-info {
|
.order-info {
|
||||||
|
|
||||||
.choose-info{
|
.choose-info{
|
||||||
display: flex;flex-wrap: wrap;
|
display: flex;flex-wrap: wrap;
|
||||||
height: 335rpx;
|
height: 335rpx;
|
||||||
@@ -288,16 +461,12 @@ export default {
|
|||||||
height:60rpx;
|
height:60rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
padding-right:13rpx
|
margin-right: 12rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
font-family:PingFang SC;
|
|
||||||
font-weight:400;
|
|
||||||
color:rgba(51,51,51,1);
|
color:rgba(51,51,51,1);
|
||||||
line-height: 60rpx;
|
line-height: 60rpx;
|
||||||
|
|
||||||
}
|
}
|
||||||
.store_info{
|
.store_info{
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -308,6 +477,8 @@ export default {
|
|||||||
>image {
|
>image {
|
||||||
width: 180rpx;
|
width: 180rpx;
|
||||||
height: 160rpx;
|
height: 160rpx;
|
||||||
|
background-color: aqua;
|
||||||
|
border-radius: 10rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.info_txt {
|
.info_txt {
|
||||||
@@ -317,7 +488,8 @@ export default {
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
.content {
|
.content {
|
||||||
line-height: 44rpx;
|
height: 74rpx;
|
||||||
|
line-height: 37rpx;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color:rgba(51,51,51,1);
|
color:rgba(51,51,51,1);
|
||||||
}
|
}
|
||||||
@@ -363,12 +535,10 @@ export default {
|
|||||||
>image{
|
>image{
|
||||||
width: 27rpx;
|
width: 27rpx;
|
||||||
height: 12rpx;
|
height: 12rpx;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
> input {
|
> input {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
text-align: right;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -385,6 +555,17 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.order-view {
|
||||||
|
.title {
|
||||||
|
width: 140rpx;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: rgba(51,51,51,1);
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
> input {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.upload-image {
|
.upload-image {
|
||||||
padding: 35rpx 30rpx;
|
padding: 35rpx 30rpx;
|
||||||
@@ -399,7 +580,7 @@ export default {
|
|||||||
background: rgba(236,236,236,1);
|
background: rgba(236,236,236,1);
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
> img {
|
> image {
|
||||||
width: 54rpx;
|
width: 54rpx;
|
||||||
height: 49rpx;
|
height: 49rpx;
|
||||||
margin-top: 48rpx;
|
margin-top: 48rpx;
|
||||||
@@ -417,119 +598,67 @@ export default {
|
|||||||
height: 98rpx;
|
height: 98rpx;
|
||||||
background: rgba(255,120,15,1);
|
background: rgba(255,120,15,1);
|
||||||
border-radius: 49rpx;
|
border-radius: 49rpx;
|
||||||
position: absolute;
|
margin: 30rpx auto 30rpx;
|
||||||
bottom: 40rpx;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, 0);
|
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
color:rgba(255,255,255,1);
|
color:rgba(255,255,255,1);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 98rpx;
|
line-height: 98rpx;
|
||||||
}
|
}
|
||||||
.popup{
|
.order-popup {
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
z-index: 2;
|
|
||||||
background-color: rgba(0, 0, 0, 0.4);
|
|
||||||
transform: scale(1);
|
|
||||||
align-items: center;
|
|
||||||
transition-duration: 0.3s;
|
|
||||||
|
|
||||||
.popup_cont{
|
|
||||||
border-top: 1px solid RGBA(239, 236, 240, 1);
|
|
||||||
background-color: #fff;
|
|
||||||
width: 100%;
|
|
||||||
height: 1072rpx;
|
|
||||||
line-height: 80rpx;
|
|
||||||
font-size:28rpx;
|
|
||||||
font-family:PingFang SC;
|
|
||||||
font-weight:400;
|
|
||||||
color:rgba(102,102,102,1);
|
|
||||||
transform: scale(1);
|
|
||||||
position: fixed;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
bottom: 0px;
|
|
||||||
left: 0px;
|
|
||||||
right: 0px;
|
|
||||||
/* top: 0px; */
|
|
||||||
transition-duration: 0.3s;
|
|
||||||
border-radius:20px 20px 0px 0px;
|
|
||||||
> uni-swiper {
|
|
||||||
flex: 1;
|
|
||||||
height: 100vh;
|
|
||||||
|
|
||||||
.order-list{
|
|
||||||
height: 60vh;
|
|
||||||
padding-bottom: 140rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.check{
|
.check{
|
||||||
|
padding: 30rpx;
|
||||||
|
border-bottom: 1rpx solid rgba(236, 236, 236, 1);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
> text {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
font-family:PingFang SC;
|
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: rgba(51,51,51,1);
|
color: rgba(51,51,51,1);
|
||||||
height:88rpx;
|
|
||||||
width: 100%;
|
|
||||||
padding-left: 30rpx;
|
|
||||||
border-bottom: 1px solid rgba(236, 236, 236, 1);
|
|
||||||
|
|
||||||
>image{
|
|
||||||
width: 32rpx;
|
|
||||||
height: 32rpx;
|
|
||||||
vertical-align: middle;
|
|
||||||
float: right;
|
|
||||||
padding-top: 30rpx;
|
|
||||||
padding-right:30rpx
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.order-list {
|
||||||
|
height: 60vh;
|
||||||
|
padding: 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.order-item {
|
||||||
|
margin-bottom: 30rpx;
|
||||||
.store {
|
.store {
|
||||||
>view{
|
.name {
|
||||||
padding-left: 30rpx;
|
margin-bottom: 20rpx;
|
||||||
padding-top: 30rpx;
|
font-size: 28rpx;
|
||||||
|
color:rgba(51,51,51,1);
|
||||||
> image {
|
> image {
|
||||||
width: 60rpx;
|
width: 60rpx;
|
||||||
height: 60rpx;
|
height: 60rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
padding-right:13rpx
|
margin-right: 13rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.order-sn {
|
||||||
font-size:28rpx;
|
margin-bottom: 20rpx;
|
||||||
font-family:PingFang SC;
|
font-size: 24rpx;
|
||||||
font-weight:400;
|
color: rgba(153,153,153,1);
|
||||||
color:rgba(51,51,51,1);
|
}
|
||||||
line-height: 60rpx;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
.checkd {
|
.checkd {
|
||||||
>radio-group .uni-list-cell{
|
.radio-view {
|
||||||
display: flex;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.radio{
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding-left: 30rpx;
|
.radio {
|
||||||
|
margin-right: 20rpx;
|
||||||
}
|
}
|
||||||
.store_info {
|
.store_info {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
.info_img{
|
.info_img{
|
||||||
>image{
|
>image{
|
||||||
width: 180rpx;
|
width: 180rpx;
|
||||||
height: 160rpx;
|
height: 160rpx;
|
||||||
|
background-color: aqua;
|
||||||
|
border-radius: 10rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.info_txt{
|
.info_txt{
|
||||||
@@ -539,7 +668,8 @@ export default {
|
|||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
.content{
|
.content{
|
||||||
line-height: 44rpx;
|
height: 74rpx;
|
||||||
|
line-height: 37rpx;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color:rgba(51,51,51,1);
|
color:rgba(51,51,51,1);
|
||||||
}
|
}
|
||||||
@@ -554,4 +684,17 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.order-btn {
|
||||||
|
width: 690rpx;
|
||||||
|
height: 98rpx;
|
||||||
|
background: rgba(255,120,15,1);
|
||||||
|
border-radius: 49rpx;
|
||||||
|
line-height: 98rpx;
|
||||||
|
text-align: center;
|
||||||
|
margin: 0 auto 40rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: rgba(255,255,255,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
98
pageE/tool/washComment.vue
Normal file
98
pageE/tool/washComment.vue
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
<template>
|
||||||
|
<view class="comment">
|
||||||
|
<view class="main-container">
|
||||||
|
<u-input v-model="content" type="textarea" height="300" maxlength="200" />
|
||||||
|
<!-- <u-upload
|
||||||
|
ref="uUpload"
|
||||||
|
@on-uploaded="onUploaded"
|
||||||
|
:custom-btn="true"
|
||||||
|
:max-count="count"
|
||||||
|
:auto-upload="false"
|
||||||
|
>
|
||||||
|
<view slot="addBtn" class="slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
|
||||||
|
<image src="../static/mine/27.png"></image>
|
||||||
|
</view>
|
||||||
|
</u-upload> -->
|
||||||
|
</view>
|
||||||
|
<u-toast ref="uToast" />
|
||||||
|
<view class="write-btn" @click="addWashEvaluate">发表评价</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
washId: '',
|
||||||
|
// count: 4, // 最大图片数量
|
||||||
|
content: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
this.washId = option.id;
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
verifyParams() {
|
||||||
|
if(this.$u.test.isEmpty(this.content)) {
|
||||||
|
this.$u.toast('内容不可为空');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
addWashEvaluate() {
|
||||||
|
if(!this.verifyParams()) return false;
|
||||||
|
this.$u.api.sendOrderComment({
|
||||||
|
id: this.washId,
|
||||||
|
comment: this.content,
|
||||||
|
}).then(res => {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: res.message,
|
||||||
|
back: true,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
bindTextAreaBlur(event) {
|
||||||
|
this.content = event.detail.value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.comment {
|
||||||
|
min-height: calc(100vh - var(--window-top));
|
||||||
|
background-color: #ECECEC;
|
||||||
|
border-top: 1rpx solid #ffffff;
|
||||||
|
.main-container {
|
||||||
|
background-color: #ffffff;
|
||||||
|
padding: 30rpx;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
// textarea {
|
||||||
|
// width: 100% !important;
|
||||||
|
// height: 500rpx;
|
||||||
|
// margin-bottom: 60rpx;
|
||||||
|
// }
|
||||||
|
// .slot-btn {
|
||||||
|
// width: 140rpx;
|
||||||
|
// height: 140rpx;
|
||||||
|
// background: rgba(236,236,236,1);
|
||||||
|
// border-radius: 10rpx;
|
||||||
|
// text-align: center;
|
||||||
|
// > img {
|
||||||
|
// margin-top: 48rpx;
|
||||||
|
// width: 54rpx;
|
||||||
|
// height: 49rpx;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
.write-btn {
|
||||||
|
margin: 120rpx auto 0;
|
||||||
|
width: 690rpx;
|
||||||
|
height: 98rpx;
|
||||||
|
background: rgba(255,120,15,1);
|
||||||
|
border-radius: 46rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: rgba(255,255,255,1);
|
||||||
|
text-align: center;
|
||||||
|
line-height: 98rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
43
pages.json
43
pages.json
@@ -80,6 +80,7 @@
|
|||||||
{
|
{
|
||||||
"root": "pageB",
|
"root": "pageB",
|
||||||
"pages": [
|
"pages": [
|
||||||
|
|
||||||
{
|
{
|
||||||
"path": "follow/index",
|
"path": "follow/index",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -113,6 +114,28 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "triedDress/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "试穿订单",
|
||||||
|
"app-plus":{
|
||||||
|
"titleNView":{
|
||||||
|
"backgroundColor":"#ffffff"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "comment/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "商品评价",
|
||||||
|
"app-plus":{
|
||||||
|
"titleNView":{
|
||||||
|
"backgroundColor":"#ffffff"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "search/index",
|
"path": "search/index",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -575,6 +598,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "tool/washComment",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "送洗评价",
|
||||||
|
"app-plus": {
|
||||||
|
"titleSize": "36px",
|
||||||
|
"titleNView": {
|
||||||
|
"titleColor": "#333333",
|
||||||
|
"backgroundColor": "#FFFFFF"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "tool/WashOrder",
|
"path": "tool/WashOrder",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -829,6 +865,13 @@
|
|||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/zhibo/index",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/index/index",
|
"path": "pages/index/index",
|
||||||
"style": {
|
"style": {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<scroll-view style="width:100%;height:100%" scroll-y="true">
|
<scroll-view style="width:100%;height:100%" scroll-y="true">
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<!-- <indexad style="width:690rpx"></indexad> -->
|
<!-- <indexad style="width:690rpx"></indexad> -->
|
||||||
<u-swiper mode="dot" :list="indexImageSwiper" name="adv_code"></u-swiper>
|
<u-swiper mode="dot" :list="indexImageSwiper" name="adv_code" @click="clickFImage"></u-swiper>
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view>
|
<view>
|
||||||
<videoItem v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" :item="item"
|
<videoItem v-for="item in articleList.filter((_, index) => !(index&1))" :key="item.article_id" :item="item"
|
||||||
@@ -36,13 +36,13 @@
|
|||||||
<swiper-item>
|
<swiper-item>
|
||||||
<scroll-view style="width:100%;height:100%" scroll-y="true">
|
<scroll-view style="width:100%;height:100%" scroll-y="true">
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<u-swiper mode="dot" :list="zhiboImageSwiper" name="adv_code"></u-swiper>
|
<u-swiper mode="dot" :list="zhiboImageSwiper" name="adv_code" @click="clickSImage($event, 2)"></u-swiper>
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view>
|
<view>
|
||||||
<zhiboItem v-for="item in 10"></zhiboItem>
|
<zhiboItem v-for="item in tabLiveLists.filter((_, index) => !(index&1))" :zid="item.live_id" :rid="item.chatroom_id" :key="item.live_id" :name="item.store_name" :image="item.cover_img" :url="item.url"></zhiboItem>
|
||||||
</view>
|
</view>
|
||||||
<view style="margin-left:20rpx">
|
<view style="margin-left:20rpx">
|
||||||
<zhiboItem v-for="item in 10"></zhiboItem>
|
<zhiboItem v-for="item in tabLiveLists.filter((_, index) => index&1)" :zid="item.live_id" :rid="item.chatroom_id" :key="item.live_id" :name="item.store_name" :image="item.cover_img" :url="item.url"></zhiboItem>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -203,6 +203,7 @@
|
|||||||
recommendList: [], // 推荐达人
|
recommendList: [], // 推荐达人
|
||||||
indexImageSwiper: [],
|
indexImageSwiper: [],
|
||||||
zhiboImageSwiper: [],
|
zhiboImageSwiper: [],
|
||||||
|
tabLiveLists:[]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
@@ -222,6 +223,7 @@
|
|||||||
tabLiveList(){
|
tabLiveList(){
|
||||||
this.$u.api.tabLiveList().then((res)=>{
|
this.$u.api.tabLiveList().then((res)=>{
|
||||||
console.log(res)
|
console.log(res)
|
||||||
|
this.tabLiveLists = res.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getSwiper() {
|
getSwiper() {
|
||||||
@@ -281,6 +283,28 @@
|
|||||||
url: '/pageB/follow/index'
|
url: '/pageB/follow/index'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
clickFImage(index) {
|
||||||
|
const item = this.indexImageSwiper[index];
|
||||||
|
console.log(item);
|
||||||
|
this.activityLink({ type: item.url_type, id: item.info_id });
|
||||||
|
},
|
||||||
|
clickSImage(index) {
|
||||||
|
const item = this.zhiboImageSwiper[index];
|
||||||
|
console.log(item);
|
||||||
|
this.activityLink({ type: item.url_type, id: item.info_id });
|
||||||
|
},
|
||||||
|
activityLink({ type, id }) {
|
||||||
|
if(type == 0) return false;
|
||||||
|
// type 1 商品详情页, 2 店铺详情页
|
||||||
|
const url = type == 1 ? 'pageB/sdetails/index' : 'pageC/merchant/index';
|
||||||
|
let params = { id: id };
|
||||||
|
// type: 1 // 商品详情 1普通 2拼团 3秒杀 4优惠券
|
||||||
|
if(type == 1) Object.assign(params, { type: 1 });
|
||||||
|
this.$u.route({
|
||||||
|
url: url,
|
||||||
|
params: params
|
||||||
|
})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
<view class="info-left">
|
<view class="info-left">
|
||||||
<view class="user-nickname">{{ userInfo.member_nickname }}</view>
|
<view class="user-nickname">{{ userInfo.member_nickname }}</view>
|
||||||
<view class="user-medal" @click="toOtherPage('/mine/MedalIntroduction')">
|
<view class="user-medal" @click="toOtherPage('/mine/MedalIntroduction')">
|
||||||
<img src="/static/image/mine/13.png" />
|
<image src="/static/image/mine/13.png"></image>
|
||||||
<view class="rank-title">勋章</view>
|
<view class="rank-title">{{ userInfo.member_grade_name }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-right">
|
<view class="info-right">
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
<view>商品收藏</view>
|
<view>商品收藏</view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="toOtherPage('/mine/StoreCollection')">
|
<view @click="toOtherPage('/mine/StoreCollection')">
|
||||||
<view>{{ userInfo.member_fav_store_num }}</view>
|
<view>{{ userInfo.member_fav_store_num || 0 }}</view>
|
||||||
<view>店铺收藏</view>
|
<view>店铺收藏</view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="toOtherPage('/mine/ImageTextCollection')">
|
<view @click="toOtherPage('/mine/ImageTextCollection')">
|
||||||
@@ -32,11 +32,11 @@
|
|||||||
<view>图文收藏</view>
|
<view>图文收藏</view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="toOtherPage('/mine/Integral')">
|
<view @click="toOtherPage('/mine/Integral')">
|
||||||
<view>{{ userInfo ? userInfo.member_points : 0 }}</view>
|
<view>{{ userInfo.member_points || 0 }}</view>
|
||||||
<view>积分数</view>
|
<view>积分数</view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="toOtherPage('/mine/MineConcerns')">
|
<view @click="toOtherPage('/mine/MineConcerns')">
|
||||||
<view>{{ userInfo.member_snsfrend_num }}</view>
|
<view>{{ userInfo.member_snsfrend_num || 0 }}</view>
|
||||||
<view>关注</view>
|
<view>关注</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -47,32 +47,32 @@
|
|||||||
<view class="title-text">我的订单</view>
|
<view class="title-text">我的订单</view>
|
||||||
<view class="more" @click="toOtherPage('/order/Index')">
|
<view class="more" @click="toOtherPage('/order/Index')">
|
||||||
<view>查看全部订单</view>
|
<view>查看全部订单</view>
|
||||||
<img src="/static/image/mine/21.png" />
|
<image src="/static/image/mine/21.png"></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view @click="toOtherPage('/order/Index?current=1')">
|
<view @click="toOtherPage('/order/Index?current=1')">
|
||||||
<img src="/static/image/mine/6.png" />
|
<image src="/static/image/mine/6.png"></image>
|
||||||
<view>待支付</view>
|
<view>待支付</view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="toOtherPage('/order/Index?current=2')">
|
<view @click="toOtherPage('/order/Index?current=2')">
|
||||||
<img src="/static/image/mine/14.png" />
|
<image src="/static/image/mine/14.png"></image>
|
||||||
<view>已取消</view>
|
<view>已取消</view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="toOtherPage('/order/Index?current=3')">
|
<view @click="toOtherPage('/order/Index?current=3')">
|
||||||
<img src="/static/image/mine/2.png" />
|
<image src="/static/image/mine/2.png"></image>
|
||||||
<view>待收货</view>
|
<view>待收货</view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="toOtherPage('/order/Index?current=4')">
|
<view @click="toOtherPage('/order/Index?current=4')">
|
||||||
<img src="/static/image/mine/1.png" />
|
<image src="/static/image/mine/1.png"></image>
|
||||||
<view>试穿试送</view>
|
<view>试穿试送</view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="toOtherPage('/order/Index?current=5')">
|
<view @click="toOtherPage('/order/Index?current=5')">
|
||||||
<img src="/static/image/mine/3.png" />
|
<image src="/static/image/mine/3.png"></image>
|
||||||
<view>待评价</view>
|
<view>待评价</view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="toOtherPage('/order/Index?current=6')">
|
<view @click="toOtherPage('/order/Index?current=6')">
|
||||||
<img src="/static/image/mine/9.png" />
|
<image src="/static/image/mine/9.png"></image>
|
||||||
<view>售后</view>
|
<view>售后</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -81,19 +81,19 @@
|
|||||||
<view class="title">我的工具</view>
|
<view class="title">我的工具</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view @click="toOtherPage('/tool/SendWash')">
|
<view @click="toOtherPage('/tool/SendWash')">
|
||||||
<img src="/static/image/mine/20.png" />
|
<image src="/static/image/mine/20.png"></image>
|
||||||
<view>送洗</view>
|
<view>送洗</view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="toOtherPage('/tool/Manicure')">
|
<view @click="toOtherPage('/tool/Manicure')">
|
||||||
<img src="/static/image/mine/19.png" />
|
<image src="/static/image/mine/19.png"></image>
|
||||||
<view>美甲</view>
|
<view>美甲</view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="toOtherPage('/tool/MineHistory')">
|
<view @click="toOtherPage('/tool/MineHistory')">
|
||||||
<img src="/static/image/mine/18.png" />
|
<image src="/static/image/mine/18.png"></image>
|
||||||
<view>足迹</view>
|
<view>足迹</view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="toOtherPage('/tool/MineCoupon')">
|
<view @click="toOtherPage('/tool/MineCoupon')">
|
||||||
<img src="/static/image/mine/25.png" />
|
<image src="/static/image/mine/25.png"></image>
|
||||||
<view>优惠券</view>
|
<view>优惠券</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -102,19 +102,19 @@
|
|||||||
<view class="title">更多工具</view>
|
<view class="title">更多工具</view>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view @click="toOtherPage('/more/Address')">
|
<view @click="toOtherPage('/more/Address')">
|
||||||
<img src="/static/image/mine/17.png" />
|
<image src="/static/image/mine/17.png"></image>
|
||||||
<view>收货地址</view>
|
<view>收货地址</view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="toOtherPage('/more/AfterSalesHelp')">
|
<view @click="toOtherPage('/more/AfterSalesHelp')">
|
||||||
<img src="/static/image/mine/9.png" />
|
<image src="/static/image/mine/9.png"></image>
|
||||||
<view>售后政策</view>
|
<view>售后政策</view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="toOtherPage('/more/MineHelp')">
|
<view @click="toOtherPage('/more/MineHelp')">
|
||||||
<img src="/static/image/mine/16.png" />
|
<image src="/static/image/mine/16.png"></image>
|
||||||
<view>使用帮助</view>
|
<view>使用帮助</view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="toOtherPage('/more/Complaints')">
|
<view @click="toOtherPage('/more/Complaints')">
|
||||||
<img src="/static/image/mine/15.png" />
|
<image src="/static/image/mine/15.png"></image>
|
||||||
<view>投诉意见</view>
|
<view>投诉意见</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -189,10 +189,11 @@ export default {
|
|||||||
border-radius: 13rpx;
|
border-radius: 13rpx;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 0 17rpx 0 10rpx;
|
padding: 0 17rpx 0 10rpx;
|
||||||
> img {
|
> image {
|
||||||
margin-right: 9rpx;
|
margin-right: 9rpx;
|
||||||
width: 20rpx;
|
width: 20rpx;
|
||||||
height: 22rpx;
|
height: 22rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
.rank-title {
|
.rank-title {
|
||||||
font-size: 16rpx;
|
font-size: 16rpx;
|
||||||
@@ -240,7 +241,13 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.mine-container {
|
.mine-container {
|
||||||
@mixin common-mine($content-padding-top, $content-padding-bottom, $image-height) {
|
@mixin image-size($image-width, $image-height) {
|
||||||
|
> image {
|
||||||
|
width: $image-width !important;
|
||||||
|
height: $image-height !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@mixin common-mine($content-padding-top, $content-padding-bottom, $image-width, $image-height) {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
width: 690rpx;
|
width: 690rpx;
|
||||||
background: rgba(255,255,255,1);
|
background: rgba(255,255,255,1);
|
||||||
@@ -270,9 +277,11 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
> view {
|
> view {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
> img {
|
> image {
|
||||||
|
width: $image-width;
|
||||||
height: $image-height;
|
height: $image-height;
|
||||||
margin-bottom: 15rpx;
|
margin-bottom: 15rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
> view {
|
> view {
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
@@ -285,31 +294,50 @@ export default {
|
|||||||
@include common-mine(
|
@include common-mine(
|
||||||
$content-padding-top: 22rpx,
|
$content-padding-top: 22rpx,
|
||||||
$content-padding-bottom: 30rpx,
|
$content-padding-bottom: 30rpx,
|
||||||
$image-height: 36rpx
|
$image-height: 36rpx,
|
||||||
|
$image-width: 36rpx,
|
||||||
);
|
);
|
||||||
.title {
|
.title {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
.more {
|
.more {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
> img {
|
> image {
|
||||||
|
width: 19rpx;
|
||||||
height: 19rpx;
|
height: 19rpx;
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.content {
|
.content {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
> view {
|
> view:nth-child(1){
|
||||||
text-align: center;
|
@include image-size($image-width: 33rpx, $image-height: 36rpx);
|
||||||
};
|
}
|
||||||
|
> view:nth-child(2){
|
||||||
|
@include image-size($image-width: 39rpx, $image-height: 33rpx);
|
||||||
|
}
|
||||||
|
> view:nth-child(3){
|
||||||
|
@include image-size($image-width: 41rpx, $image-height: 33rpx);
|
||||||
|
}
|
||||||
|
> view:nth-child(4){
|
||||||
|
@include image-size($image-width: 40rpx, $image-height: 35rpx);
|
||||||
|
}
|
||||||
|
> view:nth-child(5){
|
||||||
|
@include image-size($image-width: 37rpx, $image-height: 37rpx);
|
||||||
|
}
|
||||||
|
> view:nth-child(6){
|
||||||
|
@include image-size($image-width: 33rpx, $image-height: 35rpx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.tool {
|
.tool {
|
||||||
@include common-mine(
|
@include common-mine(
|
||||||
$content-padding-top: 8rpx,
|
$content-padding-top: 8rpx,
|
||||||
$content-padding-bottom: 25rpx,
|
$content-padding-bottom: 25rpx,
|
||||||
$image-height: 71rpx
|
$image-height: 71rpx,
|
||||||
|
$image-width: 71rpx,
|
||||||
);
|
);
|
||||||
.content {
|
.content {
|
||||||
> view:not(:last-child) {
|
> view:not(:last-child) {
|
||||||
@@ -321,7 +349,8 @@ export default {
|
|||||||
@include common-mine(
|
@include common-mine(
|
||||||
$content-padding-top: 8rpx,
|
$content-padding-top: 8rpx,
|
||||||
$content-padding-bottom: 48rpx,
|
$content-padding-bottom: 48rpx,
|
||||||
$image-height: 71rpx
|
$image-height: 71rpx,
|
||||||
|
$image-width: 71rpx,
|
||||||
);
|
);
|
||||||
.content {
|
.content {
|
||||||
> view:not(:last-child) {
|
> view:not(:last-child) {
|
||||||
|
|||||||
@@ -11,7 +11,9 @@
|
|||||||
</view>
|
</view>
|
||||||
<image src="/static/image/shop/3.png" class="mnue" @click="toClassifyPage"></image>
|
<image src="/static/image/shop/3.png" class="mnue" @click="toClassifyPage"></image>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="swiper-image">
|
||||||
<u-swiper :list="list" mode="dot" @click="clickImage"></u-swiper>
|
<u-swiper :list="list" mode="dot" @click="clickImage"></u-swiper>
|
||||||
|
</view>
|
||||||
<view class="chengnuo">
|
<view class="chengnuo">
|
||||||
<view>
|
<view>
|
||||||
<image src="/static/image/shop/4.png"></image>
|
<image src="/static/image/shop/4.png"></image>
|
||||||
@@ -33,21 +35,18 @@
|
|||||||
<view class="fenlei">
|
<view class="fenlei">
|
||||||
<shopitem v-for="item in goodsClassify" :key="item.gc_id" :info="item" class="item"></shopitem>
|
<shopitem v-for="item in goodsClassify" :key="item.gc_id" :info="item" class="item"></shopitem>
|
||||||
</view>
|
</view>
|
||||||
<view class="hr" style="margin-top:80rpx"></view>
|
|
||||||
<!-- 秒杀 -->
|
<!-- 秒杀 -->
|
||||||
<recommend v-if="JSON.stringify(recommendedSpike) != '{}'" :recommendData="recommendedSpike" type="spike"></recommend>
|
<recommend v-if="JSON.stringify(recommendedSpike) != '{}'" :recommendData="recommendedSpike" type="spike"></recommend>
|
||||||
<view v-if="JSON.stringify(recommendedSpike) != '{}'" class="hr" style="margin-top:40rpx"></view>
|
|
||||||
<!-- 秒杀列表 -->
|
<!-- 秒杀列表 -->
|
||||||
<seckill v-if="spikeList.length" :list="spikeList" :time="seckillTime"></seckill>
|
<seckill v-if="spikeList.length" :list="spikeList" :time="seckillTime"></seckill>
|
||||||
<view v-if="spikeList.length" class="hr" style="margin-top:40rpx"></view>
|
|
||||||
<!-- 拼团推荐 -->
|
<!-- 拼团推荐 -->
|
||||||
<pintuan v-if="JSON.stringify(pinTuanPush) != '{}'" :recommendData="pinTuanPush"></pintuan>
|
<pintuan v-if="JSON.stringify(pinTuanPush) != '{}'" :recommendData="pinTuanPush"></pintuan>
|
||||||
<view class="hr" style="margin-top:40rpx" v-if="JSON.stringify(pinTuanPush) != '{}'"></view>
|
|
||||||
<!-- 拼团列表 -->
|
<!-- 拼团列表 -->
|
||||||
<group :groupList="pinTuanList" :classifyList="couponGroupList"></group>
|
<group></group>
|
||||||
<image class="lingquan"></image>
|
<view class="activity-view">
|
||||||
|
<image class="lingquan" :src="activityInfo.adv_code" @click="activityLink({ type: activityInfo.url_type, id: activityInfo.info_id })"></image>
|
||||||
|
</view>
|
||||||
<youhq></youhq>
|
<youhq></youhq>
|
||||||
<view class="hr" style="margin-top:40rpx"></view>
|
|
||||||
<list ref="recommendGoods"></list>
|
<list ref="recommendGoods"></list>
|
||||||
<view class="cart" @click="toCartPage">
|
<view class="cart" @click="toCartPage">
|
||||||
<image src="/static/image/common/3.png"></image>
|
<image src="/static/image/common/3.png"></image>
|
||||||
@@ -56,13 +55,13 @@
|
|||||||
</scroll-view>
|
</scroll-view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import shopitem from "@/components/shop/shop-item/index"
|
import shopitem from "@/components/shop/shop-item/index";
|
||||||
import recommend from "@/components/shop/recommend/index"
|
import recommend from "@/components/shop/recommend/index";
|
||||||
import pintuan from "@/components/shop/recommend/pintuan"
|
import pintuan from "@/components/shop/recommend/pintuan";
|
||||||
import seckill from "@/components/shop/seckill/index"
|
import seckill from "@/components/shop/seckill/index";
|
||||||
import group from "@/components/shop/group/index"
|
import group from "@/components/shop/group/index";
|
||||||
import youhq from "@/components/shop/youhq/index"
|
import youhq from "@/components/shop/youhq/index";
|
||||||
import list from "../../components/shop/list/index"
|
import list from "@/components/shop/list/index";
|
||||||
export default {
|
export default {
|
||||||
name: "shop",
|
name: "shop",
|
||||||
components: {
|
components: {
|
||||||
@@ -86,13 +85,13 @@ export default {
|
|||||||
keyword: "",
|
keyword: "",
|
||||||
list: [],
|
list: [],
|
||||||
goodsClassify: [], // 商品分类
|
goodsClassify: [], // 商品分类
|
||||||
classifyList: [],
|
// classifyList: [],
|
||||||
recommendedSpike: {}, // 秒杀推荐
|
recommendedSpike: {}, // 秒杀推荐
|
||||||
spikeList: [], // 全部秒杀列表
|
spikeList: [], // 全部秒杀列表
|
||||||
seckillTime: {}, // 秒杀时间
|
seckillTime: {}, // 秒杀时间
|
||||||
couponGroupList: [], // 优惠券拼团分类
|
// couponGroupList: [], // 优惠券拼团分类
|
||||||
pinTuanList: [], // 拼团商品
|
|
||||||
pinTuanPush: {}, // 拼团推荐
|
pinTuanPush: {}, // 拼团推荐
|
||||||
|
activityInfo: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
@@ -101,8 +100,8 @@ export default {
|
|||||||
onShow() {
|
onShow() {
|
||||||
this.getRecommendedSpike();
|
this.getRecommendedSpike();
|
||||||
this.getSpikeList();
|
this.getSpikeList();
|
||||||
this.getGoodsClass();
|
|
||||||
this.getPinTuanPush();
|
this.getPinTuanPush();
|
||||||
|
this.getStoreActivity();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
sousuo() {
|
sousuo() {
|
||||||
@@ -141,15 +140,6 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获取优惠券拼团分类
|
|
||||||
getGoodsClass() {
|
|
||||||
this.$u.api.getGoodsClass().then(res => {
|
|
||||||
if(res.errCode == 0) {
|
|
||||||
this.couponGroupList = res.data;
|
|
||||||
this.getPinTuanList(this.couponGroupList[0].gc_id);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 全部秒杀
|
// 全部秒杀
|
||||||
getSpikeList() {
|
getSpikeList() {
|
||||||
this.$u.api.getSpikeList({ page: 0 }).then(res => {
|
this.$u.api.getSpikeList({ page: 0 }).then(res => {
|
||||||
@@ -162,15 +152,6 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 拼团列表
|
|
||||||
getPinTuanList(id) {
|
|
||||||
this.$u.api.getPinTuanList({
|
|
||||||
page: 0,
|
|
||||||
gc_id: id,
|
|
||||||
}).then(res => {
|
|
||||||
this.pinTuanList = res.data;
|
|
||||||
})
|
|
||||||
},
|
|
||||||
clickImage(index) {
|
clickImage(index) {
|
||||||
console.log(index);
|
console.log(index);
|
||||||
console.log(this.list[index]);
|
console.log(this.list[index]);
|
||||||
@@ -193,6 +174,25 @@ export default {
|
|||||||
url: '/pageC/classify/index'
|
url: '/pageC/classify/index'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
getStoreActivity() {
|
||||||
|
this.$u.api.getStoreActivity().then(res => {
|
||||||
|
if(res.errCode == 0) {
|
||||||
|
this.activityInfo = res.data;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
activityLink({ type, id }) {
|
||||||
|
if(type == 0 || type == 2) return false;
|
||||||
|
// type 1 商品详情页, 2 店铺详情页
|
||||||
|
const url = type == 1 ? 'pageB/sdetails/index' : '';
|
||||||
|
let params = { id: id };
|
||||||
|
// type: 1 // 商品详情 1普通 2拼团 3秒杀 4优惠券
|
||||||
|
if(type == 1) Object.assign(params, { type: 1 });
|
||||||
|
this.$u.route({
|
||||||
|
url: url,
|
||||||
|
params: params
|
||||||
|
})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -200,8 +200,10 @@ export default {
|
|||||||
.shop {
|
.shop {
|
||||||
height: calc(100vh - var(--window-top));
|
height: calc(100vh - var(--window-top));
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 0 33rpx 100rpx;
|
background-color: #F0EDF1;
|
||||||
.top {
|
.top {
|
||||||
|
padding: 0 30rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 88rpx;
|
height: 88rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -211,6 +213,10 @@ export default {
|
|||||||
height: 37rpx;
|
height: 37rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.swiper-image {
|
||||||
|
background-color: #ffffff;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
}
|
||||||
.add {
|
.add {
|
||||||
width: 115rpx;
|
width: 115rpx;
|
||||||
height: 25rpx;
|
height: 25rpx;
|
||||||
@@ -230,15 +236,17 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.mnue {
|
.mnue {
|
||||||
|
background-color: #ffffff;
|
||||||
width: 35rpx;
|
width: 35rpx;
|
||||||
height: 26rpx;
|
height: 26rpx;
|
||||||
margin-left: 36rpx;
|
margin-left: 36rpx;
|
||||||
}
|
}
|
||||||
.chengnuo {
|
.chengnuo {
|
||||||
|
padding: 30rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-top: 24rpx;
|
|
||||||
> view {
|
> view {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -254,10 +262,11 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.fenlei {
|
.fenlei {
|
||||||
|
padding: 30rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
display: flex;
|
display: flex;
|
||||||
// justify-content: space-between;
|
|
||||||
margin-top: 30rpx;
|
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
> view {
|
> view {
|
||||||
margin-bottom: 30rpx;
|
margin-bottom: 30rpx;
|
||||||
&:not(:nth-child(5n)) {
|
&:not(:nth-child(5n)) {
|
||||||
@@ -265,18 +274,14 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.hr{
|
.activity-view {
|
||||||
width: 750rpx;
|
padding: 20rpx 30rpx;
|
||||||
margin-left: -33rpx;
|
text-align: center;
|
||||||
height: 20rpx;
|
|
||||||
background-color: #ececec;
|
|
||||||
}
|
|
||||||
.lingquan {
|
.lingquan {
|
||||||
width: 750rpx;
|
|
||||||
height: 177rpx;
|
|
||||||
margin-left: -33rpx;
|
|
||||||
margin-top: 29rpx;
|
|
||||||
background-color: #ececec;
|
background-color: #ececec;
|
||||||
|
width: 688rpx;
|
||||||
|
height: 138rpx;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.cart {
|
.cart {
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
|
|||||||
510
pages/zhibo/index.nvue
Normal file
510
pages/zhibo/index.nvue
Normal file
@@ -0,0 +1,510 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<video :src="url" class="vodio" autoplay="true" :show-fullscreen-btn="false" :show-play-btn="false" :enable-progress-gesture="false" :show-center-play-btn="false" :show-progress="false" :controls="false" :style="{'height':height}">
|
||||||
|
|
||||||
|
</video>
|
||||||
|
<view class="user" :style="{'top': top}">
|
||||||
|
<view class="back"></view>
|
||||||
|
<image class="head" :src="info.member_avatar"></image>
|
||||||
|
<view class="userinfo">
|
||||||
|
<text class="name">{{info.member_nickname}}</text>
|
||||||
|
<text class="info">{{info.live_desc}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="guanzhu" @click="guanzhu"><text style="color:#fff;font-size:24rpx">{{info.is_attention == 1 ? '已关注' : '关注'}}</text></view>
|
||||||
|
</view>
|
||||||
|
<view class="userlist" :style="{'top': top + 10 * rpx}">
|
||||||
|
<image class="userlistitem" v-for="(i,j) in [0,1,2]" :style="{'right': (-j * 15 * rpx) + 'px'}"></image>
|
||||||
|
</view>
|
||||||
|
<view class="hot" :style="{'top': top + 10 * rpx}">
|
||||||
|
<text class="hottext">2.8w</text>
|
||||||
|
</view>
|
||||||
|
<image class="cart" src="../../static/cart.png" @click="show = true">
|
||||||
|
|
||||||
|
</image>
|
||||||
|
<view class="danmufasongbox" @click="danmu = true">
|
||||||
|
<view class="danmufasongboxback"></view>
|
||||||
|
<image src="../../static/danmu.png" class="danmubianji"></image>
|
||||||
|
<text style="font-size:26rpx;color:#fff;margin-left:20rpx">想说点什么</text>
|
||||||
|
</view>
|
||||||
|
<image class="liketap" src="../../static/like.png" @click="">
|
||||||
|
|
||||||
|
<view class="danmuinputbox" v-if="danmu">
|
||||||
|
<input type="text" focus="true" style="width:600rpx;margin-left:30rpx;font-size:26rpx" maxlength="20" @blur="danmu=false" v-model="danmutext">
|
||||||
|
<view class="danmufasong" @click="sendMessage(room.MessageType.CHAT,danmutext)">
|
||||||
|
<text style="font-size:24rpx;color:#fff">发送</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<div class="danmulist">
|
||||||
|
<text class="danmuitem" v-for="(i,j) in danmulist" :key="j">{{i.senderNickname}}:{{i.content}}</text>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<image class="closeimg" src="../../static/close.png" :style="{'top': top + 30 * rpx}" @click="back"></image>
|
||||||
|
</image>
|
||||||
|
<div class="bottom" :style="{'height':height + 'px'}" v-if="show" @click="show = false">
|
||||||
|
<div class="tanchuceng" @click="zuzhi">
|
||||||
|
<div class="heads">
|
||||||
|
<div style="flex-direction: row;align-items:center">
|
||||||
|
<text class="title">全部商品</text>
|
||||||
|
<text class="num">{{list.length}}件</text>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="add">
|
||||||
|
<text style="font-size:28rpx;color: #fff;text-align:center">添加/管理商品</text>
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
|
<list class="list">
|
||||||
|
<cell class="item" v-for="(i,j) in list" @click="xuanzhong(j)">
|
||||||
|
<image class="shopimg" :src="i.goods_image"></image>
|
||||||
|
<div class="infos">
|
||||||
|
<div>
|
||||||
|
<text style="font-size:26rpx;colro:#333;margin-top:12rpx;lines:1;text-overflow:ellipsis">{{i.goods_name}}</text>
|
||||||
|
<text style="font-size:24rpx;color:#333;margin-top:14rpx;lines:1;text-overflow:ellipsis">{{i.goods_advword}}</text>
|
||||||
|
</div>
|
||||||
|
<div style="flex-direction: row; align-items: flex-end;">
|
||||||
|
<text style="font-size:28rpx;color:#FF3131">¥{{i.goods_price}}</text>
|
||||||
|
<text style="font-size:26rpx;color:#999">¥{{i.goods_marketprice}}</text>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <image :src="'../../static/image/release/' + (i.putaway == 1 ? 'on' : 'off') + '.png'" style="width:55rpx;height:35rpx;margin-top:120rpx;margin-left:150rpx"></image> -->
|
||||||
|
</cell>
|
||||||
|
</list>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.infos{
|
||||||
|
height: 160rpx;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
width: 404rpx;
|
||||||
|
}
|
||||||
|
.shopimg{
|
||||||
|
width: 160rpx;
|
||||||
|
height: 160rpx;
|
||||||
|
background-color: #0f0;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
.heads{
|
||||||
|
width: 750rpx;
|
||||||
|
height: 88rpx;
|
||||||
|
border-bottom-width: 2rpx;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #ECECEC;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
.title{
|
||||||
|
font-size: 30rpx;
|
||||||
|
color:#333;
|
||||||
|
margin-left: 30rpx;
|
||||||
|
}
|
||||||
|
.tanchuceng{
|
||||||
|
width: 750rpx;
|
||||||
|
height: 782rpx;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
border-top-left-radius:20rpx;
|
||||||
|
border-top-left-radius:20rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
transition: bottom 0.5s;
|
||||||
|
z-index: 20;
|
||||||
|
|
||||||
|
}
|
||||||
|
.item{
|
||||||
|
width: 690rpx;
|
||||||
|
height: 200rpx;
|
||||||
|
border-bottom-width: 2rpx;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #ECECEC;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.list{
|
||||||
|
width: 750rpx;
|
||||||
|
height: 694rpx;
|
||||||
|
padding-left: 30rpx;
|
||||||
|
padding-right: 30rpx;
|
||||||
|
}
|
||||||
|
.add{
|
||||||
|
width: 221rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
background-color: #FF780F;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
justify-content: center;
|
||||||
|
margin-right: 30rpx;
|
||||||
|
}
|
||||||
|
.num{
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #FF3131;
|
||||||
|
margin-left: 30rpx;
|
||||||
|
}
|
||||||
|
.bottom{
|
||||||
|
width: 750rpx;
|
||||||
|
position: fixed;
|
||||||
|
top:0;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
.cart{
|
||||||
|
width: 50rpx;
|
||||||
|
height: 46rpx;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 36rpx;
|
||||||
|
right: 154rpx;
|
||||||
|
}
|
||||||
|
.hottext{
|
||||||
|
font-size: 20rpx;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.hot{
|
||||||
|
width: 60rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
background-color: rgb(104, 104, 104);
|
||||||
|
position: fixed;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
right: 86rpx;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.userlistitem{
|
||||||
|
width: 60rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
position: relative;
|
||||||
|
border-radius: 30rpx;
|
||||||
|
background-color: #0f0;
|
||||||
|
}
|
||||||
|
.userlist{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row-reverse;
|
||||||
|
width: 150rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
position: fixed;
|
||||||
|
right: 156rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
.name {
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #fff;
|
||||||
|
lines: 1;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
.info {
|
||||||
|
font-size: 20rpx;
|
||||||
|
color: #fff;
|
||||||
|
margin-top: 6rpx;
|
||||||
|
lines: 1;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
.userinfo {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100rpx;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
|
||||||
|
}
|
||||||
|
.guanzhu {
|
||||||
|
width: 100rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
background-color: #ff780f;
|
||||||
|
border-radius: 25rpx;
|
||||||
|
margin-left: 10rpx;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.head {
|
||||||
|
width: 70rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
border-radius: 35rpx;
|
||||||
|
}
|
||||||
|
.back {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
background-color: #000;
|
||||||
|
opacity: 0.2;
|
||||||
|
width: 308rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
border-radius: 35rpx;
|
||||||
|
}
|
||||||
|
.user {
|
||||||
|
position: fixed;
|
||||||
|
left: 30rpx;
|
||||||
|
width: 308rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 35rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
.video {
|
||||||
|
width: 750rpx;
|
||||||
|
}
|
||||||
|
.liketap{
|
||||||
|
width: 55rpx;
|
||||||
|
height: 57rpx;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 30rpx;
|
||||||
|
right: 54rpx;
|
||||||
|
}
|
||||||
|
.closeimg{
|
||||||
|
width: 31rpx;
|
||||||
|
height: 31rpx;
|
||||||
|
position: fixed;
|
||||||
|
right: 31rpx;
|
||||||
|
background-color: #0f0;
|
||||||
|
}
|
||||||
|
.danmufasongbox{
|
||||||
|
width: 308rpx;
|
||||||
|
height: 58rpx;
|
||||||
|
position: fixed;
|
||||||
|
left: 30rpx;
|
||||||
|
bottom: 30rpx;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.danmufasongboxback{
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 308rpx;
|
||||||
|
height: 58rpx;
|
||||||
|
background-color: #0f0;
|
||||||
|
opacity: 0.4;
|
||||||
|
border-radius: 29rpx;
|
||||||
|
}
|
||||||
|
.danmubianji{
|
||||||
|
width: 27rpx;
|
||||||
|
height: 32rpx;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
}
|
||||||
|
.danmuinputbox{
|
||||||
|
position: fixed;
|
||||||
|
bottom:0;
|
||||||
|
height: 100rpx;
|
||||||
|
width: 750rpx;
|
||||||
|
z-index: 9999;
|
||||||
|
background-color: #fff;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
}
|
||||||
|
.danmufasong{
|
||||||
|
width: 85rpx;
|
||||||
|
height: 51rpx;
|
||||||
|
background-color: #FF780F;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border-radius: 5rpx;
|
||||||
|
}
|
||||||
|
.danmulist{
|
||||||
|
position: fixed;
|
||||||
|
left: 30rpx;
|
||||||
|
bottom: 118rpx;
|
||||||
|
}
|
||||||
|
.danmuitem{
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #fff;
|
||||||
|
flex-direction: column-reverse;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const ChatRoomService =require('../../static/chatservice');
|
||||||
|
export default {
|
||||||
|
name: "zhibo",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
url: "",
|
||||||
|
top: 0,
|
||||||
|
height: 0,
|
||||||
|
rpx:0,
|
||||||
|
show:false,
|
||||||
|
list:[],
|
||||||
|
id:0,
|
||||||
|
info:{},
|
||||||
|
danmutext:"",
|
||||||
|
danmu:false,
|
||||||
|
room:{},
|
||||||
|
chatRoomService:{},
|
||||||
|
danmulist:[]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad(a) {
|
||||||
|
this.url = a.url;
|
||||||
|
this.id = a.id
|
||||||
|
console.log(this.url);
|
||||||
|
let that = this;
|
||||||
|
uni.getSystemInfo({
|
||||||
|
success(a) {
|
||||||
|
console.log(a.windowHeight);
|
||||||
|
that.height = a.windowHeight;
|
||||||
|
// that.start()
|
||||||
|
that.top = a.statusBarHeight + 5;
|
||||||
|
that.rpx = (a.windowWidth / 750)
|
||||||
|
console.log(that.rpx)
|
||||||
|
},
|
||||||
|
});
|
||||||
|
// this.$u.api.goodsShelves({live_id:this.id}).then((res)=>{
|
||||||
|
// console.log(res)
|
||||||
|
// })
|
||||||
|
const token = uni.getStorageSync('token');
|
||||||
|
console.log(token,that.id)
|
||||||
|
uni.request({
|
||||||
|
url:"https://dmmall.sdbairui.com/api/Specialci/goodsShelves",
|
||||||
|
data:{
|
||||||
|
live_id:that.id
|
||||||
|
},
|
||||||
|
method:"POST",
|
||||||
|
header:{
|
||||||
|
"Authorization" : 'Bearer' + " " + token
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
console.log(res)
|
||||||
|
that.list= res.data.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
setInterval(function(){
|
||||||
|
uni.request({
|
||||||
|
url:"https://dmmall.sdbairui.com/api/Specialci/goodsShelves",
|
||||||
|
data:{
|
||||||
|
live_id:that.id
|
||||||
|
},
|
||||||
|
method:"POST",
|
||||||
|
header:{
|
||||||
|
"Authorization" : 'Bearer' + " " + token
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
console.log(res)
|
||||||
|
that.list= res.data.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},6 * 1000)
|
||||||
|
uni.request({
|
||||||
|
url:"https://dmmall.sdbairui.com/api/Specialci/livingUserInfo",
|
||||||
|
data:{
|
||||||
|
live_id:that.id
|
||||||
|
},
|
||||||
|
method:"POST",
|
||||||
|
header:{
|
||||||
|
"Authorization" : 'Bearer' + " " + token
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
console.log(res)
|
||||||
|
that.info = res.data.data
|
||||||
|
// that.list= res.data.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
//当前用户
|
||||||
|
uni.request({
|
||||||
|
url:"https://dmmall.sdbairui.com/api/Member/MemberInfo",
|
||||||
|
method:"POST",
|
||||||
|
header:{
|
||||||
|
'Authorization' : 'Bearer' + " " + token
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
console.log(res,111)
|
||||||
|
var currentUser = {
|
||||||
|
id : "12",
|
||||||
|
nickname :"123",
|
||||||
|
avatar: "1223"
|
||||||
|
};
|
||||||
|
|
||||||
|
var room = {
|
||||||
|
id : "123",
|
||||||
|
name : "123"
|
||||||
|
};
|
||||||
|
console.log(room,currentUser)
|
||||||
|
//构造chatRoomService
|
||||||
|
that.chatRoomService = new ChatRoomService(room, currentUser);
|
||||||
|
that.chatRoomService.initialWhenNewMessage(that.whenNewMessage);
|
||||||
|
that.chatRoomService.connectGoEasyIM();
|
||||||
|
|
||||||
|
//获取当前聊天室数据
|
||||||
|
that.room = that.chatRoomService.room;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
sendMessage (messageType, content) {//发送消息
|
||||||
|
console.log(123)
|
||||||
|
if(content == "" && messageType == 0) return;
|
||||||
|
var message = {
|
||||||
|
senderNickname : this.room.currentUser.nickname ,
|
||||||
|
type : messageType,
|
||||||
|
content : content
|
||||||
|
}
|
||||||
|
this.chatRoomService.sendMessages(this.room.id, message);
|
||||||
|
this.danmutext = ""
|
||||||
|
},
|
||||||
|
whenNewMessage (message) {//新消息监听
|
||||||
|
// if(message.type == this.room.MessageType.PROP){
|
||||||
|
// this.propAnimation(parseInt(message.content))
|
||||||
|
// }
|
||||||
|
// setTimeout(() => {
|
||||||
|
// this.contentPosition = 'message-box'+(this.room.messages.length-1);
|
||||||
|
// }, 300)
|
||||||
|
console.log(message)
|
||||||
|
this.danmulist.push(message)
|
||||||
|
if(this.danmulist.length > 7){
|
||||||
|
this.danmulist = this.danmulist.slice(this.danmulist.length - 7)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
back(){
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1
|
||||||
|
});
|
||||||
|
},
|
||||||
|
guanzhu(){
|
||||||
|
const token = uni.getStorageSync('token');
|
||||||
|
let that = this
|
||||||
|
console.log(token)
|
||||||
|
uni.request({
|
||||||
|
url:"https://dmmall.sdbairui.com/api/member/attentionMember",
|
||||||
|
data:{
|
||||||
|
member_id:that.info.user_id
|
||||||
|
},
|
||||||
|
method:"POST",
|
||||||
|
header:{
|
||||||
|
"Authorization" : 'Bearer' + " " + token
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
console.log(res)
|
||||||
|
uni.request({
|
||||||
|
url:"https://dmmall.sdbairui.com/api/Specialci/livingUserInfo",
|
||||||
|
data:{
|
||||||
|
live_id:that.id
|
||||||
|
},
|
||||||
|
method:"POST",
|
||||||
|
header:{
|
||||||
|
"Authorization" : 'Bearer' + " " + token
|
||||||
|
},
|
||||||
|
success(res){
|
||||||
|
console.log(res)
|
||||||
|
that.info = res.data.data
|
||||||
|
// that.list= res.data.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// that.list= res.data.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
xuanzhong(i){
|
||||||
|
let that = this
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pageB/sdetails/index?id=${that.list[i].goods_id}&type=1`
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
zuzhi(event){
|
||||||
|
event.stopPropagation();
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
BIN
static/cart.png
Normal file
BIN
static/cart.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.4 KiB |
276
static/chatservice.js
Normal file
276
static/chatservice.js
Normal file
@@ -0,0 +1,276 @@
|
|||||||
|
/*
|
||||||
|
* @Author: jack.lu
|
||||||
|
* @Date: 2020-4-21 10:10:20
|
||||||
|
* @Last Modified by: jack.lu
|
||||||
|
* @Last Modified time: 2020-4-21 15:01:41
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
import GoEasyIM from './goeasy-im-1.0.9.js'
|
||||||
|
|
||||||
|
//用户
|
||||||
|
function User(id, nickname, avatar) {
|
||||||
|
this.id = id;
|
||||||
|
this.nickname = nickname;
|
||||||
|
this.avatar = avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
//消息
|
||||||
|
function Message(senderUserId, senderNickname, content, type) {
|
||||||
|
this.senderNickname = senderNickname;
|
||||||
|
this.senderUserId = senderUserId;
|
||||||
|
this.content = content;
|
||||||
|
this.type = type
|
||||||
|
}
|
||||||
|
|
||||||
|
//聊天室
|
||||||
|
function Room(id, name, currentUser) {
|
||||||
|
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
this.currentUser = currentUser;
|
||||||
|
|
||||||
|
this.onlineUsers = {
|
||||||
|
count: 0,
|
||||||
|
users: []
|
||||||
|
};
|
||||||
|
|
||||||
|
this.messages = [];
|
||||||
|
|
||||||
|
this.MessageType = {
|
||||||
|
CHAT: 0,//文字聊天
|
||||||
|
PROP: 1//道具
|
||||||
|
};
|
||||||
|
|
||||||
|
this.Prop = {
|
||||||
|
HEART: 0,//桃心
|
||||||
|
ROCKET: 1//火箭
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function ChatRoomService(room, user) {
|
||||||
|
this.room = new Room(room.id, room.name, user);
|
||||||
|
this.whenNewMessage = function () {
|
||||||
|
|
||||||
|
};
|
||||||
|
this.whenOnlineUserChange = function () {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取实例
|
||||||
|
ChatRoomService.prototype.connectGoEasyIM = function () {
|
||||||
|
this.im = GoEasyIM.getInstance({
|
||||||
|
appkey: 'BC-453aa755c4ea48148abefc55a86df283',
|
||||||
|
host: 'hangzhou.goeasy.io'
|
||||||
|
});
|
||||||
|
|
||||||
|
//监听网络连接成功
|
||||||
|
this.im.on(GoEasyIM.EVENT.CONNECTED, () => {
|
||||||
|
console.log('GoEasyIM网络连接成功');
|
||||||
|
//连接成功后,更新在线用户数和用户头像
|
||||||
|
this.initialOnlineUsers(this.room.id);
|
||||||
|
});
|
||||||
|
|
||||||
|
//监听网络连接断开
|
||||||
|
this.im.on(GoEasyIM.EVENT.DISCONNECTED, () => {
|
||||||
|
console.log('GoEasyIM网络断开')
|
||||||
|
});
|
||||||
|
|
||||||
|
//监听上下线提醒
|
||||||
|
this.listenerGroupPresence();
|
||||||
|
|
||||||
|
//监听新消息
|
||||||
|
this.listenerNewMessage();
|
||||||
|
|
||||||
|
var currentUser = this.room.currentUser;
|
||||||
|
//连接GoEasyIM
|
||||||
|
this.im.connect({
|
||||||
|
id: currentUser.id,
|
||||||
|
data: {
|
||||||
|
avatar: currentUser.avatar,
|
||||||
|
nickname: currentUser.nickname
|
||||||
|
}
|
||||||
|
}).then(() => {
|
||||||
|
console.log('连接成功');
|
||||||
|
this.initialChatHistory(this.room.id);
|
||||||
|
|
||||||
|
//订阅用户上下线事件
|
||||||
|
this.subscribePresence(this.room.id);
|
||||||
|
//订阅聊天室消息
|
||||||
|
this.subscribeRoomMessage(this.room.id);
|
||||||
|
|
||||||
|
|
||||||
|
}).catch(e => {
|
||||||
|
console.log(e);
|
||||||
|
console.log('连接失败');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
ChatRoomService.prototype.initialWhenNewMessage = function (whenNewMessage) {
|
||||||
|
this.whenNewMessage = whenNewMessage;
|
||||||
|
};
|
||||||
|
|
||||||
|
ChatRoomService.prototype.initialWhenOnlineUserChange = function (whenOnlineUserChange) {
|
||||||
|
this.whenOnlineUserChange = whenOnlineUserChange;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//监听新消息
|
||||||
|
ChatRoomService.prototype.listenerNewMessage = function () {
|
||||||
|
|
||||||
|
this.im.on(GoEasyIM.EVENT.GROUP_MESSAGE_RECEIVED, (message) => {
|
||||||
|
var content = JSON.parse(message.payload.text);
|
||||||
|
this.addNewMessage(message);
|
||||||
|
this.whenNewMessage(content);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
ChatRoomService.prototype.addNewMessage = function (message) {
|
||||||
|
var content = JSON.parse(message.payload.text);
|
||||||
|
let messageContent = "";
|
||||||
|
//聊天消息
|
||||||
|
if (content.type == this.room.MessageType.CHAT) {
|
||||||
|
messageContent = content.content;
|
||||||
|
}
|
||||||
|
//道具消息
|
||||||
|
if (content.type == this.room.MessageType.PROP) {
|
||||||
|
if (content.content == this.room.Prop.ROCKET) {
|
||||||
|
messageContent = "送出了一枚大火箭";
|
||||||
|
}
|
||||||
|
if (content.content == this.room.Prop.HEART) {
|
||||||
|
messageContent = "送出了一个大大的比心";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//添加消息
|
||||||
|
let newMessage = new Message(message.senderId, content.senderNickname, messageContent);
|
||||||
|
this.room.messages.push(newMessage);
|
||||||
|
};
|
||||||
|
|
||||||
|
//监听用户上下线
|
||||||
|
ChatRoomService.prototype.listenerGroupPresence = function () {
|
||||||
|
this.im.on(GoEasyIM.EVENT.GROUP_PRESENCE, (event) => {
|
||||||
|
//更新在线用户数
|
||||||
|
this.room.onlineUsers.count = event.groupOnlineCount;
|
||||||
|
|
||||||
|
if (event.action == 'join' || event.action == 'online') {
|
||||||
|
let userData = JSON.parse(event.userData);
|
||||||
|
//添加新用户
|
||||||
|
let user = new User(event.userId, userData.nickname, userData.avatar);
|
||||||
|
|
||||||
|
//添加在线用户,避免用户重复
|
||||||
|
if (!this.room.onlineUsers.users.find(item => item.id == event.userId)) {
|
||||||
|
this.room.onlineUsers.users.push(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
//添加进入房间的消息
|
||||||
|
let message = new Message(event.userId, userData.nickname, " 进入房间", this.room.MessageType.CHAT);
|
||||||
|
this.room.messages.push(message);
|
||||||
|
} else {
|
||||||
|
let offlineUserIndex = this.room.onlineUsers.users.findIndex(item => item.id == event.userId);
|
||||||
|
if (offlineUserIndex > -1) {
|
||||||
|
//将离开的用户从onlineUsers中删掉
|
||||||
|
let offlineUser = Object.assign(this.room.onlineUsers.users[offlineUserIndex]);
|
||||||
|
this.room.onlineUsers.users.splice(offlineUserIndex, 1);
|
||||||
|
//添加离开消息
|
||||||
|
let message = new Message(offlineUser.id, offlineUser.nickname, " 离开房间", this.room.MessageType.CHAT)
|
||||||
|
this.room.messages.push(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.whenOnlineUserChange(this.room.onlineUsers);
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
//查询和初始化在线用户列表和在线用户数
|
||||||
|
ChatRoomService.prototype.initialOnlineUsers = function (roomId) {
|
||||||
|
let self = this;
|
||||||
|
|
||||||
|
//查询最新上线的用户列表
|
||||||
|
this.im.groupHereNow(roomId)
|
||||||
|
.then(result => {
|
||||||
|
if (result.code == 200) {
|
||||||
|
let users = [];
|
||||||
|
result.content && result.content.map(function (onlineUser) {
|
||||||
|
let userData = JSON.parse(onlineUser.userData);
|
||||||
|
let user = new User(onlineUser.userId, userData.nickname, userData.avatar);
|
||||||
|
users.push(user);
|
||||||
|
});
|
||||||
|
self.room.onlineUsers = {
|
||||||
|
users: users
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}).catch(e => {
|
||||||
|
if (e.code == 401) {
|
||||||
|
console.log("您还没有开通用户在线状态提醒,登录goeasy->我的应用->查看详情->高级功能,自助开通.");
|
||||||
|
} else {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//获取聊天室在线用户数
|
||||||
|
this.im.groupOnlineCount(roomId)
|
||||||
|
.then(result => {
|
||||||
|
this.room.onlineUsers.count = result.content.onlineCount;
|
||||||
|
}).catch(e => {
|
||||||
|
console.log(e)
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
//订阅聊天室成员上下线
|
||||||
|
ChatRoomService.prototype.subscribePresence = function (roomId) {
|
||||||
|
this.im.subscribeGroupPresence([roomId])
|
||||||
|
.then(() => {
|
||||||
|
console.log('成员上下线订阅成功')
|
||||||
|
}).catch(e => {
|
||||||
|
console.log(e)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//订阅聊天室消息
|
||||||
|
ChatRoomService.prototype.subscribeRoomMessage = function (roomId) {
|
||||||
|
this.im.subscribeGroup([roomId])
|
||||||
|
.then(result => {
|
||||||
|
console.log('消息订阅成功')
|
||||||
|
}).catch(e => {
|
||||||
|
console.log(e)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//历史消息
|
||||||
|
ChatRoomService.prototype.initialChatHistory = function (roomId) {
|
||||||
|
var self = this;
|
||||||
|
this.im.history({
|
||||||
|
groupId: roomId
|
||||||
|
}).then(res => {
|
||||||
|
res.content.forEach(function (message) {
|
||||||
|
self.addNewMessage(message);
|
||||||
|
})
|
||||||
|
}).catch(function (error) {
|
||||||
|
if (error.code == 401) {
|
||||||
|
console.log("您还没有开通历史消息的权限,登录goeasy->我的应用->查看详情->高级功能,自助开通.");
|
||||||
|
} else {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
//发送消息
|
||||||
|
ChatRoomService.prototype.sendMessages = function (roomId, content) {
|
||||||
|
var contentMessage = {
|
||||||
|
text: JSON.stringify(content)
|
||||||
|
};
|
||||||
|
let message = this.im.createTextMessage(contentMessage);
|
||||||
|
this.im.sendGroupMessage(roomId, message)
|
||||||
|
.then(() => {
|
||||||
|
console.log('消息发送成功')
|
||||||
|
}).catch(e => {
|
||||||
|
console.log(e);
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
//退出聊天室
|
||||||
|
ChatRoomService.prototype.quitRoom = function (roomId) {
|
||||||
|
this.im.disconnect()
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = ChatRoomService;
|
||||||
BIN
static/close.png
Normal file
BIN
static/close.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
BIN
static/danmu.png
Normal file
BIN
static/danmu.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
2
static/goeasy-im-1.0.9.js
Normal file
2
static/goeasy-im-1.0.9.js
Normal file
File diff suppressed because one or more lines are too long
BIN
static/image/common/20.png
Normal file
BIN
static/image/common/20.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
@@ -43,5 +43,29 @@ const common = {
|
|||||||
});
|
});
|
||||||
return promise;
|
return promise;
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* 将 php 时间戳转化为时分秒
|
||||||
|
* @param { String } timestamp php 时间戳
|
||||||
|
* @param { String } format 间隔符 默认 '26:14:25'
|
||||||
|
* @return { String } 格式化时间
|
||||||
|
*/
|
||||||
|
getLineTime({ timestamp, format } = {}) {
|
||||||
|
const days = Math.floor(timestamp / (24 * 3600 * 1000));
|
||||||
|
//计算出小时数
|
||||||
|
const leave1 = timestamp % (24 * 3600 * 1000) // 计算天数后剩余的毫秒数
|
||||||
|
let hours = Math.floor(leave1 / (3600 * 1000));
|
||||||
|
//计算相差分钟数
|
||||||
|
const leave2 = leave1 % (3600 * 1000) // 计算小时数后剩余的毫秒数
|
||||||
|
const minutes = Math.floor(leave2 / (60 * 1000))
|
||||||
|
//计算相差秒数
|
||||||
|
const leave3 = leave2 % (60 * 1000) // 计算分钟数后剩余的毫秒数
|
||||||
|
const seconds = Math.round(leave3 / 1000)
|
||||||
|
// 把天数算在小时里
|
||||||
|
hours = days * 24 + hours;
|
||||||
|
let result;
|
||||||
|
if(format) result = hours + format + minutes + format + seconds;
|
||||||
|
else result = hours + ':' + minutes + ':' + seconds;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
export default common
|
export default common
|
||||||
BIN
static/like.png
Normal file
BIN
static/like.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.4 KiB |
Reference in New Issue
Block a user