删除冗余代码

This commit is contained in:
唐明明
2022-08-29 11:08:37 +08:00
34 changed files with 10591 additions and 4428 deletions

145
App.vue
View File

@@ -1,66 +1,99 @@
<script> <script>
import { getVersions } from './apis/interfaces/versions' import {
getVersions
} from './apis/interfaces/versions'
export default { export default {
onShow() {
// 已经登录过且携带了参数 有弹窗且
setTimeout(() => {
if (uni.getStorageSync('token')) {
if (plus.runtime.arguments.split('?')[1]) {
let shareId = plus.runtime.arguments.split('?')[1].split('invitation')[0]
if (shareId != '' && shareId != undefined) {
uni.showModal({
title: ' 温馨提示',
content: '有人邀请您一起拼团',
cancelColor: '#999',
cancelText: '再想想',
confirmColor: '#34ce98',
confirmText: '立即拼团',
success: (res) => {
uni.hideLoading()
if (res.confirm) {
plus.runtime.arguments = null;
plus.runtime.arguments = '';
uni.navigateTo({
url: '/pages/group-book/success/success?access=1&id=' +
shareId
})
}
}
})
}
}
}
}, 100);
},
onLaunch: function() { onLaunch: function() {
//#ifdef APP-PLUS //#ifdef APP-PLUS
// 获取系统版本号 // 获取系统版本号
getVersions({ // getVersions({
platform: plus.os.name, // platform: plus.os.name,
version : plus.runtime.version // version : plus.runtime.version
}).then(res => { // }).then(res => {
if (res.update) { // if (res.update) {
uni.showModal({ // uni.showModal({
title : "更新提示", // title : "更新提示",
content : res.note || '版本更新信息', // content : res.note || '版本更新信息',
confirmText : "更新", // confirmText : "更新",
showCancel : !res.info.must, // showCancel : !res.info.must,
success : modalRes => { // success : modalRes => {
if (modalRes.confirm) { // if (modalRes.confirm) {
if (plus.os.name == "Android") { // if (plus.os.name == "Android") {
uni.showToast({ // uni.showToast({
title: '新版本下载中,将在下载完成后自动为您安装更新包', // title: '新版本下载中,将在下载完成后自动为您安装更新包',
icon: 'none' // icon: 'none'
}) // })
uni.downloadFile({ // uni.downloadFile({
url: res.info.download, // url: res.info.download,
success: apkPick => { // success: apkPick => {
plus.runtime.install(apkPick // plus.runtime.install(apkPick
.tempFilePath, '', // .tempFilePath, '',
installRES => { // installRES => {
// 安装完成用于提示新版本引导,暂时无用 // // 安装完成用于提示新版本引导,暂时无用
}, installERR => { // }, installERR => {
// 安装失败 // // 安装失败
}) // })
}, // },
fail(err) { // fail(err) {
uni.showToast({ // uni.showToast({
title: '安装包下载失败,请检查您的网络或稍后重试', // title: '安装包下载失败,请检查您的网络或稍后重试',
icon: 'none' // icon: 'none'
}) // })
} // }
}) // })
// plus.runtime.openURL(res.info.download, err => { // // plus.runtime.openURL(res.info.download, err => {
// console.log(err) // // console.log(err)
// }, 'com.android.browser'); // // }, 'com.android.browser');
} else { // } else {
uni.showToast({ // uni.showToast({
title: 'IOS应用暂未上架请打开测试(TestFlight)工具点击更新', // title: 'IOS应用暂未上架请打开测试(TestFlight)工具点击更新',
icon: 'none' // icon: 'none'
}) // })
} // }
} // }
} // }
}) // })
} // }
}).catch(err => { // }).catch(err => {
uni.showToast({ // uni.showToast({
title: err.message, // title: err.message,
icon: 'none' // icon: 'none'
}) // })
}) // })
//#endif //#endif
} },
} }
</script> </script>

View File

@@ -17,6 +17,24 @@ const pinList = (data) => {
}) })
} }
export { // 我的拼团列表
pinList const myPinList = (data) => {
return request({
url: 'mall/collages',
data:data
})
}
// 根据拼团 id 获取拼团详情
const myPinDetail = (id) => {
return request({
url: 'mall/collages/'+id,
})
}
export {
pinList,
myPinList,
myPinDetail
} }

View File

@@ -0,0 +1,327 @@
<template>
<view>
<view class="order--content" :class="[pattern ? 'chunk': 'broad']">
<view class="order--group--header" @click="$emit('onBtn', {type: 'shopsDetail', order: orderInfo})">
<image class="logo" v-if="orderInfo.shop.cover != ''" :src="orderInfo.shop.cover" mode="aspectFill">
</image>
<view class="store">
{{orderInfo.shop.name}}
<uni-icons type="right" size="16" color="#666" />
</view>
<view class="stateText" :style="{color: stateColor}">
{{orderInfo.collage.status_text}}
</view>
</view>
<view class="order--header">
<view class="order--no">
订单号{{orderInfo.no}}
</view>
</view>
<view class="order--flex" @click="$emit('onBtn', {type: 'goodsDetail', order: orderInfo})">
<image class="order--cover" :src="orderInfo.cover" mode="aspectFill"></image>
<view class="order--title">
{{orderInfo.name}}
<view class="unit"> {{orderInfo.unit}} </view>
</view>
<view class="order--count">
<view class="order--price">{{orderInfo.price}}<text>DT积分</text></view>
<view class="order--sum">{{orderInfo.sum}} </view>
</view>
</view>
<slot name="btns">
<view class="flexrow">
<view class="">
<u-avatar-group :random-bg-color="true" :urls="orderInfo.users" size="26" gap="0.4"
class="avatar-group" />
</view>
<view class="order--btns">
<view v-if="orderInfo.collage.status =='3'" class="item item--sign"
@click="$emit('onBtn', {type: 'share', order: orderInfo})">
分享拼团
</view>
<view class="item item--cancel" @click="$emit('onBtn', {type: 'goInfo', order: orderInfo})">
查看详情
</view>
</view>
</view>
</slot>
</view>
</view>
</template>
<script>
export default {
props: {
// 订单样式否为块
pattern: {
type: Boolean,
default: true
},
// 店铺模式
stores: {
type: Boolean,
default: false
},
// 订单信息
orderInfo: {
type: Object,
default: () => {
return {
cover: "",
name: "",
price: "",
sum: 1,
collage: {},
users: [],
invite: '',
order: {},
}
}
},
// 状态标签颜色
stateColor: {
type: String,
default: "#FF6160"
},
// 可操作按钮组
orderBtns: {
type: Array,
default: () => {
return [{
text: "订单详情",
type: "info"
}, {
text: "删除订单",
type: "delete",
style: {
color: "#FF6160"
}
}]
}
}
}
}
</script>
<style scoped lang="scss">
$margin: 30rpx;
$radius: 10rpx;
.text-nowrap {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.text-ellipsis {
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.order--content {
background: white;
&.chunk {
margin: $margin $margin;
border-radius: $radius;
padding: $margin;
}
&.broad {
padding: $margin;
border-bottom: solid 1rpx #ddd;
}
.order--header {
display: flex;
justify-content: space-between;
padding-bottom: $margin;
border-top: solid 1rpx #f9f9f9;
align-items: center;
&>.order--no {
flex: 1;
margin-right: $margin;
font-size: 26rpx;
line-height: 40rpx;
color: #555;
@extend .text-nowrap;
padding-top: 10rpx;
}
&>.stateText {
font-size: 26rpx;
color: $text-price;
}
}
.order--flex {
display: flex;
align-items: center;
.order--cover {
vertical-align: top;
width: 128rpx;
height: 128rpx;
}
.order--title {
@extend .text-ellipsis;
text-align: left;
flex: 1;
padding-left: $margin;
font-size: 28rpx;
line-height: 40rpx;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
box-sizing: border-box;
.unit {
color: #999;
font-size: 26rpx;
padding-top: 10rpx;
}
}
.order--count {
text-align: right;
padding-left: $margin;
line-height: 40rpx;
// color: $text-price;
.order--price {
font-size: 30rpx;
font-weight: bold;
&>text {
font-size: 24rpx;
font-weight: normal;
padding-left: 10rpx;
}
}
.order--sum {
font-size: 26rpx;
color: #777;
}
}
}
.order--group {
.order--group--header {
padding-bottom: $margin;
display: flex;
justify-content: space-between;
align-items: center;
&>.logo {
width: 38rpx;
height: 38rpx;
vertical-align: middle;
margin-right: $margin/2;
}
&>.store {
@extend .text-nowrap;
flex: 1;
margin-right: $margin;
font-size: 28rpx;
line-height: 40rpx;
color: #555;
}
&>.stateText {
font-size: 26rpx;
}
}
.order--group--flex {
@extend .order--flex;
margin-bottom: $margin - 10;
&:last-child {
margin: 0;
}
}
}
.order--group--header {
padding-bottom: $margin;
display: flex;
justify-content: space-between;
align-items: center;
&>.logo {
width: 38rpx;
height: 38rpx;
vertical-align: middle;
margin-right: $margin/2;
}
&>.store {
@extend .text-nowrap;
flex: 1;
margin-right: $margin;
font-size: 28rpx;
line-height: 40rpx;
color: #555;
}
&>.stateText {
font-size: 26rpx;
}
}
.order--group--flex {
@extend .order--flex;
margin-bottom: $margin - 10;
&:last-child {
margin: 0;
}
}
.flexrow {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding-top: $margin - 10;
border-top: solid 1rpx #f9f9f9;
margin-top: $margin - 10;
}
.order--btns {
display: flex;
justify-content: flex-end;
// padding-top: $margin - 10;
&>.item {
font-size: 26rpx;
margin-left: $margin/2;
color: #333;
line-height: 56rpx;
border: solid 1rpx #ddd;
padding: 0 ($margin - 10);
border-radius: 28rpx;
&--cancel,
&--delete,
&--logistic {
color: #666;
}
&--pay,
&--sign {
color: #34CE98;
border-color: #34CE98;
}
}
}
}
</style>

View File

@@ -12,6 +12,9 @@
<view class="money">{{item.active.price}} <span>DT积分</span> </view> <view class="money">{{item.active.price}} <span>DT积分</span> </view>
<view class="now-pin" @click="goPin(item.goods_id)">马上拼团</view> <view class="now-pin" @click="goPin(item.goods_id)">马上拼团</view>
</view> </view>
<view class="pin">
</view>
</view> </view>
</view> </view>
</template> </template>
@@ -44,6 +47,18 @@
border-radius: 10rpx; border-radius: 10rpx;
padding: $padding; padding: $padding;
margin-bottom: 20rpx; margin-bottom: 20rpx;
position: relative;
.pin{
position: absolute;
background-color: #22aa98;
border-radius:0 0 30rpx 0;
padding: 2rpx 30rpx 2rpx 30rpx;
color: #fff;
left: 0;
top: 0;
font-size: 28rpx;
font-weight: bold;
}
.goods-cover { .goods-cover {
width: 160rpx; width: 160rpx;
@@ -55,6 +70,7 @@
width: calc(100% - 160rpx - 30rpx); width: calc(100% - 160rpx - 30rpx);
padding-left: $padding; padding-left: $padding;
._title { ._title {
overflow: hidden; overflow: hidden;
font-size: 30rpx; font-size: 30rpx;

View File

@@ -2,7 +2,7 @@
"name" : "共力生态", "name" : "共力生态",
"appid" : "__UNI__DE7B0E6", "appid" : "__UNI__DE7B0E6",
"description" : "共力生态", "description" : "共力生态",
"versionName" : "1.0.43", "versionName" : "1.0.44",
"versionCode" : 100, "versionCode" : 100,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
@@ -67,7 +67,8 @@
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>", "<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\"/>"
], ],
"autoSdkPermissions" : true "autoSdkPermissions" : true,
"schemes" : "glst,gonglishengtai,gldao"
}, },
/* ios */ /* ios */
"ios" : { "ios" : {
@@ -151,7 +152,10 @@
"androidStyle" : "common" "androidStyle" : "common"
} }
}, },
"nativePlugins" : {} "nativePlugins" : {},
"uniStatistics" : {
"enable" : true
}
}, },
/* */ /* */
"quickapp" : {}, "quickapp" : {},
@@ -161,19 +165,53 @@
"setting" : { "setting" : {
"urlCheck" : false "urlCheck" : false
}, },
"usingComponents" : true "usingComponents" : true,
"uniStatistics" : {
"enable" : true
}
}, },
"mp-alipay" : { "mp-alipay" : {
"usingComponents" : true "usingComponents" : true,
"uniStatistics" : {
"enable" : true
}
}, },
"mp-baidu" : { "mp-baidu" : {
"usingComponents" : true "usingComponents" : true,
"uniStatistics" : {
"enable" : true
}
}, },
"mp-toutiao" : { "mp-toutiao" : {
"usingComponents" : true "usingComponents" : true,
"uniStatistics" : {
"enable" : true
}
}, },
"uniStatistics" : { "uniStatistics" : {
"enable" : false "enable" : true
}, },
"vueVersion" : "2" "vueVersion" : "2",
"h5" : {
"uniStatistics" : {
"enable" : true
}
},
"mp-kuaishou" : {
"uniStatistics" : {
"enable" : true
}
},
"mp-lark" : {
"uniStatistics" : {
"enable" : true
}
},
"mp-qq" : {
"uniStatistics" : {
"enable" : true
}
},
"fallbackLocale" : "zh-Hans",
"locale" : "auto"
} }

View File

@@ -3,7 +3,7 @@ const version = '2.0.31'
// 开发环境才提示,生产环境不会提示 // 开发环境才提示,生产环境不会提示
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
console.log(`\n %c uView V${version} %c https://www.uviewui.com/ \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0;', 'color: #3c9cff;background: #ffffff; padding:5px 0;'); // console.log(`\n %c uView V${version} %c https://www.uviewui.com/ \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0;', 'color: #3c9cff;background: #ffffff; padding:5px 0;');
} }
export default { export default {

View File

@@ -552,43 +552,51 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }, {
,{ "path": "pages/store/vip/index/index",
"path" : "pages/store/vip/index/index", "style": {
"style" :
{
"navigationBarTitleText": "***店铺会员", "navigationBarTitleText": "***店铺会员",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }, {
,{ "path": "pages/user/my-card/my-card",
"path" : "pages/user/my-card/my-card",
"name": "MyCard", "name": "MyCard",
"style" : "style": {
{
"navigationBarTitleText": "我的卡券", "navigationBarTitleText": "我的卡券",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }, {
,{ "path": "pages/group-book/success/success",
"path" : "pages/group-book/success/success", "style": {
"style" :
{
"navigationBarTitleText": "拼单更多", "navigationBarTitleText": "拼单更多",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
} }, {
,{ "path": "pages/store/vip-list/vip-list",
"path" : "pages/store/vip-list/vip-list",
"name": "VipList", "name": "VipList",
"style" : "style": {
{
"navigationBarTitleText": "VIP换购中心", "navigationBarTitleText": "VIP换购中心",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, {
"path": "pages/group-book/list/list",
"name":"PinList",
"style": {
"navigationBarTitleText": "拼团列表 ",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/group-book/detail/detail",
"style" :
{
"navigationBarTitleText": "拼团详情",
"enablePullDownRefresh": false
}
} }
], ],
"tabBar": { "tabBar": {
@@ -629,14 +637,12 @@
"easycom": { "easycom": {
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue" "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
}, },
"condition" : { "condition": {
"current": 0, "current": 0,
"list": [ "list": [{
{
"name": "", "name": "",
"path": "", "path": "",
"query": "" "query": ""
} }]
]
} }
} }

View File

@@ -39,19 +39,28 @@
export default { export default {
data() { data() {
return { return {
phone : '', phone: '',
code : '', code: '',
parentId : '', parentId: '', // 父类邀请码
getSms : false, getSms: false,
sendCode : '获取验证码', sendCode: '获取验证码',
isShowParent: false, isShowParent: false,
isKeyAuth : false isKeyAuth: false,
shareId: ''
}; };
}, },
onShow () { onShow() {
setTimeout(() => {
if (plus.runtime.arguments.split('?')[1]) {
let args = plus.runtime.arguments.split('?')[1]
this.shareId = args.split('invitation')[0]
this.parentId = args.split('invitation')[1]
}
}, 100);
uni.showLoading({ uni.showLoading({
title: '加载中...', title: '加载中...',
mask : true mask: true
}) })
// 预登录 // 预登录
uni.preLogin({ uni.preLogin({
@@ -68,8 +77,8 @@
// 获取验证码 // 获取验证码
getPhoneCode() { getPhoneCode() {
uni.showLoading({ uni.showLoading({
title : '加载中...', title: '加载中...',
mask :true mask: true
}) })
let outTime; let outTime;
let smsTime = 60; let smsTime = 60;
@@ -107,9 +116,9 @@
title: '登录中' title: '登录中'
}) })
smsAuth({ smsAuth({
mobileNo : this.phone, mobileNo: this.phone,
code : this.code, code: this.code,
parent_id : this.parentId parent_id: this.parentId
}).then((res) => { }).then((res) => {
this.setAuthToken(res.token_type + ' ' + res.access_token, res.is_new) this.setAuthToken(res.token_type + ' ' + res.access_token, res.is_new)
uni.hideLoading() uni.hideLoading()
@@ -126,10 +135,10 @@
} }
}, },
// 一键登录 // 一键登录
onKeyLogin(){ onKeyLogin() {
uni.login({ uni.login({
provider:'univerify', provider: 'univerify',
univerifyStyle:{ univerifyStyle: {
icon: { icon: {
path: require('@/static/logo.png') path: require('@/static/logo.png')
}, },
@@ -148,18 +157,22 @@
} }
}, },
success: Result => { success: Result => {
if(Result.errMsg === 'login:ok'){ if (Result.errMsg === 'login:ok') {
let {access_token, openid} = Result.authResult let {
access_token,
openid
} = Result.authResult
keyAuth({ keyAuth({
access_token, access_token,
openid openid
}).then(res => { }).then(res => {
this.setAuthToken(res.token_type + ' ' + res.access_token, res.is_new) this.setAuthToken(res.token_type + ' ' + res.access_token, res
.is_new)
uni.closeAuthView() uni.closeAuthView()
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: '登录失败:' + err.message, title: '登录失败:' + err.message,
icon : 'none' icon: 'none'
}) })
uni.closeAuthView() uni.closeAuthView()
}) })
@@ -171,15 +184,33 @@
}) })
}, },
// setToken // setToken
setAuthToken(token, isNew){ setAuthToken(token, isNew) {
this.$store.commit('setToken', token); this.$store.commit('setToken', token);
if(isNew){ if (isNew) {
uni.setStorageSync('isnew', 0) uni.setStorageSync('isnew', 0)
this.$Router.replace({name: 'AuthRole'}) this.$Router.replace({
name: 'AuthRole',
params: {
shareId: this.shareId
}
})
return return
} }
uni.setStorageSync('isnew', 1) uni.setStorageSync('isnew', 1)
this.$Router.pushTab({name: 'Life'}) if (this.shareId != '' && this.shareId != undefined) {
setTimeout(() => {
uni.hideLoading()
plus.runtime.arguments = null;
plus.runtime.arguments = '';
uni.reLaunch({
url: '/pages/group-book/success/success?access=1&id=' + this.shareId
})
}, 1000)
} else {
this.$Router.pushTab({
name: 'Life'
})
}
} }
} }
} }

View File

@@ -71,7 +71,19 @@
storage_id : this.storageId storage_id : this.storageId
}).then(res => { }).then(res => {
uni.setStorageSync('isnew', 1) uni.setStorageSync('isnew', 1)
if(this.$Route.query.shareId!='' && this.$Route.query.shareId != undefined){
setTimeout(() => {
uni.hideLoading()
plus.runtime.arguments = null;
plus.runtime.arguments = '';
uni.reLaunch({
url: '/pages/group-book/success/success?access=1&id=' + this.$Route.query.shareId
})
}, 1000)
}else{
this.$Router.pushTab({name: 'Life'}) this.$Router.pushTab({name: 'Life'})
}
uni.setStorageSync('isnew', 1)
}).catch(err => { }).catch(err => {
this.disabled = false this.disabled = false
uni.showToast({ uni.showToast({

BIN
pages/group-book/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,416 @@
<template>
<view class="pin-detail">
<view class="goods">
<image class="cover" :src="goods.cover" mode="aspectFill" />
<view class="info">
<view class="title">{{goods.name}} </view>
<view class="subtitle">
<view class="hasPined" v-if="collage.sale>0">
<image src="/static/store/fire.png" mode="widthFix" />已拼{{collage.sale}}
</view>
<view class="tuan">{{collage.number}}人团</view>
</view>
<view class="price">
<view class="now">{{goods.price}}<span>DT积分</span></view>
<view class="old"> {{goods.cost}}积分 </view>
</view>
</view>
</view>
<view class="pin">
<view class="title">
<block v-if="collage.down>0 && collage.status == 3">
<u-count-down :time="collage.down" format="DD:HH:mm:ss" autoStart millisecond @change="onChange">
&nbsp; </u-count-down>
距离结束<span>{{ timeData.days }}</span>&nbsp;
<span>{{ timeData.hours>10?timeData.hours:'0'+timeData.hours}}&nbsp;</span>小时<span>{{ timeData.minutes }}&nbsp;</span>分钟<span>{{ timeData.seconds }}&nbsp;</span>
</block>
<block v-if="collage.status != 3">
<span>{{collage.status_text}}</span>
</block>
</view>
<view class="avatars">
<block>
<image v-for="(item,index) in users" :key='index+1' :class="['avatar',item.master?'pin':''] " :src="item" mode="aspectFill" />
</block>
<block v-if="collage.surplus>0">
<image v-for="(item,index) in collage.surplus" :key='index+2' class="wen" src="/static/book/wen.png" mode="aspectFill" />
</block>
</view>
<view class="title" v-if="collage.sale>0">已拼<span>{{collage.sale}}</span></view>
<view class="progress">
{{collage.number - collage.surplus}}
<u-line-progress activeColor="#34ce98" class="line" :percentage="collage.score" :showText="false" />
{{collage.number}}
</view>
</view>
<view class="warn" v-if="collage.status == 3 || collage.status == 2">完成支付后需在24小时内邀请好友参加拼团否则拼团失败自动退款</view>
<view class="order" v-if="orderDetail.order_no != ''">
<view class="title">订单详情</view>
<view class="order-item">
<view class="order-item-title">订单编号</view>
<view class="order-item-detail">{{orderDetail.order_no}}</view>
</view>
<view class="order-item">
<view class="order-item-title">下单时间</view>
<view class="order-item-detail">{{orderDetail.created_at}}</view>
</view>
<view class="order-item">
<view class="order-item-title">支付时间</view>
<view class="order-item-detail">{{orderDetail.paid_at}}</view>
</view>
<view class="order-item" v-if="collage.status == 1&& express.deliver_at">
<view class="order-item-title">发货时间</view>
<view class="order-item-detail">{{ express.deliver_at || '--'}}</view>
</view>
<view class="order-item" v-if="collage.status == 1 && express.receive_at">
<view class="order-item-title">签收时间</view>
<view class="order-item-detail">{{ express.receive_at || '--'}}</view>
</view>
<view class="order-item">
<view class="order-item-title">支付方式</view>
<view class="order-item-detail">DT支付</view>
</view>
<view class="order-item">
<view class="order-item-title">备注信息</view>
<view class="order-item-detail">{{orderDetail.remark || '--'}}</view>
</view>
</view>
<view class="btn" v-if="collage.status == 1 && can">
<view v-if="can.logistic_show" @click="onBtn('logistic')" class="btn-item"> 查看物流 </view>
<view v-if="can.sign" @click="onBtn('sign')" class="btn-item success"> 确认签收 </view>
</view>
</view>
</template>
<script>
import {
myPinDetail
} from '@/apis/interfaces/pin.js'
import { sign } from '@/apis/interfaces/order'
export default {
data() {
return {
orderDetail: {},
goods: {},
collage: {},
users: [],
timeData: {},
express: {},
can: {}
};
},
onLoad() {
this.getInfo()
},
methods: {
getInfo(){
myPinDetail(this.$Route.query.id).then(res => {
this.orderDetail = res.order_detail;
this.goods = res.item;
let collage = res.collage;
collage.score = 100
this.collage = collage;
this.users = res.users;
this.express = res.order_detail.express;
this.can = res.order_detail.can;
}).catch(err => {
uni.showToast({
title: err.message,
icon: "none",
mask: true,
duration: 3000
})
})
},
onChange(e) {
this.timeData = e
},
onBtn(type) {
switch (type) {
case 'logistic':
this.$Router.push({
name: 'OrderLogistics',
params: {
orderNo: this.orderDetail.order_no,
},
});
break;
case 'sign':
uni.showModal({
title: '温馨提示',
content: '是否确认收到货物并签收该订单',
confirmText: '确认签收',
confirmColor: "#34CE98",
cancelText: '再想想',
cancelColor: "#666666",
success: (res) => {
if (res.confirm) {
sign(this.orderDetail.order_no).then(res => {
this.getInfo();
return;
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
}
}
});
break;
}
}
}
}
</script>
<style lang="scss">
.pin-detail {
background-color: $window-color;
min-height: 100vh;
position: relative;
.goods {
padding: $padding;
border-top: solid 20rpx #f9f9f9;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
background-color: #fff;
.cover {
width: 200rpx;
height: 200rpx;
border-radius: 10rpx;
}
.info {
flex: 1;
margin-left: 20rpx;
font-size: 32rpx;
.title {
font-size: 32rpx;
color: #454545;
}
.subtitle {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
color: #999;
font-size: 26rpx;
margin-top: 20rpx;
.hasPined {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
color: #d81e06;
background-color: rgba(255, 0, 0, .1);
padding: 4rpx 24rpx;
border-radius: 30rpx;
image {
width: 34rpx;
height: 34rpx;
margin: 6rpx;
}
}
.tuan {
margin-left: 20rpx;
}
}
.price {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
margin-top: 20rpx;
margin-left: 10rpx;
.now {
font-size: 38rpx;
font-weight: bold;
color: #d81e06;
span {
font-weight: normal;
font-size: 24rpx;
padding-left: 4rpx;
}
}
.old {
font-weight: normal;
font-size: 26rpx;
color: #999;
margin-left: 30rpx;
text-decoration: line-through;
padding-top: 16rpx;
}
}
}
}
.pin {
margin-top: $margin - 10;
background-color: #fff;
padding: $padding;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
.title {
font-size: 30rpx;
color: #454545;
span {
color: #d81e06;
font-size: 36rpx;
font-weight: bold;
padding: 0 6rpx;
}
}
.progress {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
color: #454545;
font-size: 28rpx;
margin-top: $margin*2 - 20;
.line {
flex: 1;
margin: 0 $margin - 10;
}
}
.avatars {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
position: relative;
margin-top: $margin;
image {
width: 100rpx;
height: 100rpx;
// padding: 20rpx;
border-radius: 50%;
margin: 10rpx 20rpx;
border: solid 2rpx #f9f9f9;
}
.pin {
position: relative;
&::after {
position: absolute;
top: 0;
left: 0;
content: '拼主';
background: orange;
padding: 4rpx 0;
font-size: 20rpx;
width: 100%;
text-align: center;
color: #fff;
}
}
}
}
.warn {
text-align: center;
padding: $padding - 10 $padding + 20;
color: grey;
font-size: 26rpx;
}
.order {
background-color: #fff;
padding: $padding;
margin-top: 20rpx;
padding-bottom: 150rpx;
.title {
font-size: 32rpx;
color: #454545;
font-weight: bold;
border-bottom: solid 1rpx #f9f9f9;
padding-bottom: 20rpx;
}
.order-item {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
;
box-sizing: border-box;
color: #454545;
padding: $padding 0;
border-bottom: solid 1rpx #f9f9f9;
.order-item-title {
font-size: 30rpx;
}
.order-item-detail {
font-size: 30rpx;
}
}
}
.btn {
position: fixed;
bottom: 0;
background-color: #fff;
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
box-sizing: border-box;
padding: 0 $padding + 20 $padding $padding + 20;
.btn-item {
font-size: 26rpx;
margin-left: $margin/2;
color: #333;
line-height: 56rpx;
border: solid 1rpx #ddd;
padding: 0 ($margin - 10);
border-radius: 28rpx;
display: inline-block;
margin-top: $margin;
}
.success {
color: #34CE98;
border-color: #34CE98;
}
}
}
</style>

View File

@@ -0,0 +1,215 @@
<template>
<view class="content">
<!-- tabs -->
<u-sticky>
<u-tabs class="tabs" :list="tabs" :scrollable="false" :current="index" lineColor="#34CE98" @click="onTabs"
sticky />
</u-sticky>
<block v-if="array.length >= 1">
<!-- 订单列表 -->
<orderPin v-for="(item, arrayIndex) in array" :key="arrayIndex" :order-info="item" @onBtn="onType" />
<!-- 加载更多 -->
<view class="pages-load">
<u-loadmore :status="status" />
</view>
</block>
<block v-else>
<view class="vertical order-null">
<u-empty mode="order" icon="http://cdn.uviewui.com/uview/empty/order.png" text="暂无相关订单"
textColor="#999" />
</view>
</block>
<!-- 分享 -->
<uni-popup ref="popupShare" type="share" background-color="#fff">
<uni-popup-share title="立即分享到" @select="select" />
</uni-popup>
</view>
</template>
<script>
import {
orders,
del,
cancel,
sign
} from '@/apis/interfaces/order'
import {
myPinList
} from '@/apis/interfaces/pin'
import eventBus from '../../../utils/eventBus.js';
import orderPin from '@/components/oct-order-pin/index.vue'
export default {
components: {
orderPin
},
data() {
return {
status: "loading",
tabs: [{
name: "全部",
type: "",
},
{
name: "拼团中",
type: "3",
},
{
name: "拼团成功",
type: "1",
},
{
name: "拼团失败",
type: "2",
}
],
index: '0',
array: [],
page: 1,
shareInfo: {},
};
},
onLoad() {
this.getOrder()
},
onShow() {
if (this.$store.getters.getRefresh == 1) {
this.$store.commit('setRefresh', 0)
this.array = []
this.page = 1
this.getOrder()
}
},
methods: {
getOrder() {
myPinList({
state: this.tabs[this.index].type,
page: this.page
}).then(res => {
console.log(res)
if (res.page.current === 1) {
this.array = []
}
let ordersArr = res.data.map(val => {
return {
no: val.order_no,
cover: val.item.cover,
name: val.item.name,
price: val.item.price,
sum: 1,
collage: val.collage,
shop: val.shop,
goods_id: val.item.goods_id,
unit: val.item.unit,
users: val.users,
invite: val.invite,
order: val.order,
url: val.url
}
})
this.array = this.array.concat(ordersArr)
this.status = res.page.has_more ? 'loadmore' : 'nomore'
})
},
onTabs(e) {
this.page = 1
this.index = e.index
this.getOrder()
},
onType(e) {
let orderNo = e.order.no;
let shopId = e.order.shop.shop_id;
let goodsId = e.order.goods_id;
switch (e.type) {
case 'share':
this.shareInfo = e.order
this.$refs.popupShare.open();
console.log('触发分享', this.shareInfo)
break;
case 'goInfo':
uni.navigateTo({
url:'/pages/group-book/detail/detail?id='+e.order.no
})
break;
}
},
// 分享选项
select(e) {
console.log(this.shareInfo.url + this.shareInfo.collage.collage_id + 'invitation' + this
.shareInfo.invite, this.shareInfo.collage.surplus, this.shareInfo.cover, this.shareInfo.name)
switch (e.item.name) {
case 'wxchum':
uni.share({
provider: 'weixin',
scene: 'WXSceneSession',
type: 0,
href: this.shareInfo.url + this.shareInfo.collage.collage_id + 'invitation' + this
.shareInfo.invite,
title: '【仅剩' + this.shareInfo.collage.surplus + '个名额】邀请您一起拼团',
summary: '好货不用一分钱,点点就能带回家【 ' + this.shareInfo.name + '】',
imageUrl: this.shareInfo.cover,
fail: (err) => {
uni.showToast({
title: err.errMsg,
icon: 'none'
})
},
success: (res) => {
this.shareInfo = {}
}
})
break;
case 'wxcircle':
uni.share({
provider: 'weixin',
scene: 'WXSceneTimeline',
type: 0,
href: this.shareInfo.url + this.shareInfo.collage.collage_id + 'invitation' + this
.shareInfo.invite,
summary: '好货不用一分钱,点点就能带回家【 ' + this.shareInfo.name + '】',
imageUrl: this.shareInfo.cover,
fail: (err) => {
uni.showToast({
title: err.errMsg,
icon: 'none'
})
},
success: (res) => {
this.shareInfo = {}
}
})
break;
}
},
},
onReachBottom() {
if (this.status === 'loadmore') {
this.page += 1
this.status = 'loading'
this.getOrder()
}
}
}
</script>
<style lang="scss">
.content {
background: $window-color;
min-height: 100vh;
}
.tabs {
background: white;
}
// 数据列表空
.order-null {
height: 80vh;
}
// 加载分页
.pages-load {
padding-bottom: $padding;
}
</style>

View File

@@ -1,17 +1,22 @@
<template> <template>
<view class="pinSuccess"> <view class="pinSuccess">
<view class="count-down"> <view class="count-down" v-if="downTime>0">
<u-count-down ref="countDown" :time="downTime" format="HH:mm:ss" :autoStart="true" millisecond/> <u-count-down ref="countDown" :time="downTime" format="HH:mm:ss" :autoStart="true" millisecond />
</view> </view>
<view class="title"> 还差 <span>{{surplus}}</span> 赶紧邀请好友来拼单吧 </view> <view class="title" v-if="surplus>0"> 还差 <span>{{surplus}}</span> 赶紧邀请好友来拼单吧 </view>
<view class="btn invite"> 邀请好友拼单 </view> <block v-if="share.status == 3">
<view class="btn invite" v-if="!share.can_share " @click="onTake"> 参与该拼单 </view>
<view class="btn invite" v-if="share.can_share" @click="onShare"> 邀请好友拼单 </view>
</block>
<view class="btn index" @click="goIndex"> 去首页逛逛</view> <view class="btn index" @click="goIndex"> 去首页逛逛</view>
<view class="goodInfo"> <view class="goodInfo">
<view class="avatars"> <view class="avatars">
<block v-for="(item,index) in details" :key='index'> <block >
<image class="avatar pin" :src="item.cover" mode="aspectFill" /> <image v-for="(item,index) in details" :key='index+1' :class="['avatar',item.master?'pin':''] " :src="item.cover" mode="aspectFill" />
</block>
<block v-if="surplus>0">
<image v-for="(item,index) in surplus" :key='index+2' class="wen" src="/static/book/wen.png" mode="aspectFill" />
</block> </block>
<image class="wen" src="/static/book/wen.png" mode="aspectFill" />
</view> </view>
<block> <block>
<view class="orderInfo"> <view class="orderInfo">
@@ -22,13 +27,17 @@
</view> </view>
</view> </view>
<view class="orderInfo"> <view class="orderInfo">
<view class="left"> 拼单规则 </view> <view class="left">拼单规则</view>
<view class="right"> <view class="right">
<view class="right-title">人满发货 · 人不满退款 · 只能拼一次 </view> <view class="right-title">人满发货 · 人不满退款 · 只能拼一次 </view>
</view> </view>
</view> </view>
</block> </block>
</view> </view>
<!-- 分享 -->
<uni-popup ref="popupShare" type="share" background-color="#fff">
<uni-popup-share title="立即分享到" @select="select" />
</uni-popup>
</view> </view>
</template> </template>
@@ -42,17 +51,24 @@
goodName: '', goodName: '',
details: [], details: [],
downTime: 0, downTime: 0,
surplus: 1, surplus: 0,
order: {}, // order 是{} 标识不是我的订单,否则就是我的订单可以跳转订单详情 goods: {}, // order 是{} 标识不是我的订单,否则就是我的订单可以跳转订单详情
share:{},
access: '0', // 参与别人的1 自己的分享的0 后来想想这个接口作用不大了 ~ 闹挺 ~ 所以这个字段暂时不用,用后端返回的新字段来区分是自己的拼单还是别人的拼单;
}; };
}, },
onLoad() { onLoad() {
repages(this.$Route.query.id).then(res => { this.access = this.$Route.query.access
this.order = res.order repages(this.$Route.query.id,{invite:this.invite}).then(res => {
this.goodName = res.order.goods.name this.share = res.share
this.downTime = res.share.down * 1000 this.goods = res.goods
this.goodName = res.goods.name
this.surplus = res.share.surplus this.surplus = res.share.surplus
this.details = res.share.details this.details = res.share.details
this.downTime = res.share.down * 1000
uni.setNavigationBarTitle({
title:res.share.status_text
})
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
@@ -64,7 +80,7 @@
}, },
onHide() { onHide() {
try { try {
if(this.$refs.countDown){ if (this.$refs.countDown) {
this.$refs.countDown.pause() this.$refs.countDown.pause()
} }
} catch (err) { } catch (err) {
@@ -75,20 +91,68 @@
} }
}, },
methods: { methods: {
// 参与拼单
onTake(){
console.log()
uni.navigateTo({
url: '/pages/store/goods?id=' + this.goods.goods_id+'&shareId='+this.share.collage_id ,// shareId 代表当前商品详情下面拼单有带 id
})
},
// 分享
onShare() {
this.$refs.popupShare.open();
},
// 分享选项
select(e) {
switch (e.item.name) {
case 'wxchum':
uni.share({
provider: 'weixin',
scene: 'WXSceneSession',
type: 0,
href: this.share.url + this.share.collage_id+'invitation'+this.share.invite.invite,
title: '【仅剩' + this.surplus +'个名额】邀请您一起拼团',
summary: '好货不用一分钱,点点就能带回家【 ' + this.goods.name + '】',
imageUrl: this.goods.cover,
fail(err) {
uni.showToast({
title: err.errMsg,
icon: 'none'
})
}
})
break;
case 'wxcircle':
uni.share({
provider: 'weixin',
scene: 'WXSceneTimeline',
type: 0,
href: this.share.url + this.share.collage_id+'invitation'+this.share.invite.invite,
summary: '好货不用一分钱,点点就能带回家【 ' + this.goods.name + '】',
imageUrl: this.goods.cover,
fail(err) {
uni.showToast({
title: err.errMsg,
icon: 'none'
})
}
})
break;
}
},
// 返回首页
goIndex() { goIndex() {
uni.reLaunch({ uni.reLaunch({
url: '/pages/store/index' url: '/pages/store/index'
}) })
}, },
goDetail(){ // 商品详情
if(!this.order.order_no){ goDetail() {
console.log('不是我的跳商品详情')
uni.navigateTo({ uni.navigateTo({
url:'/pages/store/goods?id='+this.order.goods.goods_id url: '/pages/store/goods?id=' + this.goods.goods_id
}) })
}else{
console.log('是我的跳转订单详情')
}
} }
} }
} }
@@ -210,7 +274,7 @@
justify-content: space-between; justify-content: space-between;
box-sizing: border-box; box-sizing: border-box;
padding: 30rpx 0; padding: 30rpx 0;
font-size: 26rpx; font-size: 28rpx;
color: #666; color: #666;
border-bottom: solid 1rpx #f9f9f9; border-bottom: solid 1rpx #f9f9f9;

View File

@@ -197,7 +197,9 @@
cancelColor: "#666666", cancelColor: "#666666",
success: (res) => { success: (res) => {
if(res.confirm){ if(res.confirm){
console.log('挑战到我的拼单列表') uni.navigateTo({
url:'/pages/group-book/list/list'
})
} if(res.cancel){ } if(res.cancel){
uni.navigateTo({ uni.navigateTo({
url:'/pages/store/index' url:'/pages/store/index'

BIN
pages/store/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -3,7 +3,7 @@
<!-- 产品封面 --> <!-- 产品封面 -->
<view class="goods-swiper"> <view class="goods-swiper">
<swiper :indicator-dots="false" @change="current = $event.detail.current + 1"> <swiper :indicator-dots="false" @change="current = $event.detail.current + 1">
<swiper-item v-for="(item, index) in goods.pictures" :key="index"> <swiper-item v-for="(item, index) in goods.pictures" :key="index+1">
<view class="swiper-cover"> <view class="swiper-cover">
<image :src="item" mode="aspectFill" /> <image :src="item" mode="aspectFill" />
</view> </view>
@@ -11,22 +11,23 @@
</swiper> </swiper>
<view class="swiper-pages"> {{current}}/{{goods.pictures.length}}</view> <view class="swiper-pages"> {{current}}/{{goods.pictures.length}}</view>
<!-- vip 商品提示 --> <!-- vip 商品提示 -->
<view class="vipGoodsInfo" v-if="shop_vip.status" >{{shop_vip.message}} </view> <view class="vipGoodsInfo" v-if="shop_vip.status">{{shop_vip.message}} </view>
<!-- 拼团 商品标题上面提示 --> <!-- 拼团 商品标题上面提示 -->
<view class="vipGoodsInfo" v-if="goods.is_active " >拼团商品</view> <view class="vipGoodsInfo" v-if="goods.is_active ">拼团商品</view>
</view> </view>
<!-- 详情 --> <!-- 详情 -->
<view class="main"> <view class="main">
<view class="title"> {{goods.name}} </view> <view class="title"> {{goods.name}} </view>
<view class="sub-title"> <view class="sub-title">
<!-- vip 商品前边 tags --> <!-- vip 商品前边 tags -->
<span class='vipType' v-if="shop_vip.messageTitle != ''">{{shop_vip.messageTitle}}</span>{{goods.description}} <span class='vipType'
v-if="shop_vip.messageTitle != ''">{{shop_vip.messageTitle}}</span>{{goods.description}}
</view> </view>
<view class="box-flex"> <view class="box-flex">
<!-- vip 商品展示原价 --> <!-- vip 商品展示原价 -->
<view class="price"> <view class="price">
{{goods.price.show}}<text>DT积分</text> {{goods.price.show}}<text>DT积分</text>
<span class ='del' v-if="shop_vip.status">{{goods.original_price}} DT积分</span> <span class='del' v-if="shop_vip.status">{{goods.original_price}} DT积分</span>
</view> </view>
<!-- vip 商品及普通商品展示库存量 --> <!-- vip 商品及普通商品展示库存量 -->
<view class="sales" v-if="goods.skus && !goods.is_active">库存量{{goods.skus[0].stock}}</view> <view class="sales" v-if="goods.skus && !goods.is_active">库存量{{goods.skus[0].stock}}</view>
@@ -59,7 +60,7 @@
</view> </view>
<!-- 可拼团列表 --> <!-- 可拼团列表 -->
<view class="is_active" v-if="goods.is_active && collages.length>0"> <view class="is_active" v-if="goods.is_active && collages.length>0 && shareId == ''">
<view class="title" v-if="collages.length > 2"> <view class="title" v-if="collages.length > 2">
这些人刚刚拼单成功可参与拼单 这些人刚刚拼单成功可参与拼单
<span @click="getMorePin = true">查看更多 <span @click="getMorePin = true">查看更多
@@ -74,7 +75,8 @@
<u-avatar-group :urls="item.covers" size="34" gap="0.6" class="avatar-group" /> <u-avatar-group :urls="item.covers" size="34" gap="0.6" class="avatar-group" />
<view class="nickname"> {{item.names}}</view> <view class="nickname"> {{item.names}}</view>
</view> </view>
<view class="btn" v-if="goods.active.can_join || item.can_share" @click="toPin(item)">{{ item.can_share?'去分享':'去拼单'}}</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 class="noneBtn" v-else @click="showPinToast">去拼单</view>
</view> </view>
</block> </block>
@@ -100,7 +102,7 @@
<!-- 商品详情 --> <!-- 商品详情 -->
<view class="imgs"> <view class="imgs">
<u-notice-bar v-if="shop_vip.status" text="戒指尺寸有大小,请购买戒指时参照详情介绍,备注所选尺寸" fontSize='14' /> <u-notice-bar v-if="shop_vip.status" text="戒指尺寸有大小,请购买戒指时参照详情介绍备注所选尺寸" fontSize='14' />
<block v-for="(item, index) in goods.content" :key="index"> <block v-for="(item, index) in goods.content" :key="index">
<image :src="item" mode="widthFix" /> <image :src="item" mode="widthFix" />
</block> </block>
@@ -109,7 +111,9 @@
<!-- 立即购买 shop_vip.status 区分是否是 vip 商品 否则的就却分是拼团商品还是普通商品 --> <!-- 立即购买 shop_vip.status 区分是否是 vip 商品 否则的就却分是拼团商品还是普通商品 -->
<view class="footer"> <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 规格弹窗立即领取 --> <!-- vip 规格弹窗立即领取 -->
<button type="default" v-if="shop_vip.status" hover-class="none" @click="vipBuy">立即领取</button> <button type="default" v-if="shop_vip.status" hover-class="none" @click="vipBuy">立即领取</button>
<!-- 非vip 规格弹窗 普通商品立即购买拼单商品立即拼单 --> <!-- 非vip 规格弹窗 普通商品立即购买拼单商品立即拼单 -->
@@ -132,7 +136,8 @@
<u-avatar-group :urls="item.covers" size="34" gap="0.6" class="avatar-group" /> <u-avatar-group :urls="item.covers" size="34" gap="0.6" class="avatar-group" />
<view class="nickname"> {{item.names}}</view> <view class="nickname"> {{item.names}}</view>
</view> </view>
<view class="btn" v-if="goods.active.can_join || item.can_share" @click="toPin(item)">{{ item.can_share?'去分享':'去拼单'}}</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 class="noneBtn" v-else @click="showPinToast">去拼单</view>
</view> </view>
</block> </block>
@@ -145,7 +150,7 @@
<view scroll-y="true" class="content-2"> <view scroll-y="true" class="content-2">
<view class="title"> 参与{{collageitem.names}}的拼单 </view> <view class="title"> 参与{{collageitem.names}}的拼单 </view>
<view class="number">仅剩<span>{{collageitem.surplus}}</span>个名额</view> <view class="number">仅剩<span>{{collageitem.surplus}}</span>个名额</view>
<view class="avatars" v-for="(item,index) in collageitem.details" :key='index' > <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="['avatar',item.master?'pin':'']" :src="item.cover" mode="aspectFill" />
<image class="wen" src="/static/book/wen.png" mode="aspectFill" /> <image class="wen" src="/static/book/wen.png" mode="aspectFill" />
</view> </view>
@@ -171,7 +176,8 @@
<view class="sku-title">{{item.name}}</view> <view class="sku-title">{{item.name}}</view>
<view class="sku-list"> <view class="sku-list">
<block v-for="it in item.values" :key='it.value_id'> <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)"> <view :class="['sku-item',specselect[index] == it.value_id ? 'sku-active':'']"
@click="clickSkus(index,it.value_id)">
{{it.value}} {{it.value}}
</view> </view>
</block> </block>
@@ -180,7 +186,8 @@
<view class="buy-number"> <view class="buy-number">
<view class="buy-title">数量</view> <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> </view>
<!-- 立即购买 shop_vip.status 区分是否是 vip 商品 只支持单规格php 规定不支持多规格 否则的就却分是拼团商品还是普通商品 --> <!-- 立即购买 shop_vip.status 区分是否是 vip 商品 只支持单规格php 规定不支持多规格 否则的就却分是拼团商品还是普通商品 -->
@@ -189,10 +196,16 @@
@click="vipBuy">立即领取</button> @click="vipBuy">立即领取</button>
<!-- 非vip 规格弹窗 普通商品立即购买拼单商品立即拼单 --> <!-- 非vip 规格弹窗 普通商品立即购买拼单商品立即拼单 -->
<block v-else> <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> </block>
</scroll-view> </scroll-view>
</u-popup> </u-popup>
<!-- 分享 -->
<uni-popup ref="popupShare" type="share" background-color="#fff">
<uni-popup-share title="立即分享到" @select="select" />
</uni-popup>
</view> </view>
</template> </template>
@@ -231,11 +244,16 @@
// "is_receive": false // 当前会员是否已领取过 false 未领取 true 已领取 // "is_receive": false // 当前会员是否已领取过 false 未领取 true 已领取
}, },
// collageid:'' ,// 拼团 id // collageid:'' ,// 拼团 id
collageitem:'',// 已选择的拼团的 item collageitem: '', // 已选择的拼团的 item
shareId: '', // 从分享页带过来的 id 区分是否能展示可拼团列表及底部按钮直接拼!
}; };
}, },
onShow() { onShow() {
this.getGoods() this.getGoods()
if (this.$Route.query.shareId) {
this.shareId = this.$Route.query.shareId;
console.log(this.shareId)
}
}, },
methods: { methods: {
getGoods() { getGoods() {
@@ -268,25 +286,75 @@
}, },
// 去拼单 // 去拼单
toPin(item) { toPin(item) {
console.log(item);
this.close(); this.close();
if(item.can_share){
this.share()
}else{
this.pinShow = true;
this.collageitem = item this.collageitem = item
if (item.can_share) {
this.share(item)
} else {
this.pinShow = true;
} }
}, },
// 分享 // 分享
share(){ share() {
console.log(' 分享。。。') this.$refs.popupShare.open();
}, },
// 弹出 拼团不可点 // 分享
showPinToast(){ onShare() {},
// 分享选项
select(e) {
console.log(this.collageitem)
switch (e.item.name) {
case 'wxchum':
uni.share({
provider: 'weixin',
scene: 'WXSceneSession',
type: 0,
href: this.collageitem.url + this.collageitem.collage_id + 'invitation' + this
.collageitem.invite,
title: '【仅剩' + this.collageitem.surplus + '个名额】邀请您一起拼团',
summary: '好货不用一分钱,点点就能带回家【 ' + this.goods.name + '】',
imageUrl: this.goods.cover,
fail: (err) => {
uni.showToast({ uni.showToast({
title:this.goods.active.message, title: err.errMsg,
icon:'none', icon: 'none'
mask:true, })
},
success: (res) => {
this.collageitem = {}
}
})
break;
case 'wxcircle':
uni.share({
provider: 'weixin',
scene: 'WXSceneTimeline',
type: 0,
href: this.collageitem.url + this.collageitem.collage_id + 'invitation' + this
.collageitem.invite,
summary: '好货不用一分钱,点点就能带回家【 ' + this.goods.name + '】',
imageUrl: this.goods.cover,
fail: (err) => {
uni.showToast({
title: err.errMsg,
icon: 'none'
})
},
success: (res) => {
this.collageitem = {}
}
})
break;
}
},
// 弹出 拼团不可点
showPinToast() {
uni.showToast({
title: this.goods.active.message,
icon: 'none',
mask: true,
}) })
}, },
clickSkus(index, id) { clickSkus(index, id) {
@@ -331,10 +399,10 @@
if (this.shop_vip.is_receive) { if (this.shop_vip.is_receive) {
uni.showModal({ uni.showModal({
title: '温馨提示', title: '温馨提示',
content: this.shop_vip.alert_text+'请联系线下商家:' + this.goods.shop.mobile, content: this.shop_vip.alert_text + '请联系线下商家:' + this.goods.shop.mobile,
cancelText: '再看看', cancelText: '再看看',
cancelColor: '#999', cancelColor: '#999',
showCancel:false, showCancel: false,
confirmColor: '#34ce98', confirmColor: '#34ce98',
confirmText: ' 知道了', confirmText: ' 知道了',
success: (res) => { success: (res) => {
@@ -366,7 +434,8 @@
if (res.confirm) { if (res.confirm) {
this.close(); this.close();
uni.navigateTo({ 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
}) })
} }
} }
@@ -407,14 +476,17 @@
skuId: this.skuid, skuId: this.skuid,
qty: this.qty qty: this.qty
} }
if(this.goods.is_active){ if (this.goods.is_active) {
params.type ='pin'; params.type = 'pin';
params.collageid = this.collageitem.collage_id || ''; params.collageid = this.collageitem.collage_id || '';
} }
if (this.shareId != '') {
params.collageid = this.shareId || '';
}
console.log(params) console.log(params)
this.$Router.push({ this.$Router.push({
name: 'StoreBuy', name: 'StoreBuy',
params:params params: params
}) })
this.close() this.close()
}, },
@@ -479,7 +551,8 @@
font-size: $title-size-m; font-size: $title-size-m;
text-shadow: 0 5rpx 5rpx rgba($color: #000000, $alpha: .02); text-shadow: 0 5rpx 5rpx rgba($color: #000000, $alpha: .02);
} }
.vipGoodsInfo{
.vipGoodsInfo {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0;
@@ -501,14 +574,16 @@
border-radius: $radius $radius 0 0; border-radius: $radius $radius 0 0;
box-shadow: 0 0 10rpx 10rpx rgba($color: #000000, $alpha: .02); box-shadow: 0 0 10rpx 10rpx rgba($color: #000000, $alpha: .02);
padding-bottom: ($padding*2) + 90; padding-bottom: ($padding*2) + 90;
.vipType{
.vipType {
color: #fff; color: #fff;
font-size:28rpx; font-size: 28rpx;
margin-right:10rpx; margin-right: 10rpx;
padding: 2rpx 20rpx; padding: 2rpx 20rpx;
background-color: #e5c175; background-color: #e5c175;
border-radius: 20rpx 0 20rpx 0; border-radius: 20rpx 0 20rpx 0;
} }
.hr { .hr {
position: relative; position: relative;
min-height: 1rpx; min-height: 1rpx;
@@ -568,11 +643,12 @@
font-size: 60%; font-size: 60%;
margin-left: 10rpx; margin-left: 10rpx;
} }
.del{
.del {
text-decoration: line-through; text-decoration: line-through;
margin-left: 20rpx; margin-left: 20rpx;
font-size: 26rpx; font-size: 26rpx;
color:#999; color: #999;
font-weight: normal; font-weight: normal;
} }
} }
@@ -737,7 +813,8 @@
padding: 6rpx 20rpx; padding: 6rpx 20rpx;
border-radius: 10rpx; border-radius: 10rpx;
} }
.noneBtn{
.noneBtn {
border: #999 1rpx solid; border: #999 1rpx solid;
color: #999; color: #999;
padding: 6rpx 20rpx; padding: 6rpx 20rpx;
@@ -914,7 +991,7 @@
height: 90rpx; height: 90rpx;
margin: 10rpx 20rpx; margin: 10rpx 20rpx;
border-radius: 50%; border-radius: 50%;
border:solid 2rpx #f9f9f9; border: solid 2rpx #f9f9f9;
} }
.me { .me {
@@ -1013,7 +1090,8 @@
padding: 6rpx 20rpx; padding: 6rpx 20rpx;
border-radius: 10rpx; border-radius: 10rpx;
} }
.noneBtn{
.noneBtn {
border: #999 1rpx solid; border: #999 1rpx solid;
color: #999; color: #999;
padding: 6rpx 20rpx; padding: 6rpx 20rpx;

View File

@@ -27,6 +27,11 @@
</view> </view>
</u-scroll-list> </u-scroll-list>
<!-- 拼团广告图 -->
<view class="collage" v-if="collage_banner!=''">
<image @click="goCollage" :src="collage_banner" mode="widthFix" />
</view>
<!-- 每日上新 --> <!-- 每日上新 -->
<view class="new-box"> <view class="new-box">
<view class="title">上新精选<text class="title-des"> | 精品上新新品推荐</text></view> <view class="title">上新精选<text class="title-des"> | 精品上新新品推荐</text></view>
@@ -44,7 +49,7 @@
<!-- VIP换购 --> <!-- VIP换购 -->
<view class="new-box" style="margin-top: 30rpx;" v-if="vips.length>0"> <view class="new-box" style="margin-top: 30rpx;" v-if="vips.length>0">
<view class="title">VIP换购 <view class="more"><text class="title-des"> | 款商品任意换购</text> <text <view class="title">VIP换购 <view class="more"><text class="title-des"> | 款商品任意换购</text> <text
class="more-txt" @click="$Router.push({name: 'VipList'})">更多 ></text></view> class="more-txt" @click="$Router.push({name: 'VipList'})">更多 ></text></view>
</view> </view>
<view class="news"> <view class="news">
@@ -116,7 +121,8 @@
goodsArr: [], goodsArr: [],
meals: [], meals: [],
shops: [], shops: [],
vips:[] vips:[],
collage_banner:''
}; };
}, },
mounted() { mounted() {
@@ -132,11 +138,16 @@
this.meals = res.meals this.meals = res.meals
this.shops = res.shops this.shops = res.shops
this.vips = res.vips this.vips = res.vips
this.collage_banner = res.collage_banner
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
}) })
}, },
goCollage(){
uni.navigateTo({
url:'/pages/group-book/index'
})
},
goBook(item) { goBook(item) {
console.log(item)
if (item.url) { if (item.url) {
if (item.url.openType === 'navigateTo') { if (item.url.openType === 'navigateTo') {
if (item.url.params != '') { if (item.url.params != '') {
@@ -303,6 +314,14 @@
background: #c9ead9; background: #c9ead9;
} }
} }
// 全民拼团
.collage{
box-sizing: border-box;
image{
width: 100%;
height: 0;
}
}
// 上新精选 // 上新精选
.new-box { .new-box {

View File

@@ -114,6 +114,10 @@
</block> </block>
</view> </view>
<view class="btns-box"> <view class="btns-box">
<view class="btns-box-item" @click="onBtn('PinList', {})">
<image class="icon" src="@/static/user/userIcon_15.png" mode="widthFix" />
我的拼单 <uni-icons class="forward" type="forward" color="#999" />
</view>
<view class="btns-box-item" @click="onBtn('MyCard', {})"> <view class="btns-box-item" @click="onBtn('MyCard', {})">
<image class="icon" src="@/static/user/userIcon_00.png" mode="widthFix" /> <image class="icon" src="@/static/user/userIcon_00.png" mode="widthFix" />
我的卡券 <uni-icons class="forward" type="forward" color="#999" /> 我的卡券 <uni-icons class="forward" type="forward" color="#999" />

BIN
static/store/fire.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
static/user/userIcon_15.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

View File

@@ -0,0 +1,297 @@
<template>
<view>
<view class="order--content" :class="[pattern ? 'chunk': 'broad']">
<block v-if="!stores">
<view class="order--group--header" @click="$emit('onBtn', {type: 'shopsDetail', order: orderInfo})">
<image class="logo" v-if="orderInfo.shop.cover != ''" :src="orderInfo.shop.cover" mode="aspectFill"></image>
<view class="store">
{{orderInfo.shop.name}} <uni-icons type="right" size="16" color="#666" />
</view>
<view class="stateText" :style="{color: stateColor}">
{{orderInfo.stateText}}
</view>
</view>
<view class="order--header">
<view class="order--no">
订单号{{orderInfo.no}}
</view>
</view>
<view class="order--flex" @click="$emit('onBtn', {type: 'goodsDetail', order: orderInfo})">
<image class="order--cover" :src="orderInfo.cover" mode="aspectFill"></image>
<view class="order--title">
{{orderInfo.name}}
<view class="unit"> {{orderInfo.unit}} </view>
</view>
<view class="order--count">
<view class="order--price">{{orderInfo.price}}<text>DT积分</text></view>
<view class="order--sum">{{orderInfo.sum}} </view>
</view>
</view>
</block>
<block v-else>
<view class="order--group">
<view class="order--group--header">
<image class="logo" v-if="orderInfo.store.logo != ''" :src="orderInfo.store.logo" mode="aspectFill"></image>
<view class="store">
{{orderInfo.store.name}}
</view>
<view class="stateText" :style="{color: stateColor}">
{{orderInfo.stateText}}
</view>
</view>
<view class="order--group--flex" v-for="(storeItem, storeGood) in orderInfo.storesGoods" :key="storeGood">
<image class="order--cover" :src="storeItem.cover" mode="aspectFill"></image>
<view class="order--title">{{storeItem.name}}</view>
<view class="order--count">
<view class="order--price">{{storeItem.price}}<text>DT积分</text></view>
<view class="order--sum"> X {{storeItem.sum}} </view>
</view>
</view>
</view>
</block>
<slot name="btns" v-if="orderInfo.cans">
<view class="order--btns">
<view v-show="orderInfo.cans.cancel" class="item item--cancel" @click="$emit('onBtn', {type: 'cancel', order: orderInfo})">取消订单</view>
<view v-show="orderInfo.cans.refund_money" class="item item--cancel" @click="$emit('onBtn', {type: 'refundMoney', order: orderInfo})">申请退款</view>
<view v-show="orderInfo.cans.refund" class="item item--cancel" @click="$emit('onBtn', {type: 'refund', order: orderInfo})">申请售后</view>
<view v-show="orderInfo.cans.delete" class="item item--delete" @click="$emit('onBtn', {type: 'delete', order: orderInfo})">删除订单</view>
<view v-show="orderInfo.cans.logistic_show" class="item item--logistic" @click="$emit('onBtn', {type: 'logistic', order: orderInfo})">查看物流</view>
<view v-show="orderInfo.cans.pay" class="item item--pay" @click="$emit('onBtn', {type: 'pay', order: orderInfo})">立即支付</view>
<view v-show="orderInfo.cans.sign" class="item item--sign" @click="$emit('onBtn', {type: 'sign', order: orderInfo})">确认签收</view>
</view>
</slot>
</view>
</view>
</template>
<script>
export default{
props:{
// 订单样式否为块
pattern: {
type: Boolean,
default: true
},
// 店铺模式
stores: {
type: Boolean,
default: false
},
// 订单信息
orderInfo: {
type: Object,
default: () => {
return {
cover : "",
name : "",
price : "",
sum : 1,
stateText : ""
}
}
},
// 状态标签颜色
stateColor: {
type : String,
default : "#FF6160"
},
// 可操作按钮组
orderBtns: {
type : Array,
default : () => {
return [
{
text: "订单详情",
type: "info"
},{
text : "删除订单",
type : "delete",
style: { color: "#FF6160" }
}
]
}
}
}
}
</script>
<style scoped lang="scss">
$margin: 30rpx;
$radius: 10rpx;
.text-nowrap {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.text-ellipsis{
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.order--content{
background: white;
&.chunk{
margin: $margin $margin;
border-radius: $radius;
padding: $margin;
}
&.broad{
padding: $margin;
border-bottom: solid 1rpx #ddd;
}
.order--header{
display: flex;
justify-content: space-between;
padding-bottom: $margin;
border-top: solid 1rpx #f9f9f9;
align-items: center;
& > .order--no{
flex: 1;
margin-right: $margin;
font-size: 26rpx;
line-height: 40rpx;
color: #555;
@extend .text-nowrap;
padding-top: 10rpx;
}
&> .stateText{
font-size: 26rpx;
color: $text-price;
}
}
.order--flex{
display: flex;
align-items: center;
.order--cover{
vertical-align: top;
width: 128rpx;
height: 128rpx;
}
.order--title{
@extend .text-ellipsis;
text-align: left;
flex: 1;
padding-left: $margin;
font-size: 28rpx;
line-height: 40rpx;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
box-sizing: border-box;
.unit{
color: #999;
font-size: 26rpx;
padding-top: 10rpx;
}
}
.order--count{
text-align: right;
padding-left: $margin;
line-height: 40rpx;
// color: $text-price;
.order--price{
font-size: 30rpx;
font-weight: bold;
&>text{
font-size: 24rpx;
font-weight: normal;
padding-left: 10rpx;
}
}
.order--sum{
font-size: 26rpx;
color: #777;
}
}
}
.order--group{
.order--group--header{
padding-bottom: $margin;
display: flex;
justify-content: space-between;
align-items: center;
&> .logo{
width: 38rpx;
height: 38rpx;
vertical-align: middle;
margin-right: $margin/2;
}
&> .store{
@extend .text-nowrap;
flex: 1;
margin-right: $margin;
font-size: 28rpx;
line-height: 40rpx;
color: #555;
}
&> .stateText{
font-size: 26rpx;
}
}
.order--group--flex{
@extend .order--flex;
margin-bottom: $margin - 10;
&:last-child{
margin: 0;
}
}
}
.order--group--header{
padding-bottom: $margin;
display: flex;
justify-content: space-between;
align-items: center;
&> .logo{
width: 38rpx;
height: 38rpx;
vertical-align: middle;
margin-right: $margin/2;
}
&> .store{
@extend .text-nowrap;
flex: 1;
margin-right: $margin;
font-size: 28rpx;
line-height: 40rpx;
color: #555;
}
&> .stateText{
font-size: 26rpx;
}
}
.order--group--flex{
@extend .order--flex;
margin-bottom: $margin - 10;
&:last-child{
margin: 0;
}
}
.order--btns{
display: flex;
justify-content: flex-end;
padding-top: $margin - 10;
&> .item{
font-size: 26rpx;
margin-left: $margin/2;
color: #333;
line-height: 56rpx;
border: solid 1rpx #ddd;
padding: 0 ($margin - 10);
border-radius: 28rpx;
&--cancel,
&--delete,
&--logistic{
color: #666;
}
&--pay,
&--sign{
color: #34CE98;
border-color: #34CE98;
}
}
}
}
</style>

View File

@@ -0,0 +1,80 @@
{
"id": "oct-order",
"displayName": "oct-order",
"version": "1.0.0",
"description": "oct-order",
"keywords": [
"oct-order"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "",
"data": "",
"permissions": ""
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "u",
"aliyun": "u"
},
"client": {
"Vue": {
"vue2": "u",
"vue3": "u"
},
"App": {
"app-vue": "u",
"app-nvue": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "u",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}

View File

@@ -0,0 +1 @@
# 订单列表

Binary file not shown.

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

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

File diff suppressed because one or more lines are too long