vip换购列表更改及部分拼团功能融合
This commit is contained in:
@@ -46,7 +46,7 @@ const request = (parameter, hideLoding = true) => {
|
||||
data: parameter.data || {},
|
||||
method: parameter.method || 'GET',
|
||||
success: res => {
|
||||
// console.log(res)
|
||||
console.log(res)
|
||||
if (res.header.Authorization) {
|
||||
updateToken('token', res.header.Authorization)
|
||||
}
|
||||
|
||||
@@ -44,9 +44,23 @@ const dtPAY = (orderNo,password) => {
|
||||
}
|
||||
|
||||
|
||||
const collagePAY = (orderNo,password) => {
|
||||
return request({
|
||||
url: 'mall/pay/' + orderNo + '/collage/account',
|
||||
method:'post',
|
||||
data: {
|
||||
type: 'app',
|
||||
transfer_password:password
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
export {
|
||||
wxPAY,
|
||||
alPAY,
|
||||
dtPAY,
|
||||
payIndex,
|
||||
collagePAY,
|
||||
}
|
||||
|
||||
@@ -62,6 +62,21 @@ const buy = data => {
|
||||
data
|
||||
})
|
||||
}
|
||||
// 拼团商品确认页面
|
||||
const buyPin = data => {
|
||||
return request({
|
||||
url: 'mall/buy/collages',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 拼团商品确认下单
|
||||
const collages = data => {
|
||||
return request({
|
||||
url: 'mall/buy/collages',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 商品下单
|
||||
const verify = data => {
|
||||
@@ -79,6 +94,21 @@ const classify = id => {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 拼团成功后展示页面
|
||||
const repages = id => {
|
||||
return request({
|
||||
url: 'mall/collages/' + id + '/repages'
|
||||
})
|
||||
}
|
||||
|
||||
// 商城所有分类
|
||||
const categories = id => {
|
||||
return request({
|
||||
url: 'mall/categories/lists'
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
mall,
|
||||
goods,
|
||||
@@ -87,6 +117,10 @@ export {
|
||||
shopsGoods,
|
||||
lists,
|
||||
buy,
|
||||
buyPin,
|
||||
verify,
|
||||
classify
|
||||
collages,
|
||||
repages,
|
||||
classify,
|
||||
categories
|
||||
}
|
||||
|
||||
28
pages.json
28
pages.json
@@ -154,9 +154,21 @@
|
||||
"path": "pages/store/list",
|
||||
"name": "StoreList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商品",
|
||||
"navigationBarTitleText": "更多商品",
|
||||
"navigationBarBackgroundColor": "#FFFFFF",
|
||||
"enablePullDownRefresh": true
|
||||
"enablePullDownRefresh": true,
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"backgroundColor": "#fff",
|
||||
"buttons": [{
|
||||
"float": "right",
|
||||
"text": "\ue603",
|
||||
"fontSrc": "/static/iconfont.ttf",
|
||||
"color": "#000",
|
||||
"fontSize": "20px"
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -447,7 +459,7 @@
|
||||
"color": "#696969",
|
||||
"type": "none",
|
||||
"fontSrc": "/static/fonts/iconfont1.ttf",
|
||||
"text": "\ue608" //小相机
|
||||
"text": "\ue608"
|
||||
}]
|
||||
}
|
||||
}
|
||||
@@ -617,13 +629,13 @@
|
||||
"easycom": {
|
||||
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
|
||||
},
|
||||
"condition" : { //模式配置,仅开发期间生效
|
||||
"current": 0, //当前激活的模式(list 的索引项)
|
||||
"condition" : {
|
||||
"current": 0,
|
||||
"list": [
|
||||
{
|
||||
"name": "", //模式名称
|
||||
"path": "", //启动页面,必选
|
||||
"query": "" //启动参数,在页面的onLoad函数里面得到
|
||||
"name": "",
|
||||
"path": "",
|
||||
"query": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,41 +1,95 @@
|
||||
<template>
|
||||
<view class="pinSuccess">
|
||||
<view class="count-down">
|
||||
<u-count-down :time="30 * 60 * 60 * 1000" format="HH:mm:ss" autoStart millisecond />
|
||||
<u-count-down ref="countDown" :time="downTime" format="HH:mm:ss" :autoStart="true" millisecond/>
|
||||
</view>
|
||||
<view class="title"> 还差 <span>1</span> 人,赶紧邀请好友来拼单吧 </view>
|
||||
<view class="title"> 还差 <span>{{surplus}}</span> 人,赶紧邀请好友来拼单吧 </view>
|
||||
<view class="btn invite"> 邀请好友拼单 </view>
|
||||
<view class="btn index" @click="goIndex"> 去首页逛逛</view>
|
||||
<view class="goodInfo">
|
||||
<view class="avatars">
|
||||
<image class="avatar me" src="/static/book/333.png" mode="aspectFill" />
|
||||
<image class="wen pin" src="/static/book/wen.png" mode="aspectFill" />
|
||||
</view>
|
||||
<view class="orderInfo">
|
||||
订单详情
|
||||
<view class="">
|
||||
<view class="">
|
||||
商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称
|
||||
</view>
|
||||
<u-icon type="arrow-right" size="15" />
|
||||
</view>
|
||||
<block v-for="(item,index) in details" :key='index'>
|
||||
<image class="avatar pin" :src="item.cover" mode="aspectFill" />
|
||||
</block>
|
||||
<image class="wen" src="/static/book/wen.png" mode="aspectFill" />
|
||||
</view>
|
||||
<block>
|
||||
<view class="orderInfo">
|
||||
<view class="left"> 订单详情 </view>
|
||||
<view class="right" @click="goDetail">
|
||||
<view class="right-title"> {{goodName}} </view>
|
||||
<u-icon name="arrow-right" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="orderInfo">
|
||||
<view class="left"> 拼单规则 </view>
|
||||
<view class="right">
|
||||
<view class="right-title">人满发货 · 人不满退款 · 只能拼一次 </view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
repages
|
||||
} from '@/apis/interfaces/store.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
goodName: '',
|
||||
details: [],
|
||||
downTime: 0,
|
||||
surplus: 1,
|
||||
order: {}, // order 是{} 标识不是我的订单,否则就是我的订单可以跳转订单详情
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
console.log(this.$Route.query.id)
|
||||
repages(this.$Route.query.id).then(res => {
|
||||
this.order = res.order
|
||||
this.goodName = res.order.goods.name
|
||||
this.downTime = res.share.down * 1000
|
||||
this.surplus = res.share.surplus
|
||||
this.details = res.share.details
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
mask: true,
|
||||
duration: 3000
|
||||
})
|
||||
})
|
||||
},
|
||||
onHide() {
|
||||
try {
|
||||
if(this.$refs.countDown){
|
||||
this.$refs.countDown.pause()
|
||||
}
|
||||
} catch (err) {
|
||||
uni.showToast({
|
||||
title: err,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
goIndex() {
|
||||
uni.reLaunch({
|
||||
url: '/pages/store/index/index'
|
||||
url: '/pages/store/index'
|
||||
})
|
||||
},
|
||||
goDetail(){
|
||||
if(!this.order.order_no){
|
||||
console.log('不是我的跳商品详情')
|
||||
uni.navigateTo({
|
||||
url:'/pages/store/goods?id='+this.order.goods.goods_id
|
||||
})
|
||||
}else{
|
||||
console.log('是我的跳转订单详情')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,15 +157,15 @@
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
border-bottom: solid 1rpx #999;
|
||||
border-bottom: solid 1rpx #f9f9f9;
|
||||
padding-bottom: $padding;
|
||||
|
||||
image {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
margin: 10rpx 20rpx;
|
||||
border-radius: 50%;
|
||||
|
||||
margin: 10rpx 20rpx;
|
||||
border: solid 2rpx #f9f9f9;
|
||||
}
|
||||
|
||||
.me {
|
||||
@@ -139,26 +193,44 @@
|
||||
top: 0;
|
||||
left: 0;
|
||||
content: '拼主';
|
||||
border-radius: 20rpx;
|
||||
// border-radius: 20rpx;
|
||||
background: orange;
|
||||
padding: 4rpx 20rpx;
|
||||
font-size: 24rpx;
|
||||
padding: 4rpx 0;
|
||||
font-size: 20rpx;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.orderInfo{
|
||||
.orderInfo {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
padding: 30rpx 0;
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
border-bottom: solid 1rpx #f9f9f9;
|
||||
|
||||
.right {
|
||||
flex: 1;
|
||||
margin-left: $margin;
|
||||
text-align: right;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
box-sizing: border-box;
|
||||
|
||||
.right-title {
|
||||
margin-right: 10rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -13,10 +13,13 @@
|
||||
wxPAY,
|
||||
alPAY,
|
||||
dtPAY,
|
||||
collagePAY,
|
||||
payIndex
|
||||
} from '@/apis/interfaces/pay'
|
||||
export default {
|
||||
components: { payKeyboard },
|
||||
components: {
|
||||
payKeyboard
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
payNo: "",
|
||||
@@ -28,6 +31,7 @@
|
||||
has_transfer_password: true,
|
||||
password: '',
|
||||
showKeyBoard: false,
|
||||
type: '',
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -36,7 +40,9 @@
|
||||
if (this.$Route.query.oepnType === 'order') {
|
||||
this.oepnType = this.$Route.query.oepnType
|
||||
}
|
||||
|
||||
if (this.$Route.query.type) {
|
||||
this.type = this.$Route.query.type
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.payIndex();
|
||||
@@ -116,7 +122,7 @@
|
||||
this.getDTPAY();
|
||||
},
|
||||
// 点击[取消] 关闭输入框 的回调
|
||||
close(){
|
||||
close() {
|
||||
this.showKeyBoard = false;
|
||||
this.canpay = true;
|
||||
},
|
||||
@@ -125,7 +131,11 @@
|
||||
getDTPAY() {
|
||||
if (this.canpay) {
|
||||
this.canpay = false
|
||||
dtPAY(this.payNo, this.password).then(res => {
|
||||
let requestUrl = dtPAY
|
||||
if (this.type === 'pin') {
|
||||
requestUrl = collagePAY
|
||||
}
|
||||
requestUrl(this.payNo, this.password).then(res => {
|
||||
if (res.state === 'warning') {
|
||||
uni.showModal({
|
||||
title: '当前DT积分不足',
|
||||
@@ -162,27 +172,64 @@
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '支付成功',
|
||||
content: '该订单已支付成功',
|
||||
confirmText: '我的订单',
|
||||
confirmColor: "#34CE98",
|
||||
cancelText: '再逛逛',
|
||||
cancelColor: "#666666",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
this.$Router.push({
|
||||
name: "Order",
|
||||
params: {
|
||||
index: 0
|
||||
},
|
||||
if (this.type === 'pin') {
|
||||
console.log('pin........', res)
|
||||
this.canpay = true
|
||||
if (res.detailId) {
|
||||
uni.showLoading({
|
||||
title:'跳转中',
|
||||
mask:true,
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.hideLoading()
|
||||
uni.navigateTo({
|
||||
url: '/pages/group-book/success/success?id=' + res.detailId
|
||||
})
|
||||
} else {
|
||||
uni.navigateBack();
|
||||
}
|
||||
this.canpay = true
|
||||
}, 2000)
|
||||
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '该订单拼团成功',
|
||||
confirmText: '查看订单',
|
||||
confirmColor: "#34CE98",
|
||||
cancelText: '再逛逛',
|
||||
cancelColor: "#666666",
|
||||
success: (res) => {
|
||||
if(res.confirm){
|
||||
console.log('挑战到我的拼单列表')
|
||||
} if(res.cancel){
|
||||
uni.navigateTo({
|
||||
url:'/pages/store/index'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '支付成功',
|
||||
content: '该订单已支付成功',
|
||||
confirmText: '我的订单',
|
||||
confirmColor: "#34CE98",
|
||||
cancelText: '再逛逛',
|
||||
cancelColor: "#666666",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
this.$Router.push({
|
||||
name: "Order",
|
||||
params: {
|
||||
index: 0
|
||||
},
|
||||
})
|
||||
} else {
|
||||
uni.navigateBack();
|
||||
}
|
||||
this.canpay = true
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<view class="block info-box">
|
||||
<view class="info-item">
|
||||
<view class="label">购买数量</view>
|
||||
<uni-number-box class="info-number" :value="qty" :min="1" :max="999" @change="numberChange" />
|
||||
<uni-number-box class="info-number" :value="qty" :min="1" :max="limit" @change="numberChange" />
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<view class="label">配送方式</view>
|
||||
@@ -62,7 +62,9 @@
|
||||
<script>
|
||||
import {
|
||||
buy,
|
||||
verify
|
||||
buyPin,
|
||||
verify,
|
||||
collages,
|
||||
} from '@/apis/interfaces/store'
|
||||
export default {
|
||||
data() {
|
||||
@@ -73,38 +75,71 @@
|
||||
freight: 0,
|
||||
address: "",
|
||||
remark: "",
|
||||
canApply: true
|
||||
canApply: true,
|
||||
limit:0,
|
||||
type: '', // 是否为空
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
if (JSON.stringify(this.$store.getters.getAddress) !== '{}') this.address = this.$store.getters.getAddress
|
||||
this.qty = this.$Route.query.qty;
|
||||
},
|
||||
mounted() {
|
||||
onLoad() {
|
||||
if (this.$Route.query.type === 'pin') {
|
||||
this.type = 'pin'
|
||||
}
|
||||
this.getBuy()
|
||||
},
|
||||
methods: {
|
||||
getBuy() {
|
||||
buy({
|
||||
goods_sku_id: this.$Route.query.skuId,
|
||||
qty: this.qty
|
||||
}).then(res => {
|
||||
this.address = res.address
|
||||
this.freight = res.freight
|
||||
this.total = res.total
|
||||
this.goodsInfo = res.detail
|
||||
}).catch(err => {
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: err.message,
|
||||
showCancel: false,
|
||||
confirmColor: '#34CE98',
|
||||
cancelText: '知道了',
|
||||
success: (res) => {
|
||||
uni.navigateBack({ })
|
||||
}
|
||||
console.log(this.type === 'pin')
|
||||
if (this.type == 'pin') {
|
||||
let data = {
|
||||
goods_sku_id: this.$Route.query.skuId,
|
||||
collage_id:this.$Route.query.collageid || '',
|
||||
}
|
||||
console.log(data);
|
||||
buyPin(data).then(res => {
|
||||
this.address = res.address
|
||||
this.freight = res.freight
|
||||
this.total = res.total
|
||||
this.goodsInfo = res.detail
|
||||
this.limit = res.limit
|
||||
}).catch(err => {
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: err.message,
|
||||
showCancel: false,
|
||||
confirmColor: '#34CE98',
|
||||
cancelText: '知道了',
|
||||
success: (res) => {
|
||||
uni.navigateBack({})
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
} else {
|
||||
buy({
|
||||
goods_sku_id: this.$Route.query.skuId,
|
||||
qty: this.qty
|
||||
}).then(res => {
|
||||
this.address = res.address
|
||||
this.freight = res.freight
|
||||
this.total = res.total
|
||||
this.goodsInfo = res.detail
|
||||
this.limit = res.limit
|
||||
}).catch(err => {
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: err.message,
|
||||
showCancel: false,
|
||||
confirmColor: '#34CE98',
|
||||
cancelText: '知道了',
|
||||
success: (res) => {
|
||||
uni.navigateBack({})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
numberChange(e) {
|
||||
this.qty = e
|
||||
@@ -130,35 +165,14 @@
|
||||
}
|
||||
if (this.canApply) {
|
||||
this.canApply = false;
|
||||
verify({
|
||||
goods_sku_id: this.$Route.query.skuId,
|
||||
qty: this.qty,
|
||||
address_id: this.address.address_id,
|
||||
remark: this.remark || ''
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if (res.order_no === '') {
|
||||
uni.showModal({
|
||||
title: ' 温馨提示',
|
||||
content: '领取商品成功',
|
||||
confirmColor: '#34CE98',
|
||||
confirmText: ' 查看订单',
|
||||
cancelColor: '#999',
|
||||
cancelText: '返回首页',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/index?index=0'
|
||||
})
|
||||
}
|
||||
if (res.cancel) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/store/index'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
if (this.type == 'pin'){
|
||||
collages({
|
||||
goods_sku_id: this.$Route.query.skuId,
|
||||
collage_id:this.$Route.query.collageid || '',
|
||||
address_id: this.address.address_id,
|
||||
remark: this.remark || ''
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
this.$store.commit('setAddress', {})
|
||||
this.$Router.replace({
|
||||
name: 'Pay',
|
||||
@@ -166,19 +180,71 @@
|
||||
orderNo: res.order_no,
|
||||
price: res.total,
|
||||
coins: res.coins,
|
||||
type:'pin'
|
||||
}
|
||||
})
|
||||
}
|
||||
this.canApply = true
|
||||
}).catch(err => {
|
||||
this.canApply = true
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
mask: true,
|
||||
duration: 2000
|
||||
this.canApply = true
|
||||
}).catch(err => {
|
||||
this.canApply = true
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
mask: true,
|
||||
duration: 2000
|
||||
})
|
||||
})
|
||||
})
|
||||
}else{
|
||||
verify({
|
||||
goods_sku_id: this.$Route.query.skuId,
|
||||
qty: this.qty,
|
||||
address_id: this.address.address_id,
|
||||
remark: this.remark || ''
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if (res.order_no === '') {
|
||||
uni.showModal({
|
||||
title: ' 温馨提示',
|
||||
content: '领取商品成功',
|
||||
confirmColor: '#34CE98',
|
||||
confirmText: ' 查看订单',
|
||||
cancelColor: '#999',
|
||||
cancelText: '返回首页',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/index?index=0'
|
||||
})
|
||||
}
|
||||
if (res.cancel) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/store/index'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$store.commit('setAddress', {})
|
||||
this.$Router.replace({
|
||||
name: 'Pay',
|
||||
params: {
|
||||
orderNo: res.order_no,
|
||||
price: res.total,
|
||||
coins: res.coins,
|
||||
}
|
||||
})
|
||||
}
|
||||
this.canApply = true
|
||||
}).catch(err => {
|
||||
this.canApply = true
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: "none",
|
||||
mask: true,
|
||||
duration: 2000
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
} else {
|
||||
this.canApply = true
|
||||
}
|
||||
|
||||
@@ -30,28 +30,44 @@
|
||||
<view class="tuan">{{goods.active.number}}人团</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- vip 商品规格 -->
|
||||
<view class="vipInfo" v-if="shop_vip.card">
|
||||
<image src="/static/store/vip-line-bg.png" mode="widthFix" />
|
||||
<view class="title">
|
||||
{{shop_vip.card.name}}
|
||||
<view class=" des"> {{shop_vip.card.description}} </view>
|
||||
</view>
|
||||
<view class="btn" @click="toVip">
|
||||
<!-- 1 开通 2续费 3升级 number 类型 -->
|
||||
查看详情
|
||||
<!-- {{shop_vip.card.state === 1 ?'立即开通':shop_vip.card.state === 2 ?'立即续费':'立即升级'}} -->
|
||||
</view>
|
||||
</view>
|
||||
<!-- 普通商品及 VIP 商品规格 -->
|
||||
<view class="unit" v-if="goods.skus && goods.skus[0].unit !== '' && !goods.is_active" @click="open()">
|
||||
<span>规格:{{selectSkusValues.unit_text}}</span>
|
||||
<uni-icons type="right" color="#cacaca" />
|
||||
</view>
|
||||
|
||||
<!-- 可拼团列表 -->
|
||||
<view class="is_active" v-if="goods.is_active && actives.length>0">
|
||||
<view class="title" v-if="actives.length > 2">
|
||||
<view class="is_active" v-if="goods.is_active && collages.length>0">
|
||||
<view class="title" v-if="collages.length > 2">
|
||||
这些人刚刚拼单成功,可参与拼单
|
||||
<span @click="getMorePin = true">查看更多
|
||||
<uni-icons type="right" color="#cacaca" />
|
||||
</span>
|
||||
</view>
|
||||
<view class="title" v-if="actives.length <= 2"> {{actives.length}}人正在拼单,可参与拼单 </view>
|
||||
<view class="title" v-if="collages.length <= 2"> {{collages.length}}人正在拼单,可参与拼单 </view>
|
||||
<view class="content">
|
||||
<block v-for="(item,index) in actives" :key="index">
|
||||
<block v-for="(item,index) in collages" :key="index">
|
||||
<view class="content-item" v-if="index < 2">
|
||||
<view class="info">
|
||||
<u-avatar-group :urls="item.urls" size="34" gap="0.6" class="avatar-group" />
|
||||
<view class="nickname"> {{item.name}}</view>
|
||||
<u-avatar-group :urls="item.covers" size="34" gap="0.6" class="avatar-group" />
|
||||
<view class="nickname"> {{item.names}}</view>
|
||||
</view>
|
||||
<view class="btn" @click="toPin(item)">去拼单</view>
|
||||
<view class="btn" v-if="goods.active.can_join || item.can_share" @click="toPin(item)">{{ item.can_share?'去分享':'去拼单'}}</view>
|
||||
<view class="noneBtn" v-else @click="showPinToast">去拼单</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
@@ -85,14 +101,16 @@
|
||||
|
||||
<!-- 立即购买 shop_vip.status 区分是否是 vip 商品 否则的就却分是拼团商品还是普通商品 -->
|
||||
<view class="footer">
|
||||
<view @click="toShop(goods.shop.shop_id)" class="shop">
|
||||
<uni-icons type="shop" size="26" color="grey" />店铺
|
||||
</view>
|
||||
<view @click="toShop(goods.shop.shop_id)" class="shop"> <uni-icons type="shop" size="26" color="grey" />店铺 </view>
|
||||
<!-- vip 规格弹窗立即领取 -->
|
||||
<button type="default" v-if="shop_vip.status" hover-class="none" @click="vipBuy">立即领取</button>
|
||||
<!-- 非vip 规格弹窗 普通商品立即购买,拼单商品立即拼单 -->
|
||||
<block v-else>
|
||||
<button type="default" hover-class="none" @click="buy">立即购买</button>
|
||||
<block v-if="goods.is_active">
|
||||
<button type="default" v-if="goods.active.can_join" hover-class="none" @click="buy"> 立即拼单 </button>
|
||||
<button type="default" v-else hover-class="none" @click="share"> 立即分享 </button>
|
||||
</block>
|
||||
<button v-else type="default" hover-class="none" @click="buy">立即购买</button>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 更多拼单弹窗 -->
|
||||
@@ -100,13 +118,14 @@
|
||||
<view class="getPinTitle"> 可参与拼单 </view>
|
||||
<scroll-view scroll-y="true" class="getPinList">
|
||||
<view class="content">
|
||||
<block v-for="(item,index) in actives" :key="index">
|
||||
<block v-for="(item,index) in collages" :key="index">
|
||||
<view class="content-item">
|
||||
<view class="info">
|
||||
<u-avatar-group :urls="item.urls" size="34" gap="0.6" class="avatar-group" />
|
||||
<view class="nickname"> {{item.name}}</view>
|
||||
<u-avatar-group :urls="item.covers" size="34" gap="0.6" class="avatar-group" />
|
||||
<view class="nickname"> {{item.names}}</view>
|
||||
</view>
|
||||
<view class="btn" @click="toPin(item)">去拼单</view>
|
||||
<view class="btn" v-if="goods.active.can_join || item.can_share" @click="toPin(item)">{{ item.can_share?'去分享':'去拼单'}}</view>
|
||||
<view class="noneBtn" v-else @click="showPinToast">去拼单</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
@@ -116,11 +135,11 @@
|
||||
<!-- 与谁谁的拼团 -->
|
||||
<u-popup :show="pinShow" :round="10" mode="center" @close="close" :closeable='true' zIndex="1229930">
|
||||
<view scroll-y="true" class="content-2">
|
||||
<view class="title"> 参与张三的拼单 </view>
|
||||
<view class="number">仅剩<span>1</span>个名额</view>
|
||||
<view class="avatars">
|
||||
<image class="avatar me" src="/static/book/333.png" mode="aspectFill" />
|
||||
<image class="wen pin" src="/static/book/wen.png" mode="aspectFill" />
|
||||
<view class="title"> 参与{{collageitem.names}}的拼单 </view>
|
||||
<view class="number">仅剩<span>{{collageitem.surplus}}</span>个名额</view>
|
||||
<view class="avatars" v-for="(item,index) in collageitem.details" :key='index' >
|
||||
<image :class="['avatar',item.master?'pin':'']" :src="item.cover" mode="aspectFill" />
|
||||
<image class="wen" src="/static/book/wen.png" mode="aspectFill" />
|
||||
</view>
|
||||
<view class="applyPin" @click="applyPin"> 参与拼单 </view>
|
||||
</view>
|
||||
@@ -143,17 +162,17 @@
|
||||
<view class="sku" v-for="(item,index) in specs" :key="item.spec_id">
|
||||
<view class="sku-title">{{item.name}}</view>
|
||||
<view class="sku-list">
|
||||
<block v-for="it in item.values" :keys='it.value_id'>
|
||||
<view :class="['sku-item',specselect[index] == it.value_id ? 'sku-active':'']"
|
||||
@click="clickSkus(index,it.value_id)"> {{it.value}} </view>
|
||||
<block v-for="it in item.values" :key='it.value_id'>
|
||||
<view :class="['sku-item',specselect[index] == it.value_id ? 'sku-active':'']" @click="clickSkus(index,it.value_id)">
|
||||
{{it.value}}
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="buy-number">
|
||||
<view class="buy-title">数量</view>
|
||||
<uni-number-box :min="1" :max="selectSkusValues.stock" :disabled="selectSkusValues.stock == 0"
|
||||
@change="qty = $event" />
|
||||
<uni-number-box :min="1" :max="selectSkusValues.stock" :disabled="selectSkusValues.stock == 0" @change="qty = $event" />
|
||||
</view>
|
||||
|
||||
<!-- 立即购买 shop_vip.status 区分是否是 vip 商品 只支持单规格php 规定不支持多规格 否则的就却分是拼团商品还是普通商品 -->
|
||||
@@ -162,8 +181,7 @@
|
||||
@click="vipBuy">立即领取</button>
|
||||
<!-- 非vip 规格弹窗 普通商品立即购买,拼单商品立即拼单 -->
|
||||
<block v-else>
|
||||
<button class="now-buy" type="default" hover-class="none"
|
||||
@click="buy2(selectSkusValues)">立即购买</button>
|
||||
<button class="now-buy" type="default" hover-class="none" @click="buy2(selectSkusValues)">立即购买</button>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</u-popup>
|
||||
@@ -196,13 +214,7 @@
|
||||
specselect: [],
|
||||
selectSkusValues: {},
|
||||
qty: 1,
|
||||
actives: [{
|
||||
urls: [
|
||||
'https://cdn.uviewui.com/uview/album/1.jpg',
|
||||
'https://cdn.uviewui.com/uview/album/2.jpg'
|
||||
],
|
||||
name: "洛基洛基、张三张三张三张三张三张三"
|
||||
}, ],
|
||||
collages: [], // 可拼单列表
|
||||
getMorePin: false, // 更多可拼团列表是否显示
|
||||
pinShow: false, // 与谁谁谁的拼团是否显示
|
||||
shop_vip: {
|
||||
@@ -210,6 +222,8 @@
|
||||
// "is_vip": true, // 当前会员是否是 vip true 是会员 false 非会员
|
||||
// "is_receive": false // 当前会员是否已领取过 false 未领取 true 已领取
|
||||
},
|
||||
// collageid:'' ,// 拼团 id
|
||||
collageitem:'',// 已选择的拼团的 item
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
@@ -217,9 +231,9 @@
|
||||
},
|
||||
methods: {
|
||||
getGoods() {
|
||||
let id = this.$Route.query.id
|
||||
let id = this.$Route.query.id;
|
||||
// let id = 61; // 普通商品
|
||||
// let id = 91; // 拼团商品
|
||||
// let id = 95; // 拼团商品
|
||||
goods(id).then(res => {
|
||||
this.goods = res
|
||||
this.specs = res.specs
|
||||
@@ -229,6 +243,7 @@
|
||||
this.specselect = res.skus[0].unit.split('|')
|
||||
this.selectSkusValues = res.skus[0]
|
||||
this.shop_vip = res.shop_vip
|
||||
this.collages = res.active.collages
|
||||
})
|
||||
},
|
||||
open() {
|
||||
@@ -245,8 +260,26 @@
|
||||
},
|
||||
// 去拼单
|
||||
toPin(item) {
|
||||
console.log(item);
|
||||
this.close();
|
||||
this.pinShow = true
|
||||
if(item.can_share){
|
||||
this.share()
|
||||
}else{
|
||||
this.pinShow = true;
|
||||
this.collageitem = item
|
||||
}
|
||||
},
|
||||
// 分享
|
||||
share(){
|
||||
console.log(' 分享。。。')
|
||||
},
|
||||
// 弹出 拼团不可点
|
||||
showPinToast(){
|
||||
uni.showToast({
|
||||
title:this.goods.active.message,
|
||||
icon:'none',
|
||||
mask:true,
|
||||
})
|
||||
},
|
||||
clickSkus(index, id) {
|
||||
this.skuid = ''
|
||||
@@ -279,13 +312,18 @@
|
||||
}
|
||||
this.specselect = newlist
|
||||
},
|
||||
toVip(){
|
||||
uni.navigateTo({
|
||||
url: '/pages/store/vip/index/index?id=' + this.goods.shop.shop_id,
|
||||
})
|
||||
},
|
||||
// 会员商品领取
|
||||
vipBuy() {
|
||||
if (this.shop_vip.is_vip) {
|
||||
if (this.shop_vip.is_receive) {
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '您已经领取过商品想要获得更多新商品,请联系线下商家:' + this.goods.shop.mobile+'进行更换',
|
||||
content: this.shop_vip.alert_text+'请联系线下商家:' + this.goods.shop.mobile,
|
||||
cancelText: '再看看',
|
||||
cancelColor: '#999',
|
||||
showCancel:false,
|
||||
@@ -320,8 +358,7 @@
|
||||
if (res.confirm) {
|
||||
this.close();
|
||||
uni.navigateTo({
|
||||
url: '/pages/store/vip/index/index?id=' + this.goods.shop
|
||||
.shop_id,
|
||||
url: '/pages/store/vip/index/index?id=' + this.goods.shop.shop_id
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -358,12 +395,18 @@
|
||||
}
|
||||
},
|
||||
goUrl() {
|
||||
let params = {
|
||||
skuId: this.skuid,
|
||||
qty: this.qty
|
||||
}
|
||||
if(this.goods.is_active){
|
||||
params.type ='pin';
|
||||
params.collageid = this.collageitem.collage_id || '';
|
||||
}
|
||||
console.log(params)
|
||||
this.$Router.push({
|
||||
name: 'StoreBuy',
|
||||
params: {
|
||||
skuId: this.skuid,
|
||||
qty: this.qty
|
||||
}
|
||||
params:params
|
||||
})
|
||||
this.close()
|
||||
},
|
||||
@@ -375,10 +418,14 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
// 参与别人的拼团
|
||||
applyPin() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/group-book/success/success'
|
||||
})
|
||||
if (this.$store.state.token === '') {
|
||||
const Auth = new userAuth()
|
||||
Auth.Login()
|
||||
return
|
||||
}
|
||||
this.goUrl();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -451,7 +498,7 @@
|
||||
font-size:28rpx;
|
||||
margin-right:10rpx;
|
||||
padding: 2rpx 20rpx;
|
||||
background-color: #ee8000;
|
||||
background-color: #e5c175;
|
||||
border-radius: 20rpx 0 20rpx 0;
|
||||
}
|
||||
.hr {
|
||||
@@ -573,6 +620,54 @@
|
||||
|
||||
}
|
||||
|
||||
.vipInfo {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
background-image: linear-gradient(to right, #38353c, #5f585f);
|
||||
padding: 0 $padding;
|
||||
margin: 0 $margin;
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
position: relative;
|
||||
height: 140rpx;
|
||||
overflow: hidden;
|
||||
|
||||
.title {
|
||||
color: rgba($color: #fff, $alpha: 0.8);
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
flex: 1;
|
||||
|
||||
.des {
|
||||
font-size: 24rpx;
|
||||
color: rgba($color: #fff, $alpha: 0.7);
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
image {
|
||||
width: 500rpx;
|
||||
height: 400rpx;
|
||||
position: absolute;
|
||||
left: 100rpx;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.btn {
|
||||
color: rgba($color: #fff, $alpha: 0.8);
|
||||
background-color: #38353c;
|
||||
opacity: 1 !important;
|
||||
padding: 10rpx 30rpx;
|
||||
border-radius: 20rpx;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.is_active {
|
||||
border-top: solid 20rpx #f9f9f9;
|
||||
|
||||
@@ -634,6 +729,12 @@
|
||||
padding: 6rpx 20rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.noneBtn{
|
||||
border: #999 1rpx solid;
|
||||
color: #999;
|
||||
padding: 6rpx 20rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -805,7 +906,7 @@
|
||||
height: 90rpx;
|
||||
margin: 10rpx 20rpx;
|
||||
border-radius: 50%;
|
||||
|
||||
border:solid 2rpx #f9f9f9;
|
||||
}
|
||||
|
||||
.me {
|
||||
@@ -833,10 +934,11 @@
|
||||
top: 0;
|
||||
left: 0;
|
||||
content: '拼主';
|
||||
border-radius: 20rpx;
|
||||
background: orange;
|
||||
padding: 4rpx 20rpx;
|
||||
font-size: 24rpx;
|
||||
padding: 4rpx 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 20rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
@@ -903,6 +1005,12 @@
|
||||
padding: 6rpx 20rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.noneBtn{
|
||||
border: #999 1rpx solid;
|
||||
color: #999;
|
||||
padding: 6rpx 20rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,6 +92,9 @@
|
||||
|
||||
<!-- goods -->
|
||||
<view class="goods-box">
|
||||
<view class="title2">
|
||||
猜你喜欢 <view class="more"><text class="title-des"> | 您身边的快捷推荐</text> <text class="more-txt" @click="$Router.push({name: 'StoreList'})">更多 ></text></view>
|
||||
</view>
|
||||
<oct-goods :lists="goodsArr" priceType="DT" color="#e6576b"
|
||||
@onGoods="$Router.push({ name: 'StoreGoods', params: {id: $event.goods_id}})" />
|
||||
<!-- <u-loadmore status="loading" /> -->
|
||||
@@ -167,7 +170,7 @@
|
||||
|
||||
// 商城列表
|
||||
.goods-box {
|
||||
padding-bottom: $padding;
|
||||
padding: $padding 0;
|
||||
|
||||
&>.title {
|
||||
padding: $padding $padding 0;
|
||||
@@ -175,8 +178,43 @@
|
||||
color: $text-color;
|
||||
font-weight: bold;
|
||||
margin-bottom: -$margin/2;
|
||||
|
||||
}
|
||||
|
||||
.title2 {
|
||||
font-size: $title-size-lg;
|
||||
color: $text-color;
|
||||
font-weight: bold;
|
||||
padding: 0 30rpx 10rpx 30rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
box-sizing: border-box;
|
||||
|
||||
.title-des {
|
||||
font-size: 24rpx !important;
|
||||
padding-left: 10rpx;
|
||||
color: $text-gray-m;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.more {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
padding-right: $padding;
|
||||
|
||||
.more-txt {
|
||||
font-size: 24rpx;
|
||||
color: $text-gray;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 商城分类
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { lists, classify } from "@/apis/interfaces/store"
|
||||
import { lists, categories } from "@/apis/interfaces/store"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -46,17 +46,21 @@
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.$Route.query.title
|
||||
})
|
||||
if (this.$Route.query.id) {
|
||||
this.cid = this.$Route.query.id
|
||||
} else {
|
||||
this.getClassify();
|
||||
}
|
||||
this.getLists()
|
||||
this.getClassify()
|
||||
},
|
||||
methods:{
|
||||
// 商品列表
|
||||
getLists() {
|
||||
lists({
|
||||
category_id : this.$Route.query.id,
|
||||
category_cid: this.cid,
|
||||
let data = {
|
||||
category_id : this.cid,
|
||||
page : this.page
|
||||
}).then(res => {
|
||||
};
|
||||
lists(data).then(res => {
|
||||
if(res.page.current === 1){
|
||||
this.goodsArr = []
|
||||
}
|
||||
@@ -67,14 +71,15 @@
|
||||
},
|
||||
// 获取二级分类
|
||||
getClassify(){
|
||||
classify(this.$Route.query.id).then(res => {
|
||||
categories().then(res => {
|
||||
this.classify = this.classify.concat(res)
|
||||
})
|
||||
},
|
||||
// 二级分类筛选
|
||||
onTabs(e){
|
||||
this.goodsArr = []
|
||||
this.cid = e.category_id
|
||||
this.page = 1;
|
||||
this.goodsArr = [];
|
||||
this.cid = e.category_id;
|
||||
this.getLists()
|
||||
},
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<view class="groupBook">
|
||||
<view class="top">
|
||||
<view class="title">VIP换购</view>
|
||||
<view>千款商品任意换购</view>
|
||||
<view>百款商品任意换购</view>
|
||||
</view>
|
||||
<!-- 有数据 -->
|
||||
<scroll-view scroll-y="true" class="scroll" @scrolltolower='scrolltolower' v-if="lists.length>0">
|
||||
|
||||
File diff suppressed because one or more lines are too long
684
unpackage/dist/dev/app-plus/app-service.js
vendored
684
unpackage/dist/dev/app-plus/app-service.js
vendored
File diff suppressed because one or more lines are too long
668
unpackage/dist/dev/app-plus/app-view.js
vendored
668
unpackage/dist/dev/app-plus/app-view.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user