作者 wumengyu

添加长按删除订单功能,添加城市列表搜索功能,添加答题之后提示框,个人资料改成性别可选,手机号可输入,添加取消订单逻辑,参与之后添加返回首页,修改发布文案

... ... @@ -72,7 +72,7 @@ Page({
wx.chooseLocation({
success(res) {
console.log(res);
self.setData({address_position: res.address,latng:res.latitude + ',' + res.longitude})
self.setData({address_position: res.address !== ''?res.address:res.name,latng:res.latitude + ',' + res.longitude})
},
})
//打开地图导航
... ...
... ... @@ -91,7 +91,7 @@
<text class="iconfont icon-location"></text>
</view>
<view class="time-limit">
<text>时限 活动开始前</text>
<text class="limit-title">活动前</text>
<input type="number" bindinput="inputOverTime" value="{{over_time}}"/>
<text>小时 停止拼单</text>
</view>
... ...
... ... @@ -98,6 +98,10 @@
width:96rpx;
text-align:right;
}
.limit-title {
width:96rpx;
text-align:right;
}
.min-num .input {
width: 160rpx;
height: 38rpx;
... ...
... ... @@ -50,7 +50,7 @@ Page({
},
//完成按钮
goBack() {
wx.redirectTo({url:'/pages/spell-list/spell-list?current=' + 1})
wx.redirectTo({url:'/pages/index/index'})
},
disableScroll() {
},
... ... @@ -665,8 +665,8 @@ Page({
y: 0,
width: 280,
height: 400,
destWidth: 1120,
destHeight: 1600,
destWidth: 840,//是width的3倍
destHeight: 1400,//是高的3.5倍
canvasId: 'canvas',
fileType: 'jpg',
quality:1,
... ... @@ -747,27 +747,54 @@ Page({
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
onShareAppMessage: function (res) {
console.log('转发res',res);
let self = this;
// 设置菜单中的转发按钮触发转发事件时的转发内容
var shareObj = {
title: '火柴西路', // 默认是小程序的名称(可以写slogan等)
path: '', // 默认是当前页面,必须是以‘/’开头的完整路径
imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
success: function (res) {
if (res.errMsg == 'shareAppMessage:ok') {
if(res.from === 'button') {
return {
title: self.data.detail.title, // 默认是小程序的名称(可以写slogan等)
path: '/pages/activity/detail/detail?id=' + self.data.detail_id, // 默认是当前页面,必须是以‘/’开头的完整路径
imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
success: function (res) {
if (res.errMsg == 'shareAppMessage:ok') {
console.log('转发成功之后');
}
},
fail: function () {
// 转发失败之后的回调
if (res.errMsg == 'shareAppMessage:fail cancel') {
// 用户取消转发
} else if (res.errMsg == 'shareAppMessage:fail') {
// 转发失败,其中 detail message 为详细失败信息
}
},
complete: function () {
// 转发结束之后的回调(转发成不成功都会执行)
console.log('转发结束之后');
}
},
fail: function () {
// 转发失败之后的回调
if (res.errMsg == 'shareAppMessage:fail cancel') {
// 用户取消转发
} else if (res.errMsg == 'shareAppMessage:fail') {
// 转发失败,其中 detail message 为详细失败信息
}
}else {
return {
title: self.data.detail.title, // 默认是小程序的名称(可以写slogan等)
path: '/pages/activity/detail/detail?id=' + self.data.detail_id, // 默认是当前页面,必须是以‘/’开头的完整路径
imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
success: function (res) {
if (res.errMsg == 'shareAppMessage:ok') {
console.log('转发成功之后');
}
},
fail: function () {
// 转发失败之后的回调
if (res.errMsg == 'shareAppMessage:fail cancel') {
// 用户取消转发
} else if (res.errMsg == 'shareAppMessage:fail') {
// 转发失败,其中 detail message 为详细失败信息
}
},
complete: function () {
// 转发结束之后的回调(转发成不成功都会执行)
console.log('转发结束之后');
}
},
complete: function () {
// 转发结束之后的回调(转发成不成功都会执行)
}
}
},
... ...
... ... @@ -215,7 +215,7 @@
<image class="sorry-img" src="../../../images/success@2x.png"></image>
<view class="title">恭喜您拼活动成功</view>
<view class="view-btn" catchtap="goMyOrder">查看我的订单</view>
<view class="complete-btn" catchtap="goBack">完成</view>
<view class="complete-btn" catchtap="goBack">再逛逛</view>
</view>
<view class="modal_box" wx:if="{{is_showRelease_modal}}" bindtap="handleBackground"
catchtouchmove="disableScroll"></view>
... ...
... ... @@ -9,6 +9,47 @@ Page({
current: 0,
list:[],
status:0,
searchValue: '',
searchHistory:[],
},
inputFocus() {
// this.setData({postList:[]})
},
//输入搜索内容
inputKey(e) {
this.setData({searchValue: e.detail.value})
},
//搜索结果
startSearch() {
let self = this;
let url = '/portal/Index/addrFind';
let header = {
"XX-Token": wx.getStorageSync('token')
};
let params = {
token: wx.getStorageSync('token'),
keyword:self.data.searchValue,
};
app.post(url, params, header).then((res) => {
console.log('搜索历史列表', res);
// wx.hideLoading();
if(+res.code === 1) {
if(res.data.length === 0) {
wx.showToast({title:'暂无更多内容',icon:'none'})
}else {
const arr = [];
res.data.forEach((item)=> {
arr.push(item.title)
})
self.setData({
city_picker_list: arr,
cityList:res.data,
});
}
}
})
},
//tab点击事件
chargeTab(e) {
... ... @@ -17,7 +58,7 @@ Page({
current: current,
});
if(current === 0) {
this.getCityList()
this.getCityList();
}else if(current === 1) {
this.getAbroadList()
}
... ... @@ -88,7 +129,10 @@ Page({
onLoad: function (options) {
this.getCityList();
},
onPageScroll: function (res) {
// console.log(res);
// this.setData({scroll_top:res.scrollTop})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ...
... ... @@ -4,7 +4,12 @@
<view class="tab_item {{current==0?'active':''}}" data-current='{{0}}' bindtap='chargeTab'>国内</view>
<view class="tab_item {{current==1?'active':''}}" data-current='{{1}}' bindtap='chargeTab'>国际</view>
</view>
<view class="city-box">
<view class="right" wx:if="{{current===1}}">
<input class="input" type="text" placeholder="搜索国家" bindinput="inputKey" bindfocus="inputFocus" value="{{searchValue}}" bindconfirm="startSearch" />
<image src="../../../images/search@2x.png" class="search-icon" bindtap="startSearch"></image>
<!--<view class="iconfont icon-arrow-down"></view>-->
</view>
<view class="city-box {{current===1?'margin':''}}">
<view wx:for="{{city_picker_list}}" wx:key="index">
<view class="city-item {{current_city === index?'change-bg':''}}" bindtap="chooseCity" data-index="{{index}}">{{item}}</view>
</view>
... ...
... ... @@ -2,11 +2,24 @@
page {
height: 100%;
background-color: #f5f6f8;
overflow-y:hidden;
}
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
display: none;
}
.content {
height: 100%;
background-color: #f5f6f8;
}
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
display: none;
}
.tab_box {
width: 100%;
/* padding: 0 70rpx; */
... ... @@ -29,21 +42,50 @@ page {
}
.tab_item {
width:50%;
display: inline-block;
/* display: inline-block; */
/* width: 160rpx; */
font-size: 30rpx;
color: #333333;
position: relative;
/* position: relative; */
text-align: center;
border-bottom: 4rpx solid transparent;
/* border: 1rpx solid red; */
}
.tab_box .active {
border-bottom: 4rpx solid #DB4E2A;
border-bottom: 6rpx solid #DB4E2A;
/*font-weight: bold;*/
/*color: #0E050A;*/
}
.right {
width: 100%;
/* height: 58rpx; */
/*margin-top: 90rpx;*/
/*background-color: rgba(255,255,255,0.35);*/
background-color: #f5f6f8;
display: flex;
align-items: center;
justify-content: space-between;
padding: 20rpx 40rpx;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
position: fixed;
top:90rpx;
left:0;
}
.search-icon {
width: 34rpx;
height: 34rpx;
}
.input {
width: 90%;
height:58rpx;
color: #666666;
padding-left: 20rpx;
font-size: 28rpx;
background-color: #e9e9e9;
border-radius: 10rpx;
}
/*.tab_box .active::after {*/
/*content: "";*/
/*!*border: 2rpx solid #DB4E2A;*!*/
... ... @@ -56,7 +98,7 @@ page {
/*background: #2C82E6;*/
/*}*/
.city-box {
margin-top: 104rpx;
margin-top: 90rpx;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
... ... @@ -65,6 +107,12 @@ page {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
display: none;
}
.city-item {
padding: 10rpx 40rpx;
font-size: 28rpx;
... ... @@ -78,4 +126,7 @@ page {
.change-bg {
background-color: #DB4E2A;
color: #ffffff;
}
.margin {
margin-top: 160rpx;
}
\ No newline at end of file
... ...
... ... @@ -37,6 +37,7 @@ Page({
is_showAnswer: false,
is_showUserInfo: false,
is_showRelease: false,
is_showResult:false,
is_write: 2,//1:已填写,2:未填写
is_answer: false,
current_swiper: 0,
... ... @@ -57,7 +58,7 @@ Page({
},
//关闭金火柴勋章弹框
close() {
this.setData({show_gold_modal: false, show_normal_modal: false});
this.setData({show_gold_modal: false, show_normal_modal: false,is_showResult:false});
try {
wx.removeStorageSync('score');
console.log('删除后score', wx.getStorageSync('score'));
... ... @@ -104,6 +105,7 @@ Page({
is_showAnswer: false,
is_showUserInfo: false,
is_showRelease: false,
is_showResult: false,
is_show_city: false,
})
},
... ... @@ -269,7 +271,10 @@ Page({
is_showRelease: true //弹出 发布弹框
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 1) {
wx.showToast({title: '等级不够,无法使用发布功能', icon: 'none'})
// wx.showToast({title: '等级不够,无法使用发布功能', icon: 'none'});
self.setData({
is_showResult: true //弹出 提示框
});
}
}
},
... ...
... ... @@ -208,4 +208,14 @@
</view>
<view class="modal_box" wx:if="{{show_normal_modal}}" bindtap="handleBackground"
catchtouchmove="disableScroll"></view>
<!--答完题点击发布按钮弹框-->
<view class="input-box score-box normal-box" wx:if="{{is_showResult}}" catchtouchmove="disableScroll">
<image class="sorry-img img" src="../../images/achieve-answer-img@2x.png"></image>
<view class="title text margin">已通过测试</view>
<view class="title text margin">等待开放权限</view>
<view class="answer-btn close close-btn" catchtap="close">随便看看</view>
</view>
<view class="modal_box" wx:if="{{is_showResult}}" bindtap="handleBackground"
catchtouchmove="disableScroll"></view>
</view>
... ...
... ... @@ -50,7 +50,7 @@ Page({
},
//完成按钮
goBack() {
wx.redirectTo({url:'/pages/spell-list/spell-list?current=' + 0})
wx.redirectTo({url:'/pages/index/index'})
},
disableScroll() {
},
... ... @@ -673,8 +673,8 @@ Page({
y: 0,
width: 280,
height: 400,
destWidth: 1120,
destHeight: 1600,
destWidth: 840,
destHeight: 1400,
canvasId: 'canvas',
fileType: 'jpg',
quality:1,
... ... @@ -702,27 +702,52 @@ Page({
}
},
onShareAppMessage: function() {
onShareAppMessage: function(res) {
console.log('转发res',res);
let self = this;
self.setData({show_canvas:false,});
// 设置菜单中的转发按钮触发转发事件时的转发内容
var shareObj = {
title: '火柴西路', // 默认是小程序的名称(可以写slogan等)
path: '', // 默认是当前页面,必须是以‘/’开头的完整路径
imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
success: function(res) {
if (res.errMsg == 'shareAppMessage:ok') {}
},
fail: function() {
// 转发失败之后的回调
if (res.errMsg == 'shareAppMessage:fail cancel') {
// 用户取消转发
} else if (res.errMsg == 'shareAppMessage:fail') {
// 转发失败,其中 detail message 为详细失败信息
if(res.from === 'button') {
return {
title: self.data.detail.title, // 默认是小程序的名称(可以写slogan等)
path: '/pages/meal/detail/detail?id=' + self.data.detail_id, // 默认是当前页面,必须是以‘/’开头的完整路径
imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
success: function (res) {
if (res.errMsg == 'shareAppMessage:ok') {
console.log('转发成功之后');
}
},
fail: function () {
// 转发失败之后的回调
if (res.errMsg == 'shareAppMessage:fail cancel') {
// 用户取消转发
} else if (res.errMsg == 'shareAppMessage:fail') {
// 转发失败,其中 detail message 为详细失败信息
}
},
complete: function () {
// 转发结束之后的回调(转发成不成功都会执行)
console.log('转发结束之后');
}
}
}else {
return {
title: self.data.detail.title, // 默认是小程序的名称(可以写slogan等)
path: '/pages/meal/detail/detail?id=' + self.data.detail_id, // 默认是当前页面,必须是以‘/’开头的完整路径
imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
success: function(res) {
if (res.errMsg == 'shareAppMessage:ok') {}
},
fail: function() {
// 转发失败之后的回调
if (res.errMsg == 'shareAppMessage:fail cancel') {
// 用户取消转发
} else if (res.errMsg == 'shareAppMessage:fail') {
// 转发失败,其中 detail message 为详细失败信息
}
},
complete: function() {
// 转发结束之后的回调(转发成不成功都会执行)
}
},
complete: function() {
// 转发结束之后的回调(转发成不成功都会执行)
}
}
},
... ...
... ... @@ -221,7 +221,7 @@
<image class="sorry-img" src="../../../images/success@2x.png"></image>
<view class="title">恭喜您拼餐成功</view>
<view class="view-btn" catchtap="goMyRelease">查看我的订单</view>
<view class="complete-btn" catchtap="goBack">完成</view>
<view class="complete-btn" catchtap="goBack">再逛逛</view>
</view>
<view class="modal_box" wx:if="{{is_showRelease_modal}}" bindtap="handleBackground"
catchtouchmove="disableScroll"></view>
... ...
... ... @@ -69,7 +69,7 @@ Page({
wx.chooseLocation({
success(res) {
console.log(res);
self.setData({address_position: res.address,latng:res.latitude + ',' + res.longitude})
self.setData({address_position: res.address !== ''?res.address:res.name,latng:res.latitude + ',' + res.longitude})
},
})
//打开地图导航
... ...
... ... @@ -100,7 +100,7 @@
<text class="iconfont icon-location"></text>
</view>
<view class="time-limit">
<text class="limit-title">时限 开餐前</text>
<text class="limit-title">开餐前</text>
<input type="number" bindinput="inputOverTime" value="{{over_time}}"/>
<text>小时 停止拼餐</text>
</view>
... ...
... ... @@ -18,7 +18,8 @@
right:0;
}
.time-limit .limit-title {
width:173rpx;
/* width:173rpx; */
width:96rpx;
text-align: right;
}
.variety-text {
... ...
... ... @@ -186,8 +186,10 @@ Page({
},
//保存
submit() {
console.log('this.data.phone_number.length', this.data.phone_number.length);
if(this.data.country === '' && this.data.user.country === null) {
console.log('this.data.phone_number.length', this.data.phone_number.length,this.data.is_sex_change);
if(this.data.userInfo.gender == '未知' && this.data.is_sex_change === undefined) {
wx.showToast({title:'请选择性别',icon:'none'})
}else if(this.data.country === '' && this.data.user.country === null) {
wx.showToast({title:'请填写国家',icon:'none'})
}else if(this.data.city === '' && this.data.user.city === null) {
wx.showToast({title:'请填写城市',icon:'none'})
... ... @@ -200,11 +202,12 @@ Page({
}else if(this.data.introduce === '' && this.data.user.introduce === null) {
wx.showToast({title:'请填写简介',icon:'none'})
}else {
const choose_sex = this.data.is_sex_change&&this.data.sexList[this.data.current_sex] === '男'?1:2;
let url = '/portal/Member/detail';
let sex = this.data.userInfo.gender;
let params = {
token: wx.getStorageSync('token'),
sex: sex || this.data.user.sex,
sex: choose_sex || (this.data.is_sex_change === undefined?sex:''),
country:this.data.is_choose_country?this.data.country:this.data.user.country,
city:this.data.is_choose_city?this.data.city:this.data.user.city,
// tel:(this.data.is_choose_phone&&this.data.phone_number !== '')?this.data.phone_number:this.data.user.tel,
... ...
... ... @@ -3,14 +3,14 @@
<view class="flex-box flex-picker">
<view class="title">性别:</view>
<view class="variety-text">
{{userInfo.gender === 1?'男':userInfo.gender === 2?'女':'未知'}}
<!--<picker bindchange="sexPickerChange" value="{{current_sex}}" range="{{sexList}}" class="picker">-->
<!--<view class="sex-picker">-->
<!--<text class="variety-text">{{sexList[current_sex] || user.sex === 1?'男':user.sex === 2?'女':''}}</text>-->
<!--&lt;!&ndash;<text class="variety-text" wx:else>{{pet_info.sex===2?'MM':'GG'}}</text>&ndash;&gt;-->
<!--{{userInfo.gender === 1?'男':userInfo.gender === 2?'女':'未知'}}-->
<picker bindchange="sexPickerChange" value="{{current_sex}}" range="{{sexList}}" class="picker">
<view class="sex-picker">
<text class="variety-text">{{sexList[current_sex] || userInfo.gender === 1?'男':userInfo.gender === 2?'女':''}}</text>
<!--<text class="variety-text" wx:else>{{pet_info.sex===2?'MM':'GG'}}</text>-->
<!--<view class="iconfont icon-arrow-down"></view>-->
<!--</view>-->
<!--</picker>-->
</view>
</picker>
</view>
</view>
<view class="flex-box">
... ... @@ -28,8 +28,8 @@
<view class="flex-box">
<view class="title">手机号:</view>
<view class="phone-box">
<text>{{user.tel!==null?user.tel:''}}</text>
<!--<input type="number" bindinput="inputPhone" bindblur="blur" value="{{is_choose_phone&&!is_wrong_phone?phone_number:user.tel}}"/>-->
<!--<text>{{user.tel!==null?user.tel:''}}</text>-->
<input type="number" bindinput="inputPhone" bindblur="blur" value="{{user.tel!==null?user.tel:is_choose_phone&&!is_wrong_phone?phone_number:''}}"/>
<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="phone-btn">自动填写</button>
</view>
</view>
... ...
... ... @@ -32,6 +32,10 @@
font-size: 26rpx;
color: #666666;
}
.phone-box input {
font-size: 26rpx;
color: #666666;
}
.phone-box {
flex:1;
display: flex;
... ...
... ... @@ -10,6 +10,7 @@ Page({
is_showAnswer: false,
is_showUserInfo:false,
is_answer: false,
is_showResult:false,
is_class:1,
isLogin: null,
is_write:2,//1:已填写,2:未填写
... ... @@ -18,7 +19,7 @@ Page({
},
//关闭金火柴勋章弹框
close() {
this.setData({show_gold_modal:false,show_normal_modal:false});
this.setData({show_gold_modal:false,show_normal_modal:false,is_showResult:false,});
try {
wx.removeStorageSync('score');
console.log('删除后score',wx.getStorageSync('score'));
... ... @@ -243,7 +244,7 @@ Page({
disableScroll() {},
handleBackground() {
console.log('dianji');
this.setData({is_showAnswer: false, is_showUserInfo: false,is_showRelease:false,})
this.setData({is_showAnswer: false, is_showUserInfo: false,is_showRelease:false,is_showResult:false})
},
//首页-导航
service(e) {
... ... @@ -308,7 +309,10 @@ Page({
is_showRelease: true //弹出 去答题弹框
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 1) {
wx.showToast({title: '等级不够,无法使用发布功能', icon: 'none'})
// wx.showToast({title: '等级不够,无法使用发布功能', icon: 'none'});
self.setData({
is_showResult: true //弹出 提示框
});
}
}
},
... ...
... ... @@ -130,4 +130,14 @@
<view class="title text margin">等待开放权限</view>
<view class="answer-btn close close-btn" catchtap="close">随便看看</view>
</view>
<view class="modal_box" wx:if="{{show_normal_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
\ No newline at end of file
<view class="modal_box" wx:if="{{show_normal_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
<!--答完题点击发布按钮弹框-->
<view class="input-box score-box normal-box" wx:if="{{is_showResult}}" catchtouchmove="disableScroll">
<image class="sorry-img img" src="../../images/achieve-answer-img@2x.png"></image>
<view class="title text margin">已通过测试</view>
<view class="title text margin">等待开放权限</view>
<view class="answer-btn close close-btn" catchtap="close">随便看看</view>
</view>
<view class="modal_box" wx:if="{{is_showResult}}" bindtap="handleBackground"
catchtouchmove="disableScroll"></view>
\ No newline at end of file
... ...
... ... @@ -50,21 +50,22 @@
<view class="bottom">
<!-- // (0全部,2待拼成,3人数不足未拼成,4已拼成,5已取消,6已完成,7已评价,8已拼成(活动未结束),9删除,10已取消(已拼成取消),11已过期-->
<text class="cancel-btn" wx:if="{{detail.status === 2}}" bindtap="cancel">取消订单</text>
<text class="cancel-btn light" wx:if="{{detail.status === 2}}" bindtap="cancel">取消订单</text>
<text class="cancel-btn gray" wx:if="{{detail.status === 2}}">待拼成</text>
<!--<text class="cancel-btn gray" wx:if="{{detail.status === 8}}">已拼成</text>-->
<!--sonType=1发布人,2拼餐/拼活动人-->
<block wx:if="{{detail.sonType === 1}}">
<text class="cancel-btn" wx:if="{{detail.status === 4 || detail.status === 3 || detail.status === 8}}" bindtap="cancel">取消订单</text><!--开始前6小时内不能取消-->
<!--is_canCancel=1 是可以点-->
<text class="cancel-btn light" wx:if="{{detail.is_canCancel ===1 && (detail.status === 4 || detail.status === 3 || detail.status === 8)}}" bindtap="cancel">取消订单</text><!--发布人在截止时间以后不能取消-->
<text class="cancel-btn gray" wx:if="{{detail.status === 8}}">待完成</text>
<text class="cancel-btn gray" wx:if="{{detail.status === 3}}">未拼成</text>
<block wx:if="{{detail.is_canCheck === 1}}">
<!--1是可以点-->
<text class="confirm-btn" wx:if="{{detail.status === 4}}" bindtap="confirm">完成</text><!--待完成时并且活动时间已开始,发布人可点击完成-->
<text class="confirm-btn light" wx:if="{{detail.status === 4}}" bindtap="confirm">完成</text><!--待完成时并且活动时间已开始,发布人可点击完成-->
</block>
<block wx:if="{{detail.is_canCheck === 2}}">
<!--2是不可以点,且灰色-->
<text class="confirm-btn gray" wx:if="{{detail.status === 4}}" bindtap="">完成</text><!--待完成时并且活动时间已开始,发布人可点击完成-->
<text class="confirm-btn gray add-width" wx:if="{{detail.status === 4}}" bindtap="">待完成</text><!--待完成时并且活动时间已开始,发布人可点击完成-->
</block>
<text class="confirm-btn add-width gray" wx:if="{{detail.status === 6}}">已完成</text>
</block>
... ... @@ -75,5 +76,6 @@
<text class="confirm-btn gray add-width" wx:if="{{detail.status === 4}}">待完成</text>
<text class="confirm-btn add-width gray" wx:if="{{detail.status === 6}}">已完成</text>
</block>
</view>
</view>
... ...
... ... @@ -150,6 +150,9 @@
color: #E1C8AF;
border:0;
}
.light {
color:#E1C8AF;
}
.bottom .add-width {
width: 100%;
}
... ...
... ... @@ -11,12 +11,13 @@ Page({
tabcurrent: {tab: 3, bubble: ''},
is_showAnswer: false,
is_showUserInfo: false,
is_showResult:false,
is_answer: true,
is_write: 0,//1:已填写,2:未填写
},
//关闭金火柴勋章弹框
close() {
this.setData({show_gold_modal:false,show_normal_modal:false});
this.setData({show_gold_modal:false,show_normal_modal:false,is_showResult:false});
try {
wx.removeStorageSync('score');
console.log('删除后score',wx.getStorageSync('score'));
... ... @@ -24,10 +25,75 @@ Page({
// Do something when catch error
}
},
delete(e) {
const self = this;
const id = e.currentTarget.dataset.id;
const type = +e.currentTarget.dataset.type;
const status = +e.currentTarget.dataset.status;
if(type === 1 && (status === 5 || status === 6 || status === 7 || status === 10 || status === 11)) { //发起人
wx.showModal({
title: '提示',
content: '确定删除吗?',
success(res) {
if (res.confirm) {
console.log('用户点击确定');
let url = '/portal/Order/del';
let params = {
token: wx.getStorageSync('token'),
orderId: id,
};
let header = {
"token": wx.getStorageSync('token')
};
app.post(url, params, {}).then((res) => {
console.log('删除', res);
if (+res.code === 1) {
wx.showToast({title:res.message,icon:'none'});
self.getOrderList();
}else {
wx.showToast({title:res.message,icon:'none'})
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
}else if(type === 2 && (status === 5 || status === 6 || status === 7 || status === 10 || status === 11)) {
wx.showModal({
title: '提示',
content: '确定删除吗?',
success(res) {
if (res.confirm) {
console.log('用户点击确定');
let url = '/portal/Order/del';
let params = {
token: wx.getStorageSync('token'),
orderId: id,
};
let header = {
"token": wx.getStorageSync('token')
};
app.post(url, params, {}).then((res) => {
console.log('删除', res);
if (+res.code === 1) {
wx.showToast({title:res.message,icon:'none'});
self.getOrderList();
}else {
wx.showToast({title:res.message,icon:'none'})
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
}
},
//删除
del(e) {
const self = this;
const id = e.currentTarget.dataset.id;
const id = +e.currentTarget.dataset.id;
wx.showModal({
title: '提示',
content: '确定删除吗?',
... ... @@ -147,7 +213,7 @@ Page({
},
handleBackground() {
console.log('dianji');
this.setData({is_showAnswer: false, is_showUserInfo: false, is_showRelease: false,})
this.setData({is_showAnswer: false, is_showUserInfo: false, is_showRelease: false,is_showResult:false})
},
//首页-导航
service(e) {
... ... @@ -212,7 +278,10 @@ Page({
is_showRelease: true //弹出 去答题弹框
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 1) {
wx.showToast({title: '等级不够,无法使用发布功能', icon: 'none'})
// wx.showToast({title: '等级不够,无法使用发布功能', icon: 'none'});
self.setData({
is_showResult: true //弹出 提示框
});
}
}
},
... ...
... ... @@ -13,7 +13,7 @@
<view class="no-data" wx:if="{{orderList.length === 0}}">暂无订单</view>
<view class='content_box post_box' wx:if="{{orderList.length > 0}}">
<view class='content_item' wx:for="{{orderList}}" wx:key="index"
bindtap='goPostDetail' data-index="{{index}}" data-id="{{item.id}}">
bindtap='goPostDetail' data-index="{{index}}" data-id="{{item.id}}" bindlongpress="delete" data-type="{{item.type}}" data-status="{{item.status}}">
<!--<image src="../../images/lishi@2x.png" class="thumb"></image>-->
<image src="{{item.pic}}" class="thumb" mode="aspectFill"></image>
<view class="lish-right">
... ... @@ -39,14 +39,14 @@
</view>
<view class="btn">
<!--2参与人-->
<block wx:if="{{item.type === 2}}">
<text wx:if="{{item.status === 11 ||item.status === 10 ||item.status === 5 || item.status === 6 || item.status === 7}}"
catchtap="del" data-id="{{item.id}}">删除</text>
</block>
<!--<block wx:if="{{item.type === 2}}">-->
<!--<text wx:if="{{item.status === 11 ||item.status === 10 ||item.status === 5 || item.status === 6 || item.status === 7}}"-->
<!--catchtap="del" data-id="{{item.id}}">删除</text>-->
<!--</block>-->
<!--1发起人-->
<block wx:if="{{item.type === 1}}">
<text wx:if="{{item.status === 11 || item.status === 5 || item.status === 10 || item.status === 6 || item.status === 7}}"
catchtap="del" data-id="{{item.id}}">删除</text>
<!--<text wx:if="{{item.status === 11 || item.status === 5 || item.status === 10 || item.status === 6 || item.status === 7}}"-->
<!--catchtap="del" data-id="{{item.id}}">删除</text>-->
<block wx:if="{{item.is_canCheck !== 2}}">
<!--2是不可以点-->
<text wx:if="{{item.status === 4}}" catchtap="complete" data-id="{{item.id}}">完成</text>
... ... @@ -111,4 +111,13 @@
<view class="answer-btn close close-btn" catchtap="close">随便看看</view>
</view>
<view class="modal_box" wx:if="{{show_normal_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
<!--答完题点击发布按钮弹框-->
<view class="input-box score-box normal-box" wx:if="{{is_showResult}}" catchtouchmove="disableScroll">
<image class="sorry-img img" src="../../images/achieve-answer-img@2x.png"></image>
<view class="title text margin">已通过测试</view>
<view class="title text margin">等待开放权限</view>
<view class="answer-btn close close-btn" catchtap="close">随便看看</view>
</view>
<view class="modal_box" wx:if="{{is_showResult}}" bindtap="handleBackground"
catchtouchmove="disableScroll"></view>
... ...
... ... @@ -217,7 +217,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
wx.showLoading({title: '加载中',});
// wx.showLoading({title: '加载中',});
},
/**
... ...
... ... @@ -40,6 +40,7 @@ Page({
hasMore:true,
is_showAnswer: false,
is_showUserInfo:false,
is_showResult:false,
is_answer: false,
is_write:2,//1:已填写,2:未填写
cityList:[],
... ... @@ -49,7 +50,7 @@ Page({
},
//关闭金火柴勋章弹框
close() {
this.setData({show_gold_modal:false,show_normal_modal:false});
this.setData({show_gold_modal:false,show_normal_modal:false,is_showResult:false});
try {
wx.removeStorageSync('score');
console.log('删除后score',wx.getStorageSync('score'));
... ... @@ -155,7 +156,7 @@ Page({
disableScroll() {},
handleBackground() {
console.log('dianji');
this.setData({is_showAnswer: false, is_showUserInfo: false,is_showRelease:false,})
this.setData({is_showAnswer: false, is_showUserInfo: false,is_showRelease:false,is_showResult:false})
},
//搜索
search() {
... ... @@ -330,7 +331,10 @@ Page({
is_showRelease: true //弹出 去答题弹框
});
} else if (+self.data.is_write === 1 && wx.getStorageSync('is_canSend') === 2 && wx.getStorageSync('is_answer') === 1) {
wx.showToast({title: '等级不够,无法使用发布功能', icon: 'none'})
// wx.showToast({title: '等级不够,无法使用发布功能', icon: 'none'});
self.setData({
is_showResult: true //弹出 提示框
});
}
}
},
... ...
... ... @@ -185,4 +185,13 @@
<view class="title text margin">等待开放权限</view>
<view class="answer-btn close close-btn" catchtap="close">随便看看</view>
</view>
<view class="modal_box" wx:if="{{show_normal_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
\ No newline at end of file
<view class="modal_box" wx:if="{{show_normal_modal}}" bindtap="handleBackground" catchtouchmove="disableScroll"></view>
<!--答完题点击发布按钮弹框-->
<view class="input-box score-box normal-box" wx:if="{{is_showResult}}" catchtouchmove="disableScroll">
<image class="sorry-img img" src="../../images/achieve-answer-img@2x.png"></image>
<view class="title text margin">已通过测试</view>
<view class="title text margin">等待开放权限</view>
<view class="answer-btn close close-btn" catchtap="close">随便看看</view>
</view>
<view class="modal_box" wx:if="{{is_showResult}}" bindtap="handleBackground"
catchtouchmove="disableScroll"></view>
\ No newline at end of file
... ...