Pārlūkot izejas kodu

拼团分享判断修改

tags/富茂链客4.1.0
刘晖 pirms 6 gadiem
vecāks
revīzija
f743011dad
6 mainītis faili ar 118 papildinājumiem un 61 dzēšanām
  1. +8
    -7
      pages/joinFrDpell/index.js
  2. +37
    -4
      pages/spellDetail/index.js
  3. +27
    -38
      pages/spellDetail/index.wxml
  4. +3
    -2
      pages/spellDetail/index.wxss
  5. +39
    -6
      pages/spellGroup/spellGroup.js
  6. +4
    -4
      pages/spellGroup/spellGroup.wxml

+ 8
- 7
pages/joinFrDpell/index.js Parādīt failu

@@ -32,25 +32,26 @@ Page({
orderGroupId: options.orderGroupId,
orderId:options.orderId
})
this.checkUser();
this.getDetail(options.couponChannelId);
this.getOneSpell(options.couponId)
this.checkUser(options);
},
/**
* 判断用户是否已经在团中
*/
checkUser(){
checkUser(options){
let that = this;
Http.get({
url: config.api.queryAttendStatus,
data: {
id: this.data.orderGroupId,
id: options.orderGroupId,
}
}).then(res => {
if (res.data==true) {
if (res.data.attend == true || res.data.status!=10) {
wx.redirectTo({
url: `/pages/spellDetail/index?orderId=${this.data.orderId}&couponId=${this.data.couponId}&orderGroupId=${this.data.orderGroupId}&couponChannelId=${this.data.couponChannelId}`,
url: `/pages/spellDetail/index?orderId=${options.orderId}&couponId=${options.couponId}&orderGroupId=${options.orderGroupId}&couponChannelId=${options.couponChannelId}`,
})
}else{
that.getDetail(that.data.couponChannelId);
that.getOneSpell(that.data.couponId)
}
});
},


+ 37
- 4
pages/spellDetail/index.js Parādīt failu

@@ -19,21 +19,55 @@ Page({
hour: "00",
min: "00",
sec: "00",
spellStatusList: spellStatus
spellStatusList: spellStatus,
isMyself:false
},
gotoAgain(){
let data = this.data.data;
wx.navigateTo({
url: `/pages/spellGroup/mySpellGroup/index?couponId=${data.couponId}&couponChannelId=${data.couponChannelId}`,
})
},
gotoshare(){
wx.navigateTo({
url: `/pages/spellGroup/mySpellGroup/index?orderId=${this.data.paramData.orderId}&couponId=${this.data.paramData.couponId}&orderGroupId=${this.data.paramData.orderGroupId}&couponChannelId=${this.data.paramData.couponChannelId}`,
})
},
gotoSearch(){
wx.navigateTo({
url: `/pages/spellGroup/spellGroup`,
})
},

/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(this.data.spellStatusList,7777777)
console.log(this.data.spellStatusList, options,7777777)
this.setData({
paramData:options
})
this.getDetail(options);
this.checkUser(options)
// 关闭来自于左上角的分享
wx.hideShareMenu()
},
/**
* 判断用户是否已经在团中
*/
checkUser(options) {
let that = this;
Http.get({
url: config.api.queryAttendStatus,
data: {
id: options.orderGroupId,
}
}).then(res => {
console.log(res.data,3333333333)
that.setData({
isMyself: res.data.attend
})
});
},
/**
* 去使用
*/
@@ -166,7 +200,6 @@ Page({
onReachBottom: function () {

},

/**
* 用户点击右上角分享
*/


+ 27
- 38
pages/spellDetail/index.wxml Parādīt failu

@@ -1,16 +1,16 @@
<!--pages/spellDetail/index.wxml-->
<view class='container'>
<!-- 拼团状态-拼团中,拼团成功 -->
<view class='status'>
<view class='status' wx:if="{{isMyself==true}}">
<view class='status-top'>
<view class='p-status'>{{data.statustext}}</view>
<view class='p-text' wx:if='{{data.status!=11}}'>结束</view>
<view class='p-time' wx:if='{{data.status!=11}}'>{{sec}}</view>
<view class='p-mao' wx:if='{{data.status!=11}}'>:</view>
<view class='p-time' wx:if='{{data.status!=11}}'>{{min}}</view>
<view class='p-mao' wx:if='{{data.status!=11}}'>:</view>
<view class='p-time' wx:if='{{data.status!=11}}'>{{hour}}</view>
<view class='p-text' wx:if='{{data.status!=11}}'>剩余</view>
<view class='p-text' wx:if='{{data.status==10}}'>结束</view>
<view class='p-time' wx:if='{{data.status==10}}'>{{sec}}</view>
<view class='p-mao' wx:if='{{data.status==10}}'>:</view>
<view class='p-time' wx:if='{{data.status==10}}'>{{min}}</view>
<view class='p-mao' wx:if='{{data.status==10}}'>:</view>
<view class='p-time' wx:if='{{data.status==10}}'>{{hour}}</view>
<view class='p-text' wx:if='{{data.status==10}}'>剩余</view>
</view>
<view class='status-center'>
<view class='status-lists'>
@@ -60,55 +60,43 @@
<view class='detail-p-name'>拼团价</view>
</view>
</view>
<view class='detail-bottom'>
<view class='detail-bottom' wx:if="{{isMyself==true}}">
<view class='b-unit'>元</view>
<view class='b-price'>{{data.salePrice}}</view>
<view class='b-name'>实付款</view>
</view>
</view>

<!-- 拼团状态-除拼团失败,拼团超时 -->
<view class='status' wx:if='{{data.statustext==11||data.statustext==12||data.statustext==13}}' style='padding:0;overflow:hidden;margin-top:30rpx;'>
<view class='status-top'>
<view class='p-status' style='text-align:center;width:100%;'>好友的拼团已完成</view>
<!-- 拼团状态-除拼团失败,拼团超时 wx:if='{{data.status!=10&&!isMyself}}'-->
<view class='status' wx:if='{{data.status!=10&&!isMyself}}' style='padding:0;overflow:hidden;margin-top:30rpx;'>
<view class='status-top' style='margin:0 20rpx;width:650rpx;box-sizing:border-box;'>
<view class='p-status' style='text-align:center;width:100%;'>{{data.statustext}}</view>
</view>
<view class='status-center'>
<view class='status-center' style='margin:0 20rpx;width:650rpx;box-sizing:border-box;'>
<view class='status-lists'>
<view class='tuanzhang touxiangitems'>
<view class='touxiang'>
<image src='{{spellBg}}'></image>
<view class='tuanzhang touxiangitems' wx:for="{{data.userList}}" wx:key="{{index}}">
<view class='touxiang' wx:if='{{item.avatarUrl}}'>
<image src='{{item.avatarUrl}}'></image>
</view>
<view class='tuan-icon'>
<view class='tuan-icon' wx:if='{{index==0}}'>
<image src='{{tuanzhang}}'></image>
</view>
</view>
<view class='tuanzhang touxiangitems'>
<view class='touxiang'>
<image src='{{spellBg}}'></image>
</view>
</view>
<view class='tuanzhang touxiangitems'>
<view class='touxiang'>
<image src='{{spellBg}}'></image>
</view>
</view>
<view class='tuanzhang touxiangitems'>
<view class='touxiang'>
<image src='{{spellBg}}'></image>
<view class='no-touxiang' wx:if='{{!item.avatarUrl}}'>
?
</view>
</view>
</view>
</view>
<!-- 按钮 -->
<view class='button'>
<button>发起拼团</button>
<button>更多拼团商品</button>
<view class='button' style='padding:0 20rpx;'>
<button bindtap='gotoshare'>发起拼团</button>
<button bindtap='gotoSearch'>更多拼团商品</button>
</view>
<view class='status-bottom' style='background:rgba(254,243,232,1);padding:0 20rpx;box-sizing:border-box;'>
<view class='position-icon'>
<image src='{{position}}'></image>
</view>
<view class='position'>广场地址:北京市朝阳区东三环中路123号</view>
<view class='position'>广场地址:{{data.addr}}</view>
</view>
</view>

@@ -124,7 +112,8 @@
</view>
</view>
<view class='edit'>
<button class='share user-motto' wx:if='{{data.status!=11}}' id="shareBtn" open-type="share">邀请好友拼团</button>
<button class='share user-motto' wx:if='{{data.status==11}}' bindtap='gotoUse'>去使用</button>
<button class='share user-motto' wx:if="{{data.status==10&&isMyself==true}}" id="shareBtn" open-type="share">邀请好友拼团</button>
<button class='share user-motto' wx:if="{{data.status==12||data.status==13}}" bindtap='gotoAgain'>重新拼团</button>
<button class='share user-motto' wx:if="{{data.status==11&&isMyself==true}}" bindtap='gotoUse'>去使用</button>
</view>
</view>

+ 3
- 2
pages/spellDetail/index.wxss Parādīt failu

@@ -105,12 +105,13 @@ page {
}
.tuan-icon{
position: absolute;
bottom: 20rpx;
bottom: 0rpx;
left: 8rpx;
width: 64rpx;
height: 27rpx;
}
.tuan-icon image{
display: block;
width: 64rpx;
height: 27rpx;
}
@@ -180,7 +181,7 @@ page {
}
.detail-top03{
float: left;
padding-top: 170rpx;
padding-top: 180rpx;
width: 230rpx;
}
.detail-p-name{


+ 39
- 6
pages/spellGroup/spellGroup.js Parādīt failu

@@ -46,6 +46,20 @@ Page({
})
this.getList(1, "spellList")
},
//去使用
gotoUse(e){
console.log(e)
wx.navigateTo({
url: '/pages/couponorder/index/index',
})
},
//重新拼团
gotoAgain(){
let data = e.currentTarget.dataset.data
wx.navigateTo({
url: `/pages/spellGroup/mySpellGroup/index?couponId=${data.couponId}&couponChannelId=${data.couponChannelId}`,
})
},
//跳转到我的拼团详情
gotoStatusDetail(e){
console.log(e,333)
@@ -94,6 +108,31 @@ Page({

}
},
/**
* 用户点击右上角分享
*/
// paramData
onShareAppMessage: function (res) {
if (res.from === 'button') {
console.log(res, 3333333333333333333333)
// 来自页面内转发按钮
let _this = this;
let data = res.target.dataset.data
return {
title: '拼团',
path: `/pages/index/index?couponId=${data.couponId}&orderGroupId=${data.orderGroupId}&couponChannelId=${data.couponChannelId}&orderId=${data.orderId}`,
imageUrl: data.coverImg,
success: function (res) {
// 转发成功
},
fail: function (res) {
// 转发失败
}
}
} else {
console.log(res, 444444444444444444)
}
},
getList(pageNum, flag) {
var that = this;
console.log(pageNum)
@@ -295,12 +334,6 @@ Page({
url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${couponChannelId}&couponId=${couponId}`
})
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {

},
//加载更多
onReachBottom: function () {


+ 4
- 4
pages/spellGroup/spellGroup.wxml Parādīt failu

@@ -52,13 +52,13 @@
</view>
<view class='spell-right' style='position:absolute;width:auto;bottom:30rpx;right:20rpx;'>
<!-- 继续邀请好友 -->
<button class='share user-motto right-button' open-type="share" id="shareBtn" wx:if='{{item.status==10}}' data-status='{{item.status}}' hover-class="other-button-hover" style="width:auto;display:inline-block;padding:0 8rpx;">{{item.statusText}}</button>
<button class='share user-motto right-button' open-type="share" id="shareBtn" wx:if='{{item.status==10}}' data-status='{{item.status}}' data-data='{{item}}' hover-class="other-button-hover" style="width:auto;display:inline-block;padding:0 8rpx;">{{item.statusText}}</button>
<!-- 去使用 -->
<view class='right-button' wx:if='{{item.status==11}}' data-status='{{item.status}}' bindtap='gotoEdit' style="width:auto;display:inline-block;padding:0 8rpx;">{{item.statusText}}</view>
<view class='right-button' data-data='{{item}}' wx:if='{{item.status==11}}' data-status='{{item.status}}' bindtap='gotoUse' style="width:auto;display:inline-block;padding:0 8rpx;">{{item.statusText}}</view>
<!-- 重新拼团 -->
<view class='right-button' wx:if='{{item.status==13}}' data-status='{{item.status}}' bindtap='gotoEdit' style="width:auto;display:inline-block;padding:0 8rpx;">{{item.statusText}}</view>
<view class='right-button' data-data='{{item}}' wx:if='{{item.status==13}}' data-status='{{item.status}}' bindtap='gotoAgain' style="width:auto;display:inline-block;padding:0 8rpx;">{{item.statusText}}</view>
<!-- 拼团失败 -->
<view class='right-button' wx:if='{{item.status==12}}' data-status='{{item.status}}' bindtap='gotoEdit' style="width:auto;display:inline-block;padding:0 8rpx;">{{item.statusText}}</view>
<view class='right-button' wx:if='{{item.status==12}}' data-status='{{item.status}}' bindtap='gotoEdit' style="width:auto;display:inline-block;background:#B5B5B5;padding:0 8rpx;">{{item.statusText}}</view>
</view>
</view>
</view>


Notiek ielāde…
Atcelt
Saglabāt