vip换购列表更改及部分拼团功能融合

This commit is contained in:
2022-08-18 10:00:28 +08:00
parent 96ae56192c
commit 61f3dd8755
14 changed files with 1629 additions and 793 deletions

View File

@@ -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)
}

View File

@@ -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,
}

View File

@@ -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
}

View File

@@ -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"
}]
}
}
@@ -520,16 +532,16 @@
"style": {
"navigationBarTitleText": "公告详情",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#FFFFFF",
"app-plus": {
"titleNView": {
"buttons": [{
"text": "分享",
"fontSize": "14",
"width": "60px",
"color": "#333"
}]
}
"navigationBarBackgroundColor": "#FFFFFF",
"app-plus": {
"titleNView": {
"buttons": [{
"text": "分享",
"fontSize": "14",
"width": "60px",
"color": "#333"
}]
}
}
}
}, {
@@ -543,40 +555,40 @@
}
,{
"path" : "pages/store/vip/index/index",
"style" :
{
"navigationBarTitleText": "***店铺会员",
"enablePullDownRefresh": false
}
"style" :
{
"navigationBarTitleText": "***店铺会员",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/user/my-card/my-card",
"path" : "pages/user/my-card/my-card",
"name": "MyCard",
"style" :
{
"navigationBarTitleText": "我的卡券",
"enablePullDownRefresh": false
}
"style" :
{
"navigationBarTitleText": "我的卡券",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/group-book/success/success",
"style" :
{
"navigationBarTitleText": "拼单更多",
"enablePullDownRefresh": false
}
"style" :
{
"navigationBarTitleText": "拼单更多",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/store/vip-list/vip-list",
"path" : "pages/store/vip-list/vip-list",
"name": "VipList",
"style" :
{
"navigationBarTitleText": "VIP换购中心",
"enablePullDownRefresh": false
}
"style" :
{
"navigationBarTitleText": "VIP换购中心",
"enablePullDownRefresh": false
}
}
],
"tabBar": {
@@ -617,14 +629,14 @@
"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": ""
}
]
}
}
}

View File

@@ -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('是我的跳转订单详情')
}
}
}
}
@@ -52,7 +106,7 @@
.count-down {
background-color: #f9f9f9;
border-radius: 4rpx;
padding: 10rpx $padding;
padding: 10rpx $padding;
margin-top: $margin;
}
@@ -102,16 +156,16 @@
align-items: center;
justify-content: center;
box-sizing: border-box;
position: relative;
border-bottom: solid 1rpx #999;
position: relative;
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{
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
}
.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>

View File

@@ -6,17 +6,20 @@
</view>
</template>
<script>
<script>
import payKeyboard from '@/components/mi-payKeyboard/mi-payKeyboard.vue'
import eventBus from '../../utils/eventBus.js';
import {
wxPAY,
alPAY,
dtPAY,
collagePAY,
payIndex
} from '@/apis/interfaces/pay'
export default {
components: { payKeyboard },
export default {
components: {
payKeyboard
},
data() {
return {
payNo: "",
@@ -26,8 +29,9 @@
oepnType: '',
canpay: true,
has_transfer_password: true,
password: '',
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();
@@ -109,23 +115,27 @@
}
},
// 输入正确的回调
enterSuccess(password) {
this.password = password
this.showKeyBoard = false
this.getDTPAY();
},
// 点击[取消] 关闭输入框 的回调
close(){
this.showKeyBoard = false;
this.canpay = true;
// 输入正确的回调
enterSuccess(password) {
this.password = password
this.showKeyBoard = false
this.getDTPAY();
},
// 点击[取消] 关闭输入框 的回调
close() {
this.showKeyBoard = false;
this.canpay = true;
},
// 调用 dt 支付
getDTPAY() {
if (this.canpay) {
this.canpay = false
dtPAY(this.payNo, this.password).then(res => {
this.canpay = false
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
},
})
} else {
uni.navigateBack();
}
this.canpay = true
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
})
}, 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
}
})
}
}
}

View File

@@ -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>
@@ -61,8 +61,10 @@
<script>
import {
buy,
verify
buy,
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({ })
}
getBuy() {
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
@@ -129,56 +164,87 @@
return
}
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 {
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
})
})
this.canApply = false;
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',
params: {
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
})
})
}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
}

View File

@@ -9,18 +9,18 @@
</view>
</swiper-item>
</swiper>
<view class="swiper-pages"> {{current}}/{{goods.pictures.length}}</view>
<view class="vipGoodsInfo" v-if="shop_vip.status" >{{shop_vip.message}} </view>
<view class="vipGoodsInfo" v-if="goods.is_active " >拼团商品</view>
<view class="swiper-pages"> {{current}}/{{goods.pictures.length}}</view>
<view class="vipGoodsInfo" v-if="shop_vip.status" >{{shop_vip.message}} </view>
<view class="vipGoodsInfo" v-if="goods.is_active " >拼团商品</view>
</view>
<!-- 详情 -->
<view class="main">
<view class="title"> {{goods.name}} </view>
<view class="sub-title"><span class='vipType' v-if="shop_vip.messageTitle != ''">{{shop_vip.messageTitle}}</span>{{goods.description}}</view>
<view class="box-flex">
<view class="price">
{{goods.price.show}}<text>DT积分</text>
<span class ='del' v-if="shop_vip.status">{{goods.original_price}} DT积分</span>
<view class="price">
{{goods.price.show}}<text>DT积分</text>
<span class ='del' v-if="shop_vip.status">{{goods.original_price}} DT积分</span>
</view>
<view class="sales" v-if="goods.skus && !goods.is_active">库存量{{goods.skus[0].stock}}</view>
<view class="_pin" v-if="goods.is_active">
@@ -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>
@@ -75,7 +91,7 @@
</view>
<!-- 商品详情 -->
<view class="imgs">
<view class="imgs">
<u-notice-bar v-if="shop_vip.status" text="戒指尺寸有大小,请再购买戒指时参照详情介绍备注所选尺寸" fontSize='14' />
<block v-for="(item, index) in goods.content" :key="index">
<image :src="item" mode="widthFix" />
@@ -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,27 +312,32 @@
}
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',
cancelColor: '#999',
showCancel:false,
confirmColor: '#34ce98',
confirmText: ' 知道了',
success: (res) => {
// if (res.confirm) {
// //#ifdef MP-WEIXIN
// uni.makePhoneCall({
// phoneNumber: '18354789632'
// });
// //#endif
// //#ifdef APP-PLUS
// plus.device.dial('18354789632', true);
// if (res.confirm) {
// //#ifdef MP-WEIXIN
// uni.makePhoneCall({
// phoneNumber: '18354789632'
// });
// //#endif
// //#ifdef APP-PLUS
// plus.device.dial('18354789632', true);
// //#endif
// }
}
@@ -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();
}
}
}
@@ -423,17 +470,17 @@
color: white;
font-size: $title-size-m;
text-shadow: 0 5rpx 5rpx rgba($color: #000000, $alpha: .02);
}
.vipGoodsInfo{
position: absolute;
bottom: 0;
left: 0;
z-index: 10;
background-color: #d81e06;
color: #fff;
font-size: 30rpx;
padding: 4rpx 30rpx;
border-radius: 0 0 40rpx 0;
}
.vipGoodsInfo{
position: absolute;
bottom: 0;
left: 0;
z-index: 10;
background-color: #d81e06;
color: #fff;
font-size: 30rpx;
padding: 4rpx 30rpx;
border-radius: 0 0 40rpx 0;
}
}
@@ -446,13 +493,13 @@
border-radius: $radius $radius 0 0;
box-shadow: 0 0 10rpx 10rpx rgba($color: #000000, $alpha: .02);
padding-bottom: ($padding*2) + 90;
.vipType{
color: #fff;
font-size:28rpx;
margin-right:10rpx;
padding: 2rpx 20rpx;
background-color: #ee8000;
border-radius: 20rpx 0 20rpx 0;
.vipType{
color: #fff;
font-size:28rpx;
margin-right:10rpx;
padding: 2rpx 20rpx;
background-color: #e5c175;
border-radius: 20rpx 0 20rpx 0;
}
.hr {
position: relative;
@@ -512,13 +559,13 @@
text {
font-size: 60%;
margin-left: 10rpx;
}
.del{
text-decoration: line-through;
margin-left: 20rpx;
font-size: 26rpx;
color:#999;
font-weight: normal;
}
.del{
text-decoration: line-through;
margin-left: 20rpx;
font-size: 26rpx;
color:#999;
font-weight: normal;
}
}
@@ -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;
}
}
}
}
@@ -1033,5 +1141,5 @@
border: none;
margin-top: $margin;
}
}
</style>
}
</style>

View File

@@ -55,7 +55,7 @@
<view class="tags"> VIP </view>
</view>
<view class="news-title nowrap">{{item.name}}</view>
<view class="news-price nowrap">{{item.price.price_min}} <text>DT积分</text></view>
<view class="news-price nowrap">{{item.price.price_min}} <text>DT积分</text></view>
<!-- <view class="news-price nowrap through">{{item.original_price}} <text>DT积分</text></view> -->
</view>
</view>
@@ -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" /> -->
@@ -112,7 +115,7 @@
newGood: [],
goodsArr: [],
meals: [],
shops: [],
shops: [],
vips:[]
};
},
@@ -127,7 +130,7 @@
this.newGood = res.news
this.goodTabs = res.categories
this.meals = res.meals
this.shops = res.shops
this.shops = res.shops
this.vips = res.vips
uni.stopPullDownRefresh()
})
@@ -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;
}
}
}
}
// 商城分类
@@ -360,16 +398,16 @@
font-size: $title-size-sm;
font-weight: bold;
color: $text-price;
line-height: 40rpx;
line-height: 40rpx;
text {
margin-left: 6rpx;
font-size: 70%;
}
}
.through{
text-decoration: line-through !important;
}
.through{
text-decoration: line-through !important;
}
@@ -505,5 +543,5 @@
}
}
}
</style>
</style>

View File

@@ -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()
},

View File

@@ -2,22 +2,22 @@
<view class="groupBook">
<view class="top">
<view class="title">VIP换购</view>
<view>款商品任意换购</view>
</view>
<view>款商品任意换购</view>
</view>
<!-- 有数据 -->
<scroll-view scroll-y="true" class="scroll" @scrolltolower='scrolltolower' v-if="lists.length>0">
<scroll-view scroll-y="true" class="scroll" @scrolltolower='scrolltolower' v-if="lists.length>0">
<block v-for="(item,index) in lists" :key="index">
<vipGoodsItem :item="item" @goPin="goPin" />
</block>
</scroll-view>
</scroll-view>
<!-- 没数据 -->
<scroll-view scroll-y="true" class="scroll" v-else>
<view class="vertical pages-empty" style="padding-top: 200rpx;">
<u-empty
icon="http://cdn.uviewui.com/uview/empty/list.png"
textColor="#999"
text="暂无VIP商品~"
/>
<view class="vertical pages-empty" style="padding-top: 200rpx;">
<u-empty
icon="http://cdn.uviewui.com/uview/empty/list.png"
textColor="#999"
text="暂无VIP商品~"
/>
</view>
</scroll-view>
</view>
@@ -46,7 +46,7 @@
},
methods: {
getList() {
lists({
lists({
is_user:'1',
page: this.page
}).then(res => {
@@ -59,25 +59,25 @@
mask: true
})
})
},
// 触底获取更多~
scrolltolower() {
if (this.has_more) {
this.page = this.page + 1
this.getList()
}else{
uni.showToast({
title:'没有更多~',
icon:'none'
})
}
},
// 马上拼团
goPin(id) {
console.log('fule gopin....')
uni.navigateTo({
url:'/pages/store/goods?id='+id
})
},
// 触底获取更多~
scrolltolower() {
if (this.has_more) {
this.page = this.page + 1
this.getList()
}else{
uni.showToast({
title:'没有更多~',
icon:'none'
})
}
},
// 马上拼团
goPin(id) {
console.log('fule gopin....')
uni.navigateTo({
url:'/pages/store/goods?id='+id
})
}
}
}
@@ -123,4 +123,4 @@
z-index: 2;
}
}
</style>
</style>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long