Browse Source

v 1.6.14 ; 拼团购改版;

feature/point
ZhaoTongYao 5 years ago
parent
commit
24531d011c
  1. 4
      app.json
  2. 2
      pages/heartNew/heartNew.wxml
  3. 2
      pages/toRegister/toRegister.js
  4. 21
      subpages/heart/components/cancelSignupDialog/cancelSignupDialog.js
  5. 2
      subpages/heart/components/cancelSignupDialog/cancelSignupDialog.wxml
  6. 66
      subpages/heart/components/noticeNew/noticeNew.wxml
  7. BIN
      subpages/heart/images/add.png
  8. BIN
      subpages/heart/images/btnbk0.png
  9. BIN
      subpages/heart/images/checkbox-checked.png
  10. BIN
      subpages/heart/images/checkbox.png
  11. BIN
      subpages/heart/images/icon_close.png
  12. BIN
      subpages/heart/images/ig_tianjiatupian@2x.png
  13. BIN
      subpages/heart/images/loading.gif
  14. BIN
      subpages/heart/images/minus.png
  15. BIN
      subpages/heart/images/my-groupbuy.png
  16. BIN
      subpages/heart/images/signed2.png
  17. BIN
      subpages/heart/images/signup.png
  18. BIN
      subpages/heart/images/unsignup.png
  19. 15
      subpages/heart/pages/dropByList/dropByList.js
  20. 6
      subpages/heart/pages/dropByList/dropByList.wxml
  21. 346
      subpages/heart/pages/evaluate/evaluate.js
  22. 7
      subpages/heart/pages/evaluate/evaluate.json
  23. 36
      subpages/heart/pages/evaluate/evaluate.wxml
  24. 157
      subpages/heart/pages/evaluate/evaluate.wxss
  25. 191
      subpages/heart/pages/groupBuyConfirmList/groupBuyConfirmList.js
  26. 8
      subpages/heart/pages/groupBuyConfirmList/groupBuyConfirmList.json
  27. 34
      subpages/heart/pages/groupBuyConfirmList/groupBuyConfirmList.wxml
  28. 104
      subpages/heart/pages/groupBuyConfirmList/groupBuyConfirmList.wxss
  29. 276
      subpages/heart/pages/groupBuyDetail/groupBuyDetail.js
  30. 9
      subpages/heart/pages/groupBuyDetail/groupBuyDetail.json
  31. 82
      subpages/heart/pages/groupBuyDetail/groupBuyDetail.wxml
  32. 158
      subpages/heart/pages/groupBuyDetail/groupBuyDetail.wxss
  33. 35
      subpages/heart/pages/groupBuyList/groupBuyList.js
  34. 25
      subpages/heart/pages/groupBuyList/groupBuyList.wxml
  35. 134
      subpages/heart/pages/groupBuyList/groupBuyList.wxss
  36. 300
      subpages/heart/pages/groupBuyListMy/groupBuyListMy.js
  37. 10
      subpages/heart/pages/groupBuyListMy/groupBuyListMy.json
  38. 67
      subpages/heart/pages/groupBuyListMy/groupBuyListMy.wxml
  39. 201
      subpages/heart/pages/groupBuyListMy/groupBuyListMy.wxss
  40. 241
      subpages/heart/pages/groupBuyPublish/groupBuyPublish.js
  41. 3
      subpages/heart/pages/groupBuyPublish/groupBuyPublish.json
  42. 35
      subpages/heart/pages/groupBuyPublish/groupBuyPublish.wxml
  43. 67
      subpages/heart/pages/groupBuyPublish/groupBuyPublish.wxss
  44. 8
      subpages/heart/pages/volunteer/volunteer.js
  45. 64
      subpages/heart/utils/api.js

4
app.json

@ -117,6 +117,10 @@
"pages/myApplyDetail/myApplyDetail",
"pages/bannerDetail/bannerDetail",
"pages/groupBuyList/groupBuyList",
"pages/groupBuyListMy/groupBuyListMy",
"pages/groupBuyDetail/groupBuyDetail",
"pages/groupBuyConfirmList/groupBuyConfirmList",
"pages/evaluate/evaluate",
"pages/dropByList/dropByList",
"pages/groupBuyPublish/groupBuyPublish",
"pages/dropByPublish/dropByPublish",

2
pages/heartNew/heartNew.wxml

@ -56,7 +56,7 @@
<view class="tab-right">
<view class="tab" wx:for="{{tabRightList}}" wx:key="index" data-title="{{item.remark}}" data-code="{{item.imgCode}}" bindtap="toJumpPage">
<image src="{{item.imgUrl}}"/>
<view class="tab-text">{{item.remark}}</view>
<view class="tab-text"></view>
</view>
</view>
<view class="tab-all">

2
pages/toRegister/toRegister.js

@ -21,7 +21,7 @@ Page({
// }
// })
let that = this
const versionNum = "1.6.13"
const versionNum = "1.6.14"
api.getScanSwitch(versionNum).then(function (res) {
console.log(res.data)
let state = res.data.scanFlag

21
subpages/heart/components/cancelSignupDialog/cancelSignupDialog.js

@ -54,11 +54,12 @@ Component({
close () {
this.triggerEvent("close", {data: this.data.textareaValue})
this.setData({
visible: !this.data.visible
visible: !this.data.visible,
textareaValue: ''
})
},
confirm () {
if (this.data.textareaValue === "") {
if (this.data.textareaValue.trim() === "") {
wx.showToast({
title: "原因不能为空",
icon: "none",
@ -68,14 +69,20 @@ Component({
}
this.triggerEvent("confirm", {data: this.data.textareaValue})
this.setData({
visible: !this.data.visible
visible: !this.data.visible,
textareaValue: ''
})
},
textareaInput (e) {
this.setData({
textareaValue: e.detail.value
})
console.log(this.data.textareaValue)
if (this.data.visible) {
this.setData({
textareaValue: e.detail.value
})
} else {
this.setData({
textareaValue: ''
})
}
},
closeDialog () {
this.setData({

2
subpages/heart/components/cancelSignupDialog/cancelSignupDialog.wxml

@ -5,7 +5,7 @@
</view>
<view class="title">{{title}}</view>
<view class="textarea">
<textarea value="{{textareaValue}}" bindblur="textareaInput" bindinput="textareaInput" placeholder-class="textarea-placeholder" cursor-spacing="70" placeholder="请您填写取消报名的原因,提交后您无法参加本次活动"/>
<textarea value="{{textareaValue}}" bindblur="textareaInput" bindinput="textareaInput" placeholder-class="textarea-placeholder" cursor-spacing="70" placeholder="请输入..."/>
</view>
<view class="note" wx:if="{{tipVisible}}">{{tipValue}}</view>
<view class="footer">

66
subpages/heart/components/noticeNew/noticeNew.wxml

@ -9,15 +9,23 @@
</view>
</block>
<!-- 1 拼团购列表 -->
<block wx:elif="{{type == 1}}">
<view class="notice" wx:for="{{list}}" wx:key="index">
<!-- <block wx:elif="{{type == 1}}">
<view class="notice" wx:for="{{list}}" wx:key="index" data-id="{{item.id}}" bindtap="toNoticeDetail">
<view class="notice-left" wx:if="{{item.groupBuyImg}}">
<image src="{{item.groupBuyImg}}" />
</view>
<view class="notice-right">
<view class="notice-title">{{item.groupBuyTitle}}</view>
<view class="notice-bottom">
<view class="notice-time">团购时间:{{item.groupBuyTime}}</view>
<view class="notice-detail" data-id="{{item.id}}" bindtap="toNoticeDetail">查看{{">"}}</view>
</view>
<view class="bottom-left">
<view class="notice-tag tag-5" wx:if="{{item.isTop == '1'}}">置顶</view>
<view class="notice-tag tag-{{item.groupBuyStatus}}">{{item.groupBuyStatus == '0' ? '团购中' : '已结束'}}</view>
<view class="notice-time">{{item.groupBuyPublishTime}}</view>
</view>
</view>
</view>
</view>
</block>
</block> -->
<!-- 2 顺道捎 我的列表 -->
<block wx:elif="{{type == 2}}">
<view class="notice" wx:for="{{list}}" wx:key="index">
@ -32,17 +40,41 @@
</view>
</view>
</block>
<!-- 3 拼团购 我的列表 -->
<block wx:else>
<!-- 3 拼团购 我的参与 -->
<!-- <block wx:elif="{{type == 3}}">
<view class="notice" wx:for="{{list}}" wx:key="index" data-id="{{item.id}}" bindtap="toNoticeDetail">
<view class="notice-left" wx:if="{{item.groupBuyImg}}">
<image src="{{item.groupBuyImg}}" />
</view>
<view class="notice-right">
<view class="notice-title">{{item.groupBuyTitle}}</view>
<view class="notice-bottom">
<view class="bottom-left">
<view class="notice-tag tag-{{item.groupBuyStatus}}">{{item.groupBuyStatus == '0' ? '团购中' : '已结束'}}</view>
<view class="notice-time">{{item.groupBuyPublishTime}}</view>
</view>
<view class="evaluate">评价</view>
</view>
</view>
</view>
</block> -->
<!-- 4 拼团购 我的发布 -->
<!-- <block wx:elif="{{type == 4}}">
<view class="notice" wx:for="{{list}}" wx:key="index">
<view class="notice-title">{{item.groupBuyTitle}}</view>
<view class="notice-bottom">
<view class="notice-detail" data-id="{{item.id}}" bindtap="toNoticeDetail">查看{{" >"}}</view>
<view class="notice-option">
<view class="btn" data-id="{{item.id}}" bindtap="toModify">修改</view>
<view class="notice-line"></view>
<view class="btn" data-id="{{item.id}}" bindtap="toDelete">删除</view>
<view class="notice-right">
<view class="notice-title">{{item.groupBuyTitle}}</view>
<view class="notice-bottom">
<view class="notice-options">
<view class="btn" data-id="{{item.id}}" bindtap="toModify">修改</view>
<view class="notice-line"></view>
<view class="btn" data-id="{{item.id}}" bindtap="toDelete">取消</view>
<view class="notice-line"></view>
<view class="btn" data-id="{{item.id}}" bindtap="toModify">结束</view>
<view class="notice-line"></view>
<view class="btn" data-id="{{item.id}}" bindtap="toDelete">确认交易</view>
</view>
</view>
</view>
</view>
</block>
</view>
</block> -->

BIN
subpages/heart/images/add.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
subpages/heart/images/btnbk0.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
subpages/heart/images/checkbox-checked.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
subpages/heart/images/checkbox.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
subpages/heart/images/icon_close.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
subpages/heart/images/ig_tianjiatupian@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
subpages/heart/images/loading.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
subpages/heart/images/minus.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
subpages/heart/images/my-groupbuy.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
subpages/heart/images/signed2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
subpages/heart/images/signup.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

BIN
subpages/heart/images/unsignup.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

15
subpages/heart/pages/dropByList/dropByList.js

@ -20,6 +20,7 @@ Page({
dialogContent: "",
dialogConfirmText: "",
dialogCancelText: "",
buttonInfo: {}
},
/**
@ -30,6 +31,7 @@ Page({
title: options.title
})
// this.getSdsList()
this.getImgUrl()
},
/**
@ -118,6 +120,16 @@ Page({
})
},
// 获取配置图片
getImgUrl:function (){
let that = this
api.getImgUrl("7").then(function (res) {
that.setData({
buttonInfo: res.data[0]
})
})
},
getSdsList () {
const para = {
type: this.data.type,
@ -153,6 +165,9 @@ Page({
// 跳转发布
toPublish () {
console.log('发布')
if (this.data.buttonInfo.imgCode != 'button_sds_fb') {
return
}
api.getVolunteerVerify().then(res => {
if (res.code == 0) {
if (res.data && res.data.id) {

6
subpages/heart/pages/dropByList/dropByList.wxml

@ -21,9 +21,9 @@
<move-btn button-top="850"
button-left="560"
button-width="178"
button-height="148"
img-url="/subpages/heart/images/publish.png"
button-width="204"
button-height="140"
img-url="{{buttonInfo.imgUrl}}"
bindmovebtnCallBack="toPublish"></move-btn>

346
subpages/heart/pages/evaluate/evaluate.js

@ -0,0 +1,346 @@
import { $wuxActionSheet } from "../../../../dist/index"
import { evaluation } from "../../utils/api"
// const QQMapWX = require("../../utils/qqmap-wx-jssdk")
const config = require("../../../../utils/config")
Page({
data: {
evaluateValue: "",
imageList: [],
imageId: 1,
// qqmapsdk: "",
// addressValue: "",
// location: {
// latitude: "",
// longitude: ""
// },
groupBuyId: "",
violationsCount: 0,
isConReview: false,
lock: false, //锁定发布按钮状态,防止连击
dialogVisible: false, //提示框
dialogTitle: '', //提示内容
},
onShow () {
},
onLoad (options) {
// const qqmapsdk = new QQMapWX({
// key: "CMJBZ-4DECI-JXGGN-5B4WU-QLV2H-B5BEJ"
// })
// this.setData({
// qqmapsdk,
// partyGroupId: options.partyGroupId,
// })
// this.getLocation()
this.setData({
groupBuyId: options.id
})
},
// 话题内容框 值双向绑定
bindTopicValue (e) {
this.setData({
evaluateValue: e.detail.value
})
console.log(this.data.evaluateValue)
},
// 地址框 值双向绑定
bindAddressValue (e) {
this.setData({
addressValue: e.detail.value
})
console.log(this.data.addressValue)
},
// 选择图片
chooseImage () {
const that = this
$wuxActionSheet().showSheet({
buttons: [{
text: "拍照"
},
{
text: "从相册中获取"
},
],
buttonClicked (index) {
if (index === 0) {
wx.chooseImage({
count: 1,
sizeType: ["original", "compressed"],
sourceType: ["camera"],
success (res) {
const imageList = [...that.data.imageList]
imageList.push({
img: res.tempFilePaths[0],
upload: true,
id: that.data.imageId++,
ossUrl: ""
})
that.setData({
imageList
})
wx.uploadFile({
url: config.BASEURL() + "group/topic/upload",
filePath: res.tempFilePaths[0],
name: "file",
header: {
"Content-Type": "multipart/form-data"
},
success (fileres) {
const data = JSON.parse(fileres.data)
if (data.code === 0 && data.msg === "success") {
imageList[imageList.length - 1].ossUrl = data.data
imageList[imageList.length - 1].upload = false
} else {
imageList.pop()
wx.showToast({
title: "上传图片失败,请重试",
icon: "none",
duration: 2000
})
}
that.setData({
imageList
})
},
fail (err) {
console.log(err)
imageList.pop()
wx.showToast({
title: "上传图片失败,请重试",
icon: "none",
duration: 2000
})
that.setData({
imageList
})
}
})
}
})
} else if (index === 1) {
wx.chooseImage({
count: 3 - that.data.imageList.length,
sizeType: ["original", "compressed"],
sourceType: ["album"],
success (res) {
let imageList = []
res.tempFilePaths.forEach(item => {
imageList.push({
img: item,
upload: true,
id: that.data.imageId++,
ossUrl: ""
})
})
that.setData({
imageList: [...that.data.imageList, ...imageList]
})
imageList.forEach((item, index) => {
(function (index) {
wx.uploadFile({
url: `${config.BASEURL()}group/topic/upload`,
filePath: imageList[index].img,
name: "file",
header: {
"Content-Type": "multipart/form-data"
},
success (fileRes) {
const data = JSON.parse(fileRes.data)
if (data.code === 0 && data.msg === "success") {
imageList[index].ossUrl = data.data
imageList[index].upload = false
} else {
imageList.splice(index, 1)
wx.showToast({
title: "上传图片失败,请重试",
icon: "none",
duration: 2000
})
}
that.data.imageList = that.data.imageList.slice(0, that.data.imageList.length - res.tempFilePaths.length)
that.setData({
imageList: [...that.data.imageList, ...imageList]
})
},
fail (err) {
console.log(err)
imageList.splice(index, 1)
wx.showToast({
title: "上传图片失败,请重试",
icon: "none",
duration: 2000
})
that.data.imageList = that.data.imageList.slice(0, that.data.imageList.length - res.tempFilePaths.length)
that.setData({
imageList: [...that.data.imageList, ...imageList]
})
}
})
})(index)
})
}
})
}
return true
},
cancelText: "取消",
cancel () {},
destructiveButtonClicked () {},
})
},
// 获取经纬度
getLocation () {
wx.getLocation({
type: "gcj02",
success: (res) => {
console.log("经纬度", res)
this.reverseGeocoder(res)
this.setData({
location: {
latitude: res.latitude,
longitude: res.longitude
}
})
}
})
},
// 逆地址解析
reverseGeocoder ({latitude, longitude}) {
this.data.qqmapsdk.reverseGeocoder({
location: {
latitude,
longitude
},
success: (res) => {
console.log("逆地址解析", res)
if (res.message === "query ok") {
this.setData({
addressValue: res.result.address
})
}
}
})
},
// 提交评价
addEvaluate () {
this.data.evaluateValue = this.data.evaluateValue.trim()
if (this.data.evaluateValue == "") {
wx.showToast({
title: "请输入评价内容",
icon: "none",
duration: 2000
})
return false
} else if (this.data.evaluateValue.length > 50) {
wx.showToast({
title: "超出50字数限制",
icon: "none",
duration: 2000
})
return false
// } else if (this.data.addressValue === "") {
// wx.showToast({
// title: "请输入-地址",
// icon: "none",
// duration: 2000
// })
// return false
}
const imagesList = []
if (this.data.imageList.length > 0) {
const isUploadingStatus = this.data.imageList.some(item => item.upload)
if (isUploadingStatus) {
wx.showToast({
title: "请等待图片上传完成",
icon: "none",
duration: 2000
})
return false
}
this.data.imageList.forEach(item => {
imagesList.push(item.ossUrl)
})
}
const para = {
groupBuyId: this.data.groupBuyId,
evaluationContent: this.data.evaluateValue,
evaluationImg: imagesList,
// isConReview: this.data.isConReview
}
this.setData({
lock: true
})
wx.showLoading({
title: "加载中",
})
let that = this
evaluation(para).then(res => {
wx.hideLoading()
this.setData({
lock: false
})
// console.log(res)
if (res.code == 0) {
this.setData({
dialogVisible: true,
dialogTitle: '评价成功',
violationsCount: 0,
isConReview: false
})
} else if (res.code == 533) {
this.data.violationsCount++
console.log(this.data.violationsCount)
if (this.data.violationsCount == 1){
wx.showToast({
title: res.msg,
icon: "none",
duration: 2000
})
} else if (this.data.violationsCount == 2) {
wx.showModal({
title: '提示',
content: '您提交的内容再次被判定为违规,您确定是否要提交?',
success (res) {
if (res.confirm) {
console.log('用户点击确定')
that.data.isConReview = true
that.addEvaluate()
} else if (res.cancel) {
console.log('用户点击取消')
that.setData({
violationsCount: 0,
isConReview: false
})
}
}
})
}
}
}).catch(err => {
console.log('err',err)
wx.hideLoading()
this.setData({
lock: false
})
})
},
// 删除图片
deleteImage (e) {
const index = this.data.imageList.findIndex((item,index) => index === e.currentTarget.dataset.index)
this.data.imageList.splice(index, 1)
const imageList = this.data.imageList
this.setData({
imageList
})
},
// 关闭弹框
closeDialog () {
this.setData({
dialogVisible: false
})
wx.navigateBack()
},
})

7
subpages/heart/pages/evaluate/evaluate.json

@ -0,0 +1,7 @@
{
"usingComponents": {
"wux-actionsheet": "../../../../dist/actionsheet/index",
"notice": "../../components/notice/notice"
},
"navigationBarTitleText": "评价"
}

36
subpages/heart/pages/evaluate/evaluate.wxml

@ -0,0 +1,36 @@
<view class="add-evaluate">
<view class="evaluate">
<textarea value="{{evaluateValue}}" bindinput="bindTopicValue" maxlength="51" placeholder="请输入评价内容....">
<!-- <view wx:if="{{evaluateValue.length == 0}}" class="placeholder-textarea">
<view>请输入...</view>
</view> -->
</textarea>
<view class="picture">
<view class="image-box" wx:for="{{imageList}}" wx:key="index" wx:for-item="item" wx:for-index="index">
<image src="{{item.img}}" />
<image wx:if="{{item.upload}}" class="loading" src="../../images/loading.gif" />
<image bindtap="deleteImage" data-index="{{index}}" wx:else class="delete-image" src="../../images/icon_close.png" />
</view>
<view class="image-box">
<image bindtap="chooseImage" wx:if="{{imageList.length <= 2}}" src="../../images/ig_tianjiatupian@2x.png" />
</view>
</view>
</view>
<!-- <view class="address">
<textarea value="{{addressValue}}" bindinput="bindAddressValue" placeholder-class="placeholder-textarea" placeholder="请输入定位地址" />
<view class="tip">
<image src="../../images/ic_dingwei@2x.png" />
<text>定位</text>
</view>
</view> -->
<view class="evaluate-button">
<button bindtap="addEvaluate" type="default" size="defaultSize" hover-class="hover-button" disabled="{{lock}}">
<image src="../../images/submit-bk.png" />
<text >提交评价</text>
</button>
</view>
</view>
<wux-actionsheet id="wux-actionsheet" />
<notice bind:close="closeDialog" bind:confirm="closeDialog" dialogVisible="{{dialogVisible}}" title="{{dialogTitle}}" content="" confirmText="知道了"></notice>

157
subpages/heart/pages/evaluate/evaluate.wxss

@ -0,0 +1,157 @@
page {
width: 100%;
height:100%;
}
.add-evaluate {
width: 100%;
height: 100%;
background: #f7f7f7;
box-sizing: border-box;
padding: 20rpx;
}
.add-evaluate .evaluate {
width: 100%;
height: 640rpx;
background: #fff;
border-radius: 16rpx;
box-sizing: border-box;
padding: 45rpx 20rpx 0;
}
.add-evaluate .evaluate textarea {
color: #333;
font-size: 34rpx;
line-height: 46rpx;
width: 100%;
height: 340rpx;
box-sizing: border-box;
padding-bottom: 20rpx;
position: relative;
}
.add-evaluate .evaluate textarea .placeholder-textarea {
font-size: 28rpx;
line-height: 46rpx;
color: #999;
position: absolute;
left: 0;
top: 0;
}
.add-evaluate .evaluate .picture {
display: flex;
height: 255rpx;
box-sizing: border-box;
padding: 20rpx 0;
}
.add-evaluate .evaluate .picture .image-box, .add-evaluate .evaluate .picture image {
width: 215rpx;
height: 215rpx;
object-fit:cover;
border-radius: 8rpx;
}
.add-evaluate .evaluate .picture .image-box image {
width: 215rpx;
height: 215rpx;
object-fit:cover;
}
.add-evaluate .evaluate .picture .image-box {
position: relative;
}
.add-evaluate .evaluate .picture .image-box .loading {
position: absolute;
left: 25%;
top: 25%;
width: 50%;
height: 50%;
}
.add-evaluate .evaluate .picture .image-box .delete-image {
width: 40rpx;
height: 40rpx;
position: absolute;
right: -20rpx;
top: -20rpx;
}
.add-evaluate .evaluate .picture .image-box + .image-box {
margin-left: 10rpx;
}
.add-evaluate .address {
width: 100%;
height: 210rpx;
background: #fff;
border-radius: 16rpx;
margin-top: 20rpx;
box-sizing: border-box;
padding: 0 20rpx;
}
.add-evaluate .address textarea {
width: 100%;
height: 122rpx;
box-sizing: border-box;
padding-top: 35rpx;
font-size: 34rpx;
color: #333;
line-height: 46rpx;
}
.add-evaluate .address .placeholder-textarea {
font-size: 28rpx;
line-height: 46rpx;
color: #999;
}
.add-evaluate .address .tip {
width: 100%;
height: 78rpx;
display: flex;
align-items: center;
}
.add-evaluate .address .tip image {
width: 22rpx;
height: 26rpx;
object-fit: cover;
}
.add-evaluate .address .tip text {
font-size: 26rpx;
color: #999;
margin-left: 14rpx;
}
.add-evaluate .evaluate-button {
width: 100%;
height: 85rpx;
display:flex;
justify-content: center;
align-items: center;
position: fixed;
bottom: 100rpx;
left: 0;
}
.add-evaluate .evaluate-button button {
width: 560rpx;
height: 100rpx;
line-height: 85rpx;
text-align:center;
color: #fff;
font-size: 36rpx;
border-radius: 16rpx;
/* background: linear-gradient(to right, #F40C0C, #FF4E4E) */
background-color: transparent;
}
.add-evaluate .evaluate-button .hover-button {
/* background: red; */
}
button image {
width: 100%;
height: 100%;
}
button text {
position: absolute;
width: 100%;
height: 100%;
left: 0;
}
button::after {
border: none;
}
.wux-actionsheet__button {
font-size: 34rpx !important;
color: #333 !important;
}

191
subpages/heart/pages/groupBuyConfirmList/groupBuyConfirmList.js

@ -0,0 +1,191 @@
// subpages/heart/pages/groupBuyConfirmList/groupBuyConfirmList.js
const api = require('../../utils/api')
Page({
/**
* 页面的初始数据
*/
data: {
pageIndex: 1,
pageSize: 10,
nodata: false,
loadMoreType: 'none',
loadMoreVisible: false,
groupBuyId: '', //拼团购的ID
confirmlist:[],
_checklist:[],
allChecked: false,
dialogVisible: false, //提示框
dialogTitle: '', //提示内容
lock: false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
groupBuyId: options.id
})
this.getConfirmList()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
// onShareAppMessage: function () {
// }
changeCheckValue (e) {
let index = e.currentTarget.dataset.index
let status = e.currentTarget.dataset.status
this.data.confirmlist[index].signUpStatus = (status == '0' ? '5' : '0')
this.setData({
confirmlist: this.data.confirmlist
})
for(let i=0; i<this.data._checklist.length; i++) {
if (this.data._checklist[i].id == this.data.confirmlist[index].id) {
this.data._checklist[i].signUpStatus = this.data.confirmlist[index].signUpStatus
return
}
}
let check = {
id: this.data.confirmlist[index].id,
signUpStatus: this.data.confirmlist[index].signUpStatus
}
this.data._checklist.push(check)
console.log(this.data._checklist)
},
changeAllCheck () {
this.data._checklist = []
this.data.allChecked = !this.data.allChecked
this.data.confirmlist.forEach(item => {
item.signUpStatus = this.data.allChecked ? '5' : '0'
let val = {
id: item.id,
signUpStatus: item.signUpStatus
}
this.data._checklist.push(val)
})
this.setData({
allChecked: this.data.allChecked,
confirmlist: this.data.confirmlist
})
console.log(this.data._checklist)
},
submitConfirm () {
if (this.data.lock) {
return
}
console.log('tradeConfirmationList', this.data._checklist)
if (this.data._checklist.length > 0) {
const para = {
tradeConfirmationList: this.data._checklist
}
this.setData({
lock: true
})
api.tradeConfirmation(para).then(res => {
console.log(res.data)
this.setData({
allChecked: false,
confirmlist: [],
_checklist: [],
pageIndex: 1,
dialogVisible: true,
dialogTitle: '提交成功',
lock: false
})
this.getConfirmList()
}).catch(err => {
this.setData({
lock: false
})
})
}
},
//获取列表
getConfirmList () {
const para = {
id: this.data.groupBuyId,
pageIndex: this.data.pageIndex,
pageSize: this.data.pageSize
}
api.getGroupBuySignUpList(para).then(res => {
console.log(res)
this.setData({
confirmlist: [...this.data.confirmlist,...res.data],
loadMoreType: res.data.length === this.data.pageSize ? 'loading' : 'none',
loadMoreVisible: res.data.length === this.data.pageSize ? false : true,
nodata: false,
})
if (this.data.confirmlist.length == 0) {
this.setData({
nodata: true,
loadMoreType: 'none',
loadMoreVisible: false,
})
}
}).catch(err => {
this.setData({
confirmlist: [],
nodata: true,
loadMoreType: 'none',
loadMoreVisible: false,
})
console.log(err)
})
},
// 关闭弹框
closeDialog () {
this.setData({
dialogVisible: false
})
},
})

8
subpages/heart/pages/groupBuyConfirmList/groupBuyConfirmList.json

@ -0,0 +1,8 @@
{
"usingComponents": {
"notice": "../../components/notice/notice",
"load-more": "/components/loadMore/loadMore",
"no-data": "/components/nodata/nodata"
},
"navigationBarTitleText": "报名列表"
}

34
subpages/heart/pages/groupBuyConfirmList/groupBuyConfirmList.wxml

@ -0,0 +1,34 @@
<!--subpages/heart/pages/groupBuyConfirmList/groupBuyConfirmList.wxml-->
<view class="groupbuy-confirm-list">
<view class="top-title">
<view >微信名</view>
<view >联系电话</view>
<view >是否完成交易</view>
</view>
<view class="confirm-list">
<view class="confirm-item" wx:for="{{confirmlist}}" wx:key="index">
<view class="username">{{item.nickname}}</view>
<view class="userphone">{{item.mobile}}</view>
<view class="checkbox" data-id="{{item.id}}" data-status="{{item.signUpStatus}}" data-index="{{index}}" bindtap="changeCheckValue">
<image mode="aspectFill" src="../../images/{{item.signUpStatus == 0 ? 'checkbox' : 'checkbox-checked'}}.png" />
</view>
</view>
</view>
</view>
<view class="bottom-menu">
<view class="checkbox" bindtap="changeAllCheck">
<image mode="aspectFill" src="../../images/{{allChecked ? 'checkbox-checked' : 'checkbox'}}.png" />
<view class="check-text">{{allChecked ? '取消全选' : '全选'}}</view>
</view>
<view class="submit" bindtap="submitConfirm">
<image class="submit-bk" src="../../images/btnbk0.png" />
<view class="submit-text">提交</view>
</view>
</view>
<load-more loadMoreType="{{loadMoreType}}" loadMoreVisible="{{loadMoreVisible}}"></load-more>
<no-data isShow="{{nodata}}"></no-data>
<notice bind:close="closeDialog" bind:confirm="closeDialog" dialogVisible="{{dialogVisible}}" title="{{dialogTitle}}" content="" confirmText="知道了"></notice>

104
subpages/heart/pages/groupBuyConfirmList/groupBuyConfirmList.wxss

@ -0,0 +1,104 @@
/* subpages/heart/pages/groupBuyConfirmList/groupBuyConfirmList.wxss */
page {
background: #f7f7f7;
}
.groupbuy-confirm-list {
background: #ffffff;
}
.top-title {
width: 690rpx;
display: flex;
justify-content: space-around;
align-items: center;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
height: 100rpx;
line-height: 100rpx;
margin: 0 auto;
}
.top-title view {
flex: 1;
}
.confirm-list {
width: 690rpx;
margin: 0 auto;
border-top: 1px solid #DCDCDC;
}
.confirm-list .confirm-item {
width: 100%;
display: flex;
justify-content: flex-start;
align-items: center;
height: 78rpx;
}
.confirm-list .confirm-item .username {
width: 220rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #333333;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.confirm-list .confirm-item .userphone {
width: 240rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #333333;
}
.confirm-list .confirm-item .checkbox {
width: 200rpx;
display: flex;
justify-content: center;
align-items: center;
}
.confirm-list .confirm-item .checkbox image {
width: 42rpx;
height: 42rpx;
}
.bottom-menu {
background: #fff;
position: fixed;
bottom: 0;
width: 100%;
height: 98rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
.bottom-menu .checkbox {
display: flex;
justify-content: center;
align-items: center;
margin-left: 32rpx;
}
.bottom-menu .checkbox image {
width: 42rpx;
height: 42rpx;
margin-right: 12rpx;
}
.bottom-menu .submit {
width: 178rpx;
height: 78rpx;
position: relative;
}
.bottom-menu .submit .submit-bk {
width: 100%;
height: 100%;
position: absolute;
z-index: -1;
}
.bottom-menu .submit .submit-text {
font-size: 34rpx;
font-family: PingFang SC;
font-weight: 500;
color: #FFFFFF;
height: 78rpx;
line-height: 78rpx;
text-align: center;
}

276
subpages/heart/pages/groupBuyDetail/groupBuyDetail.js

@ -0,0 +1,276 @@
// subpages/heart/pages/groupBuyDetail/groupBuyDetail.js
const api = require("../../utils/api")
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
pageIndex: 1,
pageSize: 10,
nodata: false,
loadMoreType: 'none',
loadMoreVisible: false,
infoCompleted: 0, //完善信息标志
noticeId: '',
details: {}, //团购详情
evaluateList: [], //评价列表
detailType: '', //团购详情,结束详情
dialogVisible: false, //提示框
dialogTitle: '', //提示内容
lock: false,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
infoCompleted: app.globalData.infoCompleted,
noticeId: options.id,
detailType: options.type || '',
details: {}
})
this.getNoticeDetail()
this.getEvaluationList()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.setData({
loadMoreVisible: true
})
if (this.data.loadMoreType === "loading") {
this.setData({
pageIndex: this.data.pageIndex + 1
})
this.getEvaluationList()
}
},
/**
* 用户点击右上角分享
*/
// onShareAppMessage: function () {
// },
//列表照片的放大查看
previewImage (e) {
console.log(e.currentTarget.dataset)
wx.previewImage({
urls: e.currentTarget.dataset.imgarry,
current: e.currentTarget.dataset.src
})
},
getEvaluationList () {
const para = {
groupBuyId: this.data.noticeId,
pageIndex: this.data.pageIndex,
pageSize: this.data.pageSize
}
api.getEvaluationList(para).then(res => {
console.log(res)
this.setData({
evaluateList: [...this.data.evaluateList,...res.data],
loadMoreType: res.data.length === this.data.pageSize ? 'loading' : 'none',
loadMoreVisible: res.data.length === this.data.pageSize ? false : true,
nodata: false,
})
if (this.data.evaluateList.length == 0) {
this.setData({
nodata: true,
loadMoreType: 'none',
loadMoreVisible: false,
})
}
}).catch(err => {
this.setData({
evaluateList: [],
nodata: true,
loadMoreType: 'none',
loadMoreVisible: false,
})
console.log(err)
})
},
getNoticeDetail () {
wx.showLoading({
title: '加载中...'
})
api.getGroupBuyDetail(this.data.noticeId).then(res => {
// console.log(res.data)
wx.hideLoading()
this.setData({
details: res.data
})
})
},
callNumber () {
let mobile = this.data.details.groupBuyMobile
console.log('拨打电话', mobile)
let that = this
wx.showModal({
title: "拨打电话",
content: "",
cancelColor: "#29B9A5",
confirmColor: "#29B9A5",
success: (res) => {
if (res.confirm) {
console.log("用户点击确定")
that.countCall()
wx.makePhoneCall({
phoneNumber: mobile
})
} else if (res.cancel) {
console.log("用户点击取消")
}
}
})
},
countCall () {
api.groupBuyCall(this.data.noticeId).then(res => {
console.log(res.data)
})
},
//结束团购
submit () {
if (this.data.lock) {
return false
}
const para = {
id: this.data.noticeId,
status: '5'
}
this.setData({
lock: true
})
api.updateStatus(para).then(() => {
this.setData({
dialogVisible: true,
dialogTitle: '已结束团购',
lock: false
})
}).catch(err => {
this.setData({
lock: false
})
})
},
//报名 / 取消报名
signupCall (e) {
if (this.verifyCompleteInfo()) {
return false
}
if (this.data.lock) {
return false
}
//状态0:进行中 5:已结束 10:已取消
if (e.currentTarget.dataset.groupbuystatus != 0) {
return false
}
//提交 报名状态0:报名 10:取消报名
let status = 0
//当前 报名状态0:未报名 1:已报名 2:交易已确认
if (e.currentTarget.dataset.status == 1) {
status = 10
} else if (e.currentTarget.dataset.status == 2) {
return
}
const para = {
groupBuyId: this.data.noticeId,
status: status
}
this.setData({
lock: true
})
api.signUpOrCancel(para).then(res => {
let title = ''
if (status == 0) {
title = '报名成功'
} else {
title = '取消成功'
}
this.setData({
dialogVisible: true,
dialogTitle: title,
evaluateList: [],
pageIndex: 1
})
setTimeout(() => {
this.setData({
lock: false
})
}, 500);
this.getNoticeDetail()
this.getEvaluationList()
}).catch(err => {
this.setData({
lock: false
})
})
},
// 关闭弹框
closeDialog () {
this.setData({
dialogVisible: false
})
if (this.data.dialogTitle == "已结束团购") {
wx.navigateBack()
}
},
// 检查 是否完善信息
verifyCompleteInfo () {
if (this.data.infoCompleted == 0) {
this.setData({
completeInfoDialogVisible: !this.data.completeInfoDialogVisible
})
return true
} else {
return false
}
}
})

9
subpages/heart/pages/groupBuyDetail/groupBuyDetail.json

@ -0,0 +1,9 @@
{
"navigationBarTitleText": "团购详情",
"usingComponents": {
"load-more": "/components/loadMore/loadMore",
"no-data": "/components/nodata/nodata",
"notice": "../../components/notice/notice",
"completeInfo-dialog": "/components/completeInfoDialog/completeInfoDialog"
}
}

82
subpages/heart/pages/groupBuyDetail/groupBuyDetail.wxml

@ -0,0 +1,82 @@
<!--subpages/heart/pages/groupBuyDetail/groupBuyDetail.wxml-->
<view class="notice-new">
<view class="notice-detail">
<view class="apply-item">
<view class="item-title">{{details.groupBuyTitle}}</view>
<view class="item-content">{{details.groupBuyContent}}</view>
<view class="image-box" wx:if="{{details.groupBuyImg.length > 0}}">
<image catchtap="previewImage" data-src="{{item}}" data-imgArry="{{details.groupBuyImg}}" src="{{item}}" mode="aspectFill" wx:for="{{details.groupBuyImg}}" wx:key="index" wx:for-index="index" wx:for-item="item"/>
</view>
</view>
<view class="apply-item">
<view class="item-title">联系电话</view>
<view class="item-content item-mobile">
<view >{{details.groupBuyMobile}}</view>
<view class="call-img" bindtap="callNumber"><image src="../../images/call.png" /></view>
</view>
</view>
<view class="apply-item">
<view class="item-title">价格</view>
<view class="item-content">
<block wx:for="{{details.groupBuyPriceNumber}}" wx:key="index">
<view class="item-price">人数达到{{item.groupBuyNumber}}人团购价格为{{item.groupBuyPrice}}元/件</view>
</block>
</view>
</view>
<view class="apply-item">
<view class="item-title">报名人数</view>
<view class="item-content item-mobile">
<view>{{details.groupBuyNumber}}</view>
<view class="call-img" data-status="{{details.signUpStatus}}" data-groupbuystatus="{{details.groupBuyStatus}}" bindtap="signupCall" wx:if="{{!detailType}}">
<block wx:if="{{details.groupBuyStatus == 0}}">
<image src="../../images/{{details.signUpStatus == 0 ? 'signup' : (details.signUpStatus == 1 ? 'unsignup' : 'signed2')}}.png"/>
</block>
<block wx:else>
<image src="../../images/signed2.png" wx:if="{{details.signUpStatus != 0}}"/>
</block>
</view>
</view>
</view>
<view class="apply-item" wx:if="{{details.cancelReason}}">
<view class="item-title">取消原因</view>
<view class="item-content">
{{details.cancelReason}}
</view>
</view>
</view>
<view class="submit" bindtap="submit" wx:if="{{detailType}}">
<image class="submit-bk" src="../../images/submit-bk.png" />
<view class="submit-text">结束团购</view>
</view>
<!-- 评价 -->
<block wx:else>
<view class="evaluate-list" wx:if="{{evaluateList.length > 0}}">
<view class="evaluate-title">评价</view>
<block wx:for="{{evaluateList}}" wx:key="index">
<view class="evaluate">
<view class="userbox">
<image class="headlogo" src="{{item.faceImg || 'https://epdc-shibei.elinkservice.cn/epdcFile/M00/00/00/CgUipV3wgl6Afm4cAAAa8QfEb00266_big.png'}}" />
<view class="userinfo">
<view class="nickname">{{item.nickname}}</view>
<view class="time">{{item.evaluationTime}}</view>
</view>
</view>
<view class="evaluate-content">{{item.evaluationContent}}</view>
<view class="evaluate-image" wx:if="{{item.evaluationContent.length > 0}}">
<image wx:for="{{item.evaluationImg}}" wx:key="imgIndex" wx:for-item="imgItem" src="{{imgItem}}" catchtap="previewImage" data-src="{{imgItem}}" data-imgArry="{{item.evaluationImg}}" mode="aspectFill"/>
</view>
</view>
<view class="evaluate-line" wx:if="{{index < evaluateList.length-1}}"></view>
</block>
</view>
<load-more loadMoreType="{{loadMoreType}}" loadMoreVisible="{{loadMoreVisible}}"></load-more>
<!-- <no-data isShow="{{nodata}}"></no-data> -->
</block>
</view>
<completeInfo-dialog
completeInfoDialogVisible="{{completeInfoDialogVisible}}">
</completeInfo-dialog>
<notice bind:close="closeDialog" bind:confirm="closeDialog" dialogVisible="{{dialogVisible}}" title="{{dialogTitle}}" content="" confirmText="知道了"></notice>

158
subpages/heart/pages/groupBuyDetail/groupBuyDetail.wxss

@ -0,0 +1,158 @@
/* subpages/heart/pages/groupBuyDetail/groupBuyDetail.wxss */
page {
width: 100%;
height: auto;
overflow-y: auto;
background: #f7f7f7;
}
.notice-detail {
margin-bottom: 20rpx;
}
.notice-detail .apply-item {
width: 100%;
background-color: white;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
padding: 40rpx 30rpx;
margin-top: 16rpx;
box-sizing: border-box;
}
.notice-detail .apply-item .item-title {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
}
.notice-detail .apply-item .item-content {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #666666;
margin-top: 28rpx;
}
.notice-detail .apply-item .item-content .item-price {
margin-bottom: 10rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
.notice-detail .apply-item .image-box {
width: 690rpx;
display: flex;
justify-content: flex-start;
align-items: center;
margin-top: 30rpx;
}
.notice-detail .apply-item .image-box image {
width: 226rpx;
height: 150rpx;
border-radius: 10rpx;
margin-right: 8rpx;
}
.notice-detail .apply-item .item-mobile {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.notice-detail .apply-item .item-mobile .call-img {
width: 176rpx;
height: 76rpx;
}
.notice-detail .apply-item .item-mobile .call-img image{
width: 100%;
height: 100%;
}
.notice-detail .apply-item .line {
width: 100%;
height: 1px;
background: #F2F2F2;
border-radius: 1px;
margin: 28rpx 0rpx;
}
/* 评价列表 start */
.evaluate-list {
background-color: #fff;
padding: 30rpx;
margin-bottom: 60rpx;
}
.evaluate-title {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: bold;
color: #333333;
margin-bottom: 28rpx;
}
.evaluate-line {
height: 1px;
background-color: #DCDCDC;
margin: 30rpx 0;
}
.userbox {
display: flex;
justify-content: flex-start;
align-items: center;
}
.userbox .headlogo {
width: 54rpx;
height: 54rpx;
border-radius: 50%;
}
.userbox .userinfo {
margin-left: 12rpx;
}
.userbox .userinfo .nickname {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 400;
color: #333333;
}
.userbox .userinfo .time {
font-size: 20rpx;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
}
.evaluate-content {
margin: 20rpx 0;
}
.evaluate-image {
display: flex;
justify-content: flex-start;
align-items: center;
}
.evaluate-image image {
width: 226rpx;
height: 150rpx;
margin-right: 12rpx;
border-radius: 10rpx;
}
/* 评价列表 end */
/* 结束团购 start */
.submit {
width: 592rpx;
height: 116rpx;
position: relative;
margin: 78rpx auto 0rpx;
}
.submit .submit-bk {
width: 100%;
height: 100%;
position: absolute;
z-index: -1;
}
.submit .submit-text {
font-size: 34rpx;
font-family: PingFang SC;
font-weight: 500;
color: #FFFFFF;
height: 100rpx;
line-height: 100rpx;
text-align: center;
}
/* 结束团购 end */

35
subpages/heart/pages/groupBuyList/groupBuyList.js

@ -18,6 +18,7 @@ Page({
dialogContent: "",
dialogConfirmText: "",
dialogCancelText: "",
buttonInfo: {}, //发布按钮
},
/**
@ -28,6 +29,7 @@ Page({
title: options.title
})
// this.getGroupBuyList()
this.getImgUrl()
},
/**
@ -80,6 +82,7 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
console.log('onreachbottom',this.data.loadMoreVisible,this.data.loadMoreType)
this.setData({
loadMoreVisible: true
})
@ -90,10 +93,18 @@ Page({
this.getGroupBuyList()
}
},
// 获取配置图片
getImgUrl:function (){
let that = this
api.getImgUrl("6").then(function (res) {
that.setData({
buttonInfo: res.data[0]
})
})
},
getGroupBuyList () {
const para = {
isMe: '0',
pageIndex: this.data.pageIndex,
pageSize: this.data.pageSize
}
@ -126,6 +137,9 @@ Page({
// 跳转发布
toPublish () {
console.log('发布')
if (this.data.buttonInfo.imgCode != 'button_bdh_fb') {
return
}
api.getVolunteerVerify().then(res => {
if (res.code == 0) {
if (res.data && res.data.id) {
@ -146,12 +160,15 @@ Page({
console.log(err)
})
},
// 跳转我的发布
// 跳转我的团购
toNoticeNewList () {
console.log('我的发布')
console.log('我的发布')
wx.navigateTo({
url: `/subpages/heart/pages/noticeNewList/noticeNewList?type=1`
url: `/subpages/heart/pages/groupBuyListMy/groupBuyListMy`
})
// wx.navigateTo({
// url: `/subpages/heart/pages/noticeNewList/noticeNewList?type=1`
// })
},
//志愿者认证
@ -159,5 +176,13 @@ Page({
wx.navigateTo({
url: "/subpages/heart/pages/volunteer/volunteer"
})
}
},
//前往详情
toNoticeDetail (e) {
const id = e.currentTarget.dataset.id
wx.navigateTo({
url: `/subpages/heart/pages/groupBuyDetail/groupBuyDetail?id=${id}`
})
},
})

25
subpages/heart/pages/groupBuyList/groupBuyList.wxml

@ -1,18 +1,33 @@
<!--subpages/heart/pages/groupBuyList/groupBuyList.wxml-->
<view class="group-buy-list">
<view class="my-publish" bindtap="toNoticeNewList" wx:if="{{groupbuylist.length > 0}}">
<image src="../../images/my-publish.png" />
<image src="../../images/my-groupbuy.png" />
</view>
<view class="item-list">
<notice list="{{groupbuylist}}" type="{{1}}"></notice>
<!-- <notice list="{{groupbuylist}}" type="{{1}}"></notice> -->
<view class="notice" wx:for="{{groupbuylist}}" wx:key="index" data-id="{{item.id}}" bindtap="toNoticeDetail">
<view class="notice-left" wx:if="{{item.groupBuyImg.length > 0}}">
<image src="{{item.groupBuyImg[0]}}" />
</view>
<view class="notice-right">
<view class="notice-title">{{item.groupBuyTitle}}</view>
<view class="notice-bottom">
<view class="bottom-left">
<view class="notice-tag tag-5" wx:if="{{item.topFlag == '1'}}">置顶</view>
<view class="notice-tag tag-{{item.groupBuyStatus}}">{{item.groupBuyStatus == '0' ? '团购中' : '已结束'}}</view>
<view class="notice-time">{{item.groupBuyPublishTime}}</view>
</view>
</view>
</view>
</view>
</view>
</view>
<move-btn button-top="850"
button-left="560"
button-width="178"
button-height="148"
img-url="/subpages/heart/images/publish.png"
button-width="196"
button-height="196"
img-url="{{buttonInfo.imgUrl}}"
bindmovebtnCallBack="toPublish"></move-btn>
<coverview-dialog bind:confirm="confirmDialog" dialogVisible="{{dialogVisible}}" title="{{dialogTitle}}"

134
subpages/heart/pages/groupBuyList/groupBuyList.wxss

@ -20,4 +20,136 @@ page {
.my-publish image {
height: 100%;
width: 100%;
}
}
/* notice list start */
.notice {
width: 750rpx;
background-color: #fff;
margin-top: 14rpx;
padding: 30rpx;
box-sizing: border-box;
display: flex;
justify-content: flex-start;
align-items: flex-start;
}
.notice-left {
width: 220rpx;
min-width: 220rpx;
height: 146rpx;
margin-right: 20rpx;
border-radius: 10rpx;
overflow: hidden;
}
.notice-left image {
width: 100%;
height: 100%;
}
.notice-right {
width: 100%;
height: 146rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.notice-title {
font-size: 34rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: normal !important;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.notice-bottom {
display: flex;
align-items: flex-end;
justify-content: space-between;
margin-top: 16rpx;
}
.bottom-left {
display: flex;
align-items: flex-end;
justify-content: flex-start;
}
.notice-tag {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
margin-right: 10rpx;
white-space: nowrap;
}
.tag-0 {
color: #00A066;
}
.tag-5 {
color: #E30000;
}
.tag-10 {
color: #999999;
}
.notice-time {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
white-space: nowrap;
}
.evaluate {
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 500;
color: #F2501B;
padding: 6rpx 12rpx;
border: 1rpx solid #F2501B;
border-radius: 32rpx;
width: 80rpx;
height: 32rpx;
line-height: 32rpx;
text-align: center;
}
.notice-detail {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: #F1551B;
width: 100rpx;
height: 80rpx;
line-height: 80rpx;
}
.notice-option {
width: 240rpx;
display: flex;
justify-content: space-around;
align-items: center;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: #D60000;
height: 80rpx;
line-height: 80rpx;
}
.notice-options {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: #D60000;
}
.notice-option .btn {
text-align: center;
width: 100rpx;
}
.notice-line {
width: 1px;
height: 30rpx;
background: #BFBFBF;
}
/* notice list end */

300
subpages/heart/pages/groupBuyListMy/groupBuyListMy.js

@ -0,0 +1,300 @@
// subpages/heart/pages/groupBuyListMy/groupBuyListMy.js
const api = require("../../utils/api")
Page({
/**
* 页面的初始数据
*/
data: {
pageIndex: 1,
pageSize: 10,
nodata: false,
loadMoreType: 'none',
loadMoreVisible: false,
groupbuylist: [],
selectedTab: "tab0",
dialogVisible: false,
dialogTitle: "",
dialogContent: "",
dialogConfirmText: "",
dialogCancelText: "",
noticeType: 3, //noticeNew 类型 3-我的参与 4-我的发布
cancelSignupVisible: false,
cancelSignupTipValue: "",
cancelSignupTipVisible: false,
selectNoticeId: '', //当前选中id 取消
noticeVisible: false, //提示框
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// this.getMyGroupBuyPublish()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData({
pageIndex: 1,
groupbuylist: []
})
this.getMyGroupBuyList()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 用户点击右上角分享
*/
// onShareAppMessage: function () {
// }
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.setData({
loadMoreVisible: true
})
if (this.data.loadMoreType === "loading") {
this.setData({
pageIndex: this.data.pageIndex + 1
})
this.getMyGroupBuyList()
}
},
// tab 切换
tabBarChange (e) {
this.setData({
loadMoreVisible: false,
loadMoreType: "none",
pageIndex: 1,
})
if (e.currentTarget.dataset.tab == "tab0") {
this.setData({
groupbuylist: []
})
this.getMyGroupBuyJoin()
} else if (e.currentTarget.dataset.tab == "tab1") {
this.setData({
groupbuylist: []
})
this.getMyGroupBuyPublish()
}
this.setData({
selectedTab: e.currentTarget.dataset.tab
})
},
getMyGroupBuyList () {
if (this.data.selectedTab == "tab0") {
this.getMyGroupBuyJoin()
} else {
this.getMyGroupBuyPublish()
}
},
getMyGroupBuyPublish () {
const para = {
pageIndex: this.data.pageIndex,
pageSize: this.data.pageSize
}
api.getMyGroupBuyPublish(para).then(res => {
console.log(res)
this.setData({
groupbuylist: [...this.data.groupbuylist,...res.data],
loadMoreType: res.data.length === this.data.pageSize ? 'loading' : 'none',
loadMoreVisible: res.data.length === this.data.pageSize ? false : true,
nodata: false,
})
if (this.data.groupbuylist.length == 0) {
this.setData({
nodata: true,
loadMoreType: 'none',
loadMoreVisible: false,
})
}
}).catch(err => {
this.setData({
groupbuylist: [],
nodata: true,
loadMoreType: 'none',
loadMoreVisible: false,
})
console.log(err)
})
},
getMyGroupBuyJoin () {
const para = {
pageIndex: this.data.pageIndex,
pageSize: this.data.pageSize
}
api.getMyGroupBuyJoin(para).then(res => {
console.log(res)
this.setData({
groupbuylist: [...this.data.groupbuylist,...res.data],
loadMoreType: res.data.length === this.data.pageSize ? 'loading' : 'none',
loadMoreVisible: res.data.length === this.data.pageSize ? false : true,
nodata: false,
})
if (this.data.groupbuylist.length == 0) {
this.setData({
nodata: true,
loadMoreType: 'none',
loadMoreVisible: false,
})
}
}).catch(err => {
this.setData({
groupbuylist: [],
nodata: true,
loadMoreType: 'none',
loadMoreVisible: false,
})
console.log(err)
})
},
//取消/结束接口函数
updateStatus () {
},
// 跳转发布
toPublish () {
console.log('发布')
api.getVolunteerVerify().then(res => {
if (res.code == 0) {
if (res.data && res.data.id) {
wx.navigateTo({
url: `/subpages/heart/pages/dropByPublish/dropByPublish`
})
} else {
this.setData({
dialogVisible: !this.data.dialogVisible,
dialogTitle: "志愿者认证",
dialogContent: ["是否认证志愿者,完成发布"],
dialogConfirmText: "是",
dialogCancelText: "否"
})
}
}
}).catch(err => {
console.log(err)
})
},
//志愿者认证
confirmDialog () {
wx.navigateTo({
url: "/subpages/heart/pages/volunteer/volunteer"
})
},
//前往评价
toEvaluate (e) {
const id = e.currentTarget.dataset.id
wx.navigateTo({
url: `/subpages/heart/pages/evaluate/evaluate?id=${id}`
})
},
//前往 详情
toNoticeDetail (e) {
const id = e.currentTarget.dataset.id
wx.navigateTo({
url: `/subpages/heart/pages/groupBuyDetail/groupBuyDetail?id=${id}`
})
},
//修改
toModify (e) {
if (e.currentTarget.dataset.edit == 0) {
return
}
const id = e.currentTarget.dataset.id
wx.navigateTo({
url: `/subpages/heart/pages/groupBuyPublish/groupBuyPublish?id=${id}`
})
},
//取消
toCancel (e) {
if (e.currentTarget.dataset.status != 0) {
return
}
this.setData({
cancelSignupVisible: !this.data.cancelSignupVisible,
cancelSignupTipValue: ``,
cancelSignupTipVisible: true,
selectNoticeId: e.currentTarget.dataset.id
})
},
cancelSignupCallback (e) {
const para = {
id: this.data.selectNoticeId,
status: '10',
cancelReason: e.detail.data
}
api.updateStatus(para).then(() => {
this.setData({
noticeVisible: !this.data.noticeVisible,
pageIndex: 1,
groupbuylist: []
})
this.getMyGroupBuyList()
}).catch(err => {
console.log(err)
})
},
// 关闭弹框
closeDialog () {
// wx.navigateBack()
},
//结束团购
toFinish (e) {
if (e.currentTarget.dataset.status != 0) {
return
}
const id = e.currentTarget.dataset.id
wx.navigateTo({
url: `/subpages/heart/pages/groupBuyDetail/groupBuyDetail?id=${id}&type=finish`
})
},
//确认交易
toConfirm (e) {
if (e.currentTarget.dataset.status == 10) {
return
}
const id = e.currentTarget.dataset.id
wx.navigateTo({
url: `/subpages/heart/pages/groupBuyConfirmList/groupBuyConfirmList?id=${id}`
})
}
})

10
subpages/heart/pages/groupBuyListMy/groupBuyListMy.json

@ -0,0 +1,10 @@
{
"navigationBarTitleText": "我的团购",
"usingComponents": {
"coverview-dialog": "../../components/coverViewDialog/coverViewDialog",
"load-more": "/components/loadMore/loadMore",
"no-data": "/components/nodata/nodata",
"notice": "../../components/notice/notice",
"cancel-signup-dialog": "../../components/cancelSignupDialog/cancelSignupDialog"
}
}

67
subpages/heart/pages/groupBuyListMy/groupBuyListMy.wxml

@ -0,0 +1,67 @@
<!--subpages/heart/pages/groupBuyListMy/groupBuyListMy.wxml-->
<view class="drop-by-list">
<view class="tab-all">
<view class="tab-bar">
<view class="tab tab0 {{selectedTab === 'tab0' ? 'select' : ''}}" data-tab="tab0" bindtap="tabBarChange">
我的参与
</view>
<view class="tab tab1 {{selectedTab === 'tab1' ? 'select' : ''}}" data-tab="tab1" bindtap="tabBarChange">
我的发布
</view>
<view class="select-bar {{selectedTab}}"></view>
</view>
</view>
<view class="item-list">
<block wx:if="{{selectedTab === 'tab0'}}">
<view class="notice" wx:for="{{groupbuylist}}" wx:key="index" data-id="{{item.id}}" bindtap="toNoticeDetail">
<view class="notice-left" wx:if="{{item.groupBuyImg.length > 0}}">
<image src="{{item.groupBuyImg[0]}}" />
</view>
<view class="notice-right">
<view class="notice-title">{{item.groupBuyTitle}}</view>
<view class="notice-bottom">
<view class="bottom-left">
<view class="notice-tag tag-{{item.groupBuyStatus}}">{{item.groupBuyStatus == '0' ? '团购中' : item.groupBuyStatus == '5' ? '已结束' : '已取消'}}</view>
<view class="notice-time">{{item.groupBuyPublishTime}}</view>
</view>
<view class="evaluate" wx:if="{{item.isEvaluation == '0'}}" data-id="{{item.id}}" catchtap="toEvaluate">评价</view>
</view>
</view>
</view>
</block>
<block wx:else>
<view class="notice" wx:for="{{groupbuylist}}" wx:key="index">
<view class="notice-right">
<view class="notice-title">{{item.groupBuyTitle}}</view>
<view class="notice-bottom">
<view class="notice-options">
<view class="notice-btn" data-id="{{item.id}}" catchtap="toNoticeDetail">查看</view>
<view class="notice-line"></view>
<view class="notice-btn {{item.isEdit == 0 ? 'notice-btn-disabled': ''}}" data-id="{{item.id}}" data-edit="{{item.isEdit}}" catchtap="toModify">修改</view>
<view class="notice-line"></view>
<view class="notice-btn {{item.groupBuyStatus != 0 ? 'notice-btn-disabled' : ''}}" data-id="{{item.id}}" data-status="{{item.groupBuyStatus}}" catchtap="toCancel">{{item.groupBuyStatus == 10 ? '已取消' : '取消'}}</view>
<view class="notice-line"></view>
<view class="notice-btn {{item.groupBuyStatus != 0 ? 'notice-btn-disabled' : ''}}" data-id="{{item.id}}" data-status="{{item.groupBuyStatus}}" catchtap="toFinish">{{item.groupBuyStatus == 5 ? '已结束' : '结束'}}</view>
<view class="notice-line"></view>
<view class="notice-btn {{item.groupBuyStatus == 10 ? 'notice-btn-disabled' : ''}}" data-id="{{item.id}}" data-status="{{item.groupBuyStatus}}" catchtap="toConfirm">确认交易</view>
</view>
</view>
</view>
</view>
</block>
</view>
</view>
<cancel-signup-dialog title="取消原因" cancelText="取消" confirmText="确定" tipVisible="{{cancelSignupTipVisible}}"
tipValue="{{cancelSignupTipValue}}" bind:confirm="cancelSignupCallback" cancelSignupVisible="{{cancelSignupVisible}}">
</cancel-signup-dialog>
<notice bind:close="closeDialog" bind:confirm="closeDialog" dialogVisible="{{noticeVisible}}" title="取消成功" content="" confirmText="知道了"></notice>
<coverview-dialog bind:confirm="confirmDialog" dialogVisible="{{dialogVisible}}" title="{{dialogTitle}}"
content="{{dialogContent}}" confirmText="{{dialogConfirmText}}" cancelText="{{dialogCancelText}}">
</coverview-dialog>
<load-more loadMoreType="{{loadMoreType}}" loadMoreVisible="{{loadMoreVisible}}"></load-more>
<no-data isShow="{{nodata}}"></no-data>

201
subpages/heart/pages/groupBuyListMy/groupBuyListMy.wxss

@ -0,0 +1,201 @@
/* subpages/heart/pages/groupBuyListMy/groupBuyListMy.wxss */
page {
width: 100%;
height: auto;
overflow-y: auto;
background: #f7f7f7;
}
.drop-by-list {
position: relative;
overflow: hidden;
}
/* tab start */
.tab-all {
width: 100%;
height: 90rpx;
background-color: #fff;
}
.tab-bar {
width: 100%;
height: 90rpx;
background: #fff;
display: flex;
align-items: center;
position: relative;
}
.tab-bar-fixed {
position: fixed;
top: 0rpx;
}
.tab-bar .tab {
font-size: 34rpx;
font-weight: 500;
color: rgba(171, 171, 171, 1);
width: 50%;
height: 100%;
line-height: 92rpx;
/* text-indent: 20rpx; */
text-align: center;
position: relative;
z-index: 10;
}
.tab-bar .tab.select {
font-size: 36rpx;
font-weight: bold;
color: rgba(229, 15, 0, 1);
}
.tab-bar .select-bar {
position: absolute;
left: 14rpx;
bottom: 0rpx;
width: 30rpx;
height: 8rpx;
border-radius: 4rpx;
background: #fc5555;
z-index: 1;
}
.tab-bar .tab0.select-bar {
left: calc(25% - 15rpx);
transition: left 0.3s linear;
}
.tab-bar .tab1.select-bar {
left: calc(75% - 15rpx);
transition: left 0.3s linear;
}
/* tab end */
/* list start */
.notice {
width: 750rpx;
background-color: #fff;
margin-top: 14rpx;
padding: 30rpx 30rpx 10rpx 30rpx;
box-sizing: border-box;
display: flex;
justify-content: flex-start;
align-items: flex-start;
}
.notice-left {
width: 220rpx;
min-width: 220rpx;
height: 146rpx;
margin-right: 20rpx;
border-radius: 10rpx;
overflow: hidden;
}
.notice-left image {
width: 100%;
height: 100%;
}
.notice-right {
width: 100%;
height: 146rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.notice-title {
font-size: 34rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
white-space: normal !important;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.notice-bottom {
display: flex;
align-items: flex-end;
justify-content: space-between;
margin-top: 8rpx;
}
.bottom-left {
display: flex;
align-items: flex-end;
justify-content: flex-start;
}
.notice-tag {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
margin-right: 10rpx;
white-space: nowrap;
}
.tag-0 {
color: #00A066;
}
.tag-5 {
color: #E30000;
}
.tag-10 {
color: #999999;
}
.notice-time {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
white-space: nowrap;
}
.evaluate {
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 500;
color: #F2501B;
padding: 6rpx 12rpx;
border: 1rpx solid #F2501B;
border-radius: 32rpx;
width: 80rpx;
height: 32rpx;
line-height: 32rpx;
text-align: center;
}
.notice-detail {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: #F1551B;
width: 100rpx;
height: 80rpx;
line-height: 80rpx;
}
.notice-options {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
color: #F1551B;
height: 50rpx;
line-height: 50rpx;
}
.notice-options .notice-btn {
text-align: center;
width: 120rpx;
}
.notice-options .notice-btn:first-child {
text-align: left;
width: 80rpx;
}
.notice-options .notice-btn-disabled {
color: #C1C1C1;
}
.notice-line {
width: 1px;
height: 30rpx;
background: #BFBFBF;
}
/* list end */

241
subpages/heart/pages/groupBuyPublish/groupBuyPublish.js

@ -1,6 +1,8 @@
// subpages/heart/pages/groupBuyPublish/groupBuyPublish.js
const api = require("../../utils/api")
import { $wuxActionSheet } from "../../../../dist/index"
import { getTimestamp } from '../../../../utils/common'
const api = require("../../utils/api")
const config = require("../../../../utils/config")
Page({
@ -11,15 +13,24 @@ Page({
dialogVisible: false, //提示框
showPicker: false, //是否显示底部时间选择器插件
dataForm: {
groupBuyTitle: '', //标题
groupBuyContent: '', //内容
groupBuyTime: '', //团购时间
groupBuyMobile: '', //手机
id: '', //主键 更新时携带
id: '', //主键 更新时携带
groupBuyTitle: '', //标题
groupBuyContent: '', //内容
// groupBuyTime: '', //团购时间
groupBuyMobile: '', //手机
groupBuyPriceNumber: [
{
groupBuyNumber: '',
groupBuyPrice: ''
}
], //groupBuyNumber, groupBuyPrice 团购价格人数(最多五条)
groupBuyImg: [], //团购图片(最多三张)
},
violationsCount: 0, //内容审核计数
isConReview: false, //内容审核标志
lock: false, //锁定发布按钮状态,防止连击
uploadImageList: [],
imageId: 0,
},
/**
@ -88,6 +99,24 @@ Page({
'dataForm.groupBuyTitle': e.detail.value
})
},
onInputGroupBuyNumber (e) {
let index = e.currentTarget.dataset.index
this.data.dataForm.groupBuyPriceNumber[index].groupBuyNumber = parseInt(e.detail.value)
this.setData({
'dataForm.groupBuyPriceNumber': this.data.dataForm.groupBuyPriceNumber
})
},
onInputGroupBuyPrice (e) {
let index = e.currentTarget.dataset.index
if (/^(\d?)+(\.\d{0,2})?$/.test(e.detail.value)) {
this.data.dataForm.groupBuyPriceNumber[index].groupBuyPrice = e.detail.value;
} else {
this.data.dataForm.groupBuyPriceNumber[index].groupBuyPrice = e.detail.value.substring(0, e.detail.value.length - 1);
}
this.setData({
'dataForm.groupBuyPriceNumber': this.data.dataForm.groupBuyPriceNumber
})
},
onInputGroupBuyMobile (e) {
this.setData({
'dataForm.groupBuyMobile': e.detail.value
@ -98,32 +127,45 @@ Page({
'dataForm.groupBuyContent': e.detail.value
})
},
pickerCancel () {
console.log('取消日期选择')
addPriceItem () {
this.data.dataForm.groupBuyPriceNumber.push({groupBuyNumber:'',groupBuyPrice:''})
this.setData({
showPicker: false,
'dataForm.groupBuyTime': ''
'dataForm.groupBuyPriceNumber': this.data.dataForm.groupBuyPriceNumber
})
},
pickerConfirm (e) {
console.log('选择日期', e.detail.time)
if (e.detail.time < getTimestamp()) {
this.showToast("团购时间应该大于当前时间")
} else {
this.setData({
showPicker: false,
'dataForm.groupBuyTime': e.detail.time
})
}
},
//日期选择插件显示入口
selectTime (e) {
this.data.showPicker = !this.data.showPicker
minusPriceItem (e) {
let index = e.currentTarget.dataset.index
this.data.dataForm.groupBuyPriceNumber.splice(index, 1)
this.setData({
showPicker: this.data.showPicker,
'dataForm.groupBuyTime': this.data.dataForm.groupBuyTime || getTimestamp()
'dataForm.groupBuyPriceNumber': this.data.dataForm.groupBuyPriceNumber
})
},
// pickerCancel () {
// console.log('取消日期选择')
// this.setData({
// showPicker: false,
// 'dataForm.groupBuyTime': ''
// })
// },
// pickerConfirm (e) {
// console.log('选择日期', e.detail.time)
// if (e.detail.time < getTimestamp()) {
// this.showToast("团购时间应该大于当前时间")
// } else {
// this.setData({
// showPicker: false,
// 'dataForm.groupBuyTime': e.detail.time
// })
// }
// },
// //日期选择插件显示入口
// selectTime (e) {
// this.data.showPicker = !this.data.showPicker
// this.setData({
// showPicker: this.data.showPicker,
// 'dataForm.groupBuyTime': this.data.dataForm.groupBuyTime || getTimestamp()
// })
// },
//发布
submitApply () {
if (this.data.lock) {
@ -137,10 +179,10 @@ Page({
this.showToast("标题限制在50字以内")
return false
}
if (!this.data.dataForm.groupBuyTime) {
this.showToast("请填写团购时间")
return false
}
// if (!this.data.dataForm.groupBuyTime) {
// this.showToast("请填写团购时间")
// return false
// }
if (!this.data.dataForm.groupBuyContent) {
this.showToast("请填写团购内容")
return false
@ -149,6 +191,10 @@ Page({
this.showToast("团购内容限制在500字以内")
return false
}
if (!this.data.dataForm.groupBuyPriceNumber[0].groupBuyNumber || !this.data.dataForm.groupBuyPriceNumber[0].groupBuyPrice) {
this.showToast("至少填写一条价格说明")
return false
}
if (!this.data.dataForm.groupBuyMobile) {
this.showToast("请填写联系电话")
return false
@ -160,11 +206,29 @@ Page({
wx.showLoading({
title: "发布中",
})
const imagesList = []
if (this.data.uploadImageList.length > 0) {
const isUploadDown = this.data.uploadImageList.some(item => !item.uploaded)
if (isUploadDown) {
wx.showToast({
title: "请等待图片上传完成",
icon: "none",
duration: 1000
})
return false
}
}
if (this.data.uploadImageList.length > 0) {
this.data.uploadImageList.forEach(item => {
imagesList.push(item.ossUrl)
})
}
this.setData({
lock: true
})
const para = { ...this.data.dataForm }
para.isConReview = this.data.isConReview
para.groupBuyImg = imagesList
console.log('submit', para)
let that = this
api.groupBuyUpdate(para).then(res => {
@ -225,9 +289,20 @@ Page({
})
api.getGroupBuyDetail(this.data.dataForm.id).then(res => {
wx.hideLoading()
res.data.groupBuyImg.forEach( (item, index) => {
let ob = {
imageId: index,
ossUrl: item,
imgUrl: item,
uploaded: true
}
this.data.uploadImageList.push(ob)
})
this.setData({
dataForm: res.data
dataForm: res.data,
uploadImageList: this.data.uploadImageList
})
console.log(this.data.uploadImageList)
})
},
@ -252,4 +327,108 @@ Page({
delta: 1
})
},
// 删除选中的图片
deleteImage (e) {
const index = this.data.uploadImageList.findIndex(item => item.imageId === e.currentTarget.dataset.imageid)
if (index > -1) {
this.data.uploadImageList.splice(index, 1)
this.setData({
uploadImageList: this.data.uploadImageList
})
}
},
// 选择图片 上传弹窗 - 上传图片方式 - 选择图片 - 上传图片 - 回调赋值
chooseImage () {
const _this = this
$wuxActionSheet().showSheet({
buttons: [
{ text: "拍照" },
{ text: "从相册中获取" },
],
className: "dialog-class",
buttonClicked (index) {
if (index === 0) {
wx.chooseImage({
count: 1,
sizeType: ["original", "compressed"],
sourceType: ["camera"],
success (res) {
const uploadImageList = [..._this.data.uploadImageList]
uploadImageList.push({
uploaded: false,
ossUrl: "",
imgUrl: res.tempFilePaths[0],
imageId: ++_this.data.imageId
})
_this.setData({
uploadImageList
})
wx.uploadFile({
url: `${config.BASEURL()}group/topic/upload`,
filePath: res.tempFilePaths[0],
name: "file",
header: {
"Content-type": "multipart/form-data"
},
success (fileRes){
uploadImageList[uploadImageList.length - 1].uploaded = true
uploadImageList[uploadImageList.length - 1].ossUrl = JSON.parse(fileRes.data).data
_this.setData({
uploadImageList
})
}
})
}
})
} else if (index === 1) {
wx.chooseImage({
count: 3 - _this.data.uploadImageList.length,
sizeType: ["original", "compressed"],
sourceType: ["album"],
success (res) {
const uploadImageList = []
const endIndex = _this.data.uploadImageList.length
res.tempFilePaths.forEach(item => {
uploadImageList.push({
uploaded: false,
ossUrl: "",
imgUrl: item,
imageId: ++_this.data.imageId
})
})
_this.setData({
uploadImageList: [..._this.data.uploadImageList,...uploadImageList]
})
uploadImageList.forEach((item, index) => {
return (function (index) {
wx.uploadFile({
url: `${config.BASEURL()}group/topic/upload`,
filePath: res.tempFilePaths[index],
name: "file",
header: {
"Content-type": "multipart/form-data"
},
success (fileRes){
uploadImageList[index].uploaded = true
uploadImageList[index].ossUrl = JSON.parse(fileRes.data).data
_this.data.uploadImageList = _this.data.uploadImageList.slice(0, endIndex)
_this.setData({
uploadImageList: [..._this.data.uploadImageList, ...uploadImageList]
})
}
})
})(index)
})
}
})
}
return true
},
cancelText: "取消",
cancel () {},
destructiveButtonClicked () {},
})
},
})

3
subpages/heart/pages/groupBuyPublish/groupBuyPublish.json

@ -2,6 +2,7 @@
"navigationBarTitleText": "发布",
"usingComponents": {
"date-time-picker": "../../../../components/DateTimePicker/index",
"notice": "../../components/notice/notice"
"notice": "../../components/notice/notice",
"wux-actionsheet": "../../../../dist/actionsheet/index"
}
}

35
subpages/heart/pages/groupBuyPublish/groupBuyPublish.wxml

@ -5,14 +5,37 @@
<view class="item-title">标题</view>
<input type="text" class="item-content" placeholder="请输入标题" value="{{dataForm.groupBuyTitle}}" bindinput="onInputGroupBuyTitle"></input>
</view>
<view class="apply-item">
<!-- <view class="apply-item">
<view class="item-title">团购时间</view>
<view class="select-time" bindtap="selectTime">{{dataForm.groupBuyTime||'请选择时间'}}</view>
</view>
</view> -->
<view class="apply-item">
<view class="item-title" style="margin-top:20rpx">内容</view>
<textarea class="item-content text-content" maxlength="500" placeholder="请输入内容" value="{{dataForm.groupBuyContent}}" bindinput="onInputContent"><span class="text-length">{{dataForm.groupBuyContent.length}}/500</span></textarea>
<textarea class="item-content text-content" maxlength="500" placeholder="请输入内容" value="{{dataForm.groupBuyContent}}" bindinput="onInputContent">
<!-- <span class="text-length">{{dataForm.groupBuyContent.length}}/500</span> -->
</textarea>
<view class="image-list">
<view class="image-item" wx:for="{{uploadImageList}}" wx:for-index="index" wx:for-item="item" wx:key="imageId">
<image class="issue-image" src="{{item.imgUrl}}" />
<image wx:if="{{!item.uploaded}}" class="loading" src="../../images/loading.gif" />
<image bindtap="deleteImage" data-imageid="{{item.imageId}}" class="close" wx:else src="../../images/icon_close.png" />
</view>
<image wx:if="{{uploadImageList.length < 3}}" src="../../images/ig_tianjiatupian@2x.png" bindtap="chooseImage" />
</view>
</view>
<view class="apply-item">
<view class="item-title">价格</view>
<view class="price-item" wx:for="{{dataForm.groupBuyPriceNumber}}" wx:key="index">
<view class="tip">人数达到</view>
<input type="number" value="{{item.groupBuyNumber}}" data-index="{{index}}" bindinput="onInputGroupBuyNumber"></input>
<view class="tip">人团购价格为</view>
<input type="number" value="{{item.groupBuyPrice}}" data-index="{{index}}" bindinput="onInputGroupBuyPrice"></input>
<view class="tip">元/件</view>
<view class="add" bindtap="addPriceItem" wx:if="{{(index < 4) && (index == dataForm.groupBuyPriceNumber.length-1)}}"><image src="../../images/add.png" /></view>
<view class="add" data-index="{{index}}" bindtap="minusPriceItem" wx:else><image src="../../images/minus.png" /></view>
</view>
</view>
<view class="apply-item">
<view class="item-title">联系电话</view>
<input type="text" class="item-content" maxlength="20" placeholder="请输入联系电话" value="{{dataForm.groupBuyMobile}}" bindinput="onInputGroupBuyMobile"></input>
@ -24,8 +47,10 @@
</view>
</view>
<view wx:if="{{showPicker}}">
<wux-actionsheet id="wux-actionsheet" />
<!-- <view wx:if="{{showPicker}}">
<date-time-picker bind:cancel="pickerCancel" bind:confirm="pickerConfirm" init-time="{{dataForm.groupBuyTime}}"></date-time-picker>
</view>
</view> -->
<notice bind:close="closeDialog" bind:confirm="confirmDialog" dialogVisible="{{dialogVisible}}" title="发布成功" content="" confirmText="知道了"></notice>

67
subpages/heart/pages/groupBuyPublish/groupBuyPublish.wxss

@ -41,6 +41,36 @@ page {
color: #333333;
margin-bottom: 28rpx;
}
.content .apply-item .price-item {
display: flex;
margin-bottom: 20rpx;
}
.content .apply-item .price-item input {
width: 110rpx;
height: 44rpx;
line-height: 44rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #666666;
text-align: center;
border-bottom: 1px solid #BFBFBF;
}
.content .apply-item .price-item .add {
height: 42rpx;
width: 42rpx;
margin-left: 20rpx;
}
.content .apply-item .price-item .add image {
width: 100%;
height: 100%;
}
.content .apply-item .price-item .tip {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
.content .apply-item .item-content, .select-time {
width: 100%;
height: 44rpx;
@ -53,7 +83,7 @@ page {
.content .apply-item .text-content {
font-weight: 400;
height: 280rpx;
margin-bottom: 80rpx;
margin-bottom: 20rpx;
}
.text-length {
position: absolute;
@ -110,4 +140,39 @@ page {
height: 26rpx;
opacity: 0.76;
margin-right: 20rpx;
}
.image-list {
width: 100%;
display: grid;
grid-template-columns: 214rpx 214rpx 214rpx;
grid-template-rows: 214rpx;
grid-gap: 17rpx;
height: 214rpx;
margin-bottom: 40rpx;
}
.image-list .image-item {
width: 100%;
height: 100%;
position: relative;
}
.image-list image {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 8rpx;
}
.image-list .image-item .loading {
position: absolute;
left: 25%;
top: 25%;
width: 50%;
height: 50%;
}
.image-list .image-item .close {
position: absolute;
top: -10rpx;
right: -10rpx;
width: 40rpx;
height: 40rpx;
}

8
subpages/heart/pages/volunteer/volunteer.js

@ -256,10 +256,10 @@ Page({
this.showToast("请输入昵称")
return false
}
if(!this.data.volunteerSignature){
this.showToast("请输入格言")
return false
}
// if(!this.data.volunteerSignature){
// this.showToast("请输入格言")
// return false
// }
if (!this.data.road) {
this.showToast("请填写所在小区或所在道路")
return false

64
subpages/heart/utils/api.js

@ -12,6 +12,14 @@ module.exports = {
groupBuyCall,
getImgUrl,
getVolunteerVerify,
getMyGroupBuyJoin,
getMyGroupBuyPublish,
getEvaluationList,
evaluation,
updateStatus,
getGroupBuySignUpList,
tradeConfirmation,
signUpOrCancel,
}
//顺道捎-首页列表
@ -44,9 +52,8 @@ function sdsCall (id) {
}
//拼团购-首页列表
function getGroupBuyList ({ isMe, pageIndex, pageSize }) {
function getGroupBuyList ({ pageIndex, pageSize }) {
return fly.get("custom/groupBuy/getGroupBuyList", {
isMe,
pageIndex,
pageSize
})
@ -80,4 +87,57 @@ function getImgUrl (imgType) {
// 获取志愿者认证标志
function getVolunteerVerify () {
return fly.get(`app-user/user/volunteerVerify`)
}
//拼团购-我的参与
function getMyGroupBuyJoin ({ pageIndex, pageSize }) {
return fly.get("custom/groupBuy/getMyGroupBuyJoin", {
pageIndex,
pageSize
})
}
//拼团购-我的发布
function getMyGroupBuyPublish ({ pageIndex, pageSize }) {
return fly.get("custom/groupBuy/getMyGroupBuyPublish", {
pageIndex,
pageSize
})
}
//拼团购-评价列表
function getEvaluationList ({ groupBuyId, pageIndex, pageSize }) {
return fly.get("custom/groupBuy/getEvaluationList", {
groupBuyId,
pageIndex,
pageSize
})
}
//拼团购-评价
function evaluation (para) {
return fly.post("custom/groupBuy/evaluation", para)
}
//拼团购-我的发布取消/结束
function updateStatus (para) {
return fly.post("custom/groupBuy/updateStatus", para)
}
//拼团购-交易确认列表
function getGroupBuySignUpList ({ id, pageIndex, pageSize }) {
return fly.get("custom/groupBuy/getGroupBuySignUpList", {
id,
pageIndex,
pageSize
})
}
//拼团购-交易确认
function tradeConfirmation (para) {
return fly.post("custom/groupBuy/tradeConfirmation", para)
}
//拼团购-报名/取消报名
function signUpOrCancel (para) {
return fly.post("custom/groupBuy/signUpOrCancel", para)
}
Loading…
Cancel
Save