拼团:拼团订单详情

pull/37/head
YunaiV 2024-01-13 19:34:27 +08:00
parent 93c721a526
commit 68eb1dceb7
4 changed files with 30 additions and 19 deletions

View File

@ -3,6 +3,7 @@
<s-layout title="拼团详情" class="detail-wrap" :navbar="state.data && !state.loading ? 'inner': 'normal'" :onShareAppMessage="shareInfo"> <s-layout title="拼团详情" class="detail-wrap" :navbar="state.data && !state.loading ? 'inner': 'normal'" :onShareAppMessage="shareInfo">
<view v-if="state.loading"></view> <view v-if="state.loading"></view>
<view v-if="state.data && !state.loading"> <view v-if="state.data && !state.loading">
<!-- 团长信息 + 活动信息 -->
<view <view
class="recharge-box" class="recharge-box"
v-if="state.data.headRecord" v-if="state.data.headRecord"
@ -34,35 +35,40 @@
</template> </template>
</s-goods-item> </s-goods-item>
</view> </view>
<view class="countdown-box detail-card ss-p-t-44 ss-flex-col ss-col-center"> <view class="countdown-box detail-card ss-p-t-44 ss-flex-col ss-col-center">
<view v-if="state.activity.status === 1"> <!-- 情况一拼团成功 -->
<view v-if="state.data.headRecord.status === 1">
<view v-if="state.data.orderId"> <view v-if="state.data.orderId">
<view class="countdown-title ss-flex"> <view class="countdown-title ss-flex">
<text class="cicon-check-round"></text> <text class="cicon-check-round" />
恭喜您~拼团成功 恭喜您~拼团成功
</view> </view>
</view> </view>
<view v-else> <view v-else>
<view class="countdown-title ss-flex"> <view class="countdown-title ss-flex">
<text class="cicon-info"></text> <text class="cicon-info" />
抱歉~该团已满员 抱歉~该团已满员
</view> </view>
</view> </view>
</view> </view>
<view v-if="state.activity.status === 2">
<!-- 情况二拼团失败 -->
<view v-if="state.data.headRecord.status === 2">
<view class="countdown-title ss-flex"> <view class="countdown-title ss-flex">
<text class="cicon-info"></text> <text class="cicon-info"></text>
{{ state.data.orderId ? '拼团超时,已自动退款' : '该团已解散' }} {{ state.data.orderId ? '拼团超时,已自动退款' : '该团已解散' }}
</view> </view>
</view> </view>
<view v-if="state.activity.status === 0">
<!-- 情况三拼团进行中 -->
<view v-if="state.data.headRecord.status === 0">
<view v-if="state.data.headRecord.expireTime <= new Date().getTime()"> <view v-if="state.data.headRecord.expireTime <= new Date().getTime()">
<view class="countdown-title ss-flex"> <view class="countdown-title ss-flex">
<text class="cicon-info"></text> <text class="cicon-info"></text>
拼团已结束,请关注下次活动 拼团已结束,请关注下次活动
</view> </view>
</view> </view>
<view class="countdown-title ss-flex" v-else> <view class="countdown-title ss-flex" v-else>
还差 还差
<view class="num">{{ state.data.headRecord.userSize - state.data.headRecord.userCount }}</view> <view class="num">{{ state.data.headRecord.userSize - state.data.headRecord.userCount }}</view>
@ -81,6 +87,7 @@
</view> </view>
</view> </view>
<!-- 拼团的记录列表展示每个参团人 -->
<view class="ss-m-t-60 ss-flex ss-flex-wrap ss-row-center"> <view class="ss-m-t-60 ss-flex ss-flex-wrap ss-row-center">
<!-- 团长 --> <!-- 团长 -->
<view class="header-avatar ss-m-r-24 ss-m-b-20"> <view class="header-avatar ss-m-r-24 ss-m-b-20">
@ -110,8 +117,10 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 情况一拼团成功情况二拼团失败 -->
<view <view
v-if="state.activity.status === 1 || state.activity.status === 2" v-if="state.data.headRecord.status === 1 || state.data.headRecord.status === 2"
class="ss-m-t-40 ss-flex ss-row-center" class="ss-m-t-40 ss-flex ss-row-center"
> >
<button <button
@ -123,8 +132,9 @@
</button> </button>
<button class="ss-reset-button join-btn" v-else @tap="onCreateGroupon"> </button> <button class="ss-reset-button join-btn" v-else @tap="onCreateGroupon"> </button>
</view> </view>
<!-- 处于进入中时查看订单或参加或邀请好友或参加 -->
<view v-if="state.activity.status === 0" class="ss-m-t-40 ss-flex ss-row-center"> <!-- 情况三拼团进行中查看订单或参加或邀请好友或参加 -->
<view v-if="state.data.headRecord.status === 0" class="ss-m-t-40 ss-flex ss-row-center">
<view v-if="state.data.headRecord.expireTime <= new Date().getTime()"> <view v-if="state.data.headRecord.expireTime <= new Date().getTime()">
<button <button
class="ss-reset-button join-btn" class="ss-reset-button join-btn"
@ -133,7 +143,6 @@
> >
查看订单 查看订单
</button> </button>
<!-- 待确认 -->
<button <button
class="ss-reset-button disabled-btn" class="ss-reset-button disabled-btn"
v-else v-else
@ -165,6 +174,7 @@
</view> </view>
</view> </view>
<!-- TODO 芋艿这里暂时没接入 -->
<view v-if="state.data.goods"> <view v-if="state.data.goods">
<s-select-groupon-sku <s-select-groupon-sku
:show="state.showSelectSku" :show="state.showSelectSku"
@ -177,7 +187,8 @@
/> />
</view> </view>
</view> </view>
<s-empty v-if="!state.data && !state.loading" icon="/static/goods-empty.png"> </s-empty>
<s-empty v-if="!state.data && !state.loading" icon="/static/goods-empty.png" />
</s-layout> </s-layout>
</template> </template>
@ -193,7 +204,7 @@
const headerBg = sheep.$url.css('/static/img/shop/user/withdraw_bg.png'); const headerBg = sheep.$url.css('/static/img/shop/user/withdraw_bg.png');
const statusBarHeight = sheep.$platform.device.statusBarHeight * 2; const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
const state = reactive({ const state = reactive({
data: {}, data: {}, //
loading: true, loading: true,
grouponAction: 'create', grouponAction: 'create',
showSelectSku: false, showSelectSku: false,
@ -233,19 +244,19 @@
}); });
} }
// // TODO
function onCreateGroupon() { function onCreateGroupon() {
state.grouponAction = 'create'; state.grouponAction = 'create';
state.grouponId = 0; state.grouponId = 0;
state.showSelectSku = true; state.showSelectSku = true;
} }
// // TODO
function onSkuChange(e) { function onSkuChange(e) {
state.selectedSkuPrice = e; state.selectedSkuPrice = e;
} }
// // TODO
function onJoinGroupon() { function onJoinGroupon() {
state.grouponAction = 'join'; state.grouponAction = 'join';
state.grouponId = state.data.activityId; state.grouponId = state.data.activityId;
@ -254,7 +265,7 @@
state.showSelectSku = true; state.showSelectSku = true;
} }
// // TODO
function onBuy(sku) { function onBuy(sku) {
sheep.$router.go('/pages/order/confirm', { sheep.$router.go('/pages/order/confirm', {
data: JSON.stringify({ data: JSON.stringify({

View File

@ -18,7 +18,7 @@ const FileApi = {
// Authorization: token, // Authorization: token,
Accept : '*/*', Accept : '*/*',
'tenant-id' :'1', 'tenant-id' :'1',
Authorization: 'Bearer test247', // Authorization: 'Bearer test247',
}, },
success: (uploadFileRes) => { success: (uploadFileRes) => {
debugger debugger

View File

@ -95,7 +95,7 @@ http.interceptors.request.use(
config.header['Accept'] = '*/*' config.header['Accept'] = '*/*'
config.header['tenant-id'] = '1'; config.header['tenant-id'] = '1';
config.header['terminal'] = '20'; config.header['terminal'] = '20';
config.header['Authorization'] = 'Bearer test247'; // config.header['Authorization'] = 'Bearer test247';
} }
return config; return config;
}, },

View File

@ -96,7 +96,7 @@ http.interceptors.request.use(
config.header['Accept'] = '*/*' config.header['Accept'] = '*/*'
config.header['tenant-id'] = '1'; config.header['tenant-id'] = '1';
config.header['terminal'] = '20'; config.header['terminal'] = '20';
config.header['Authorization'] = 'Bearer test247'; // config.header['Authorization'] = 'Bearer test247';
} }
return config; return config;
}, },