新增水滴兑换

This commit is contained in:
2023-07-21 17:22:10 +08:00
parent bcf9fee131
commit d7d54f5009
19 changed files with 732 additions and 207 deletions

View File

@@ -102,6 +102,23 @@ const kuaiDi = (experience_id) => req({
url : "experiences/express_track/" + experience_id url : "experiences/express_track/" + experience_id
}) })
//水滴兑换商品前置
const exchangesCreate = () => req({
url : "experiences/exchanges/create"
})
//水滴兑换商品展示
const exchangesShow = () => req({
url : "experiences/exchanges/show"
})
//水滴兑换商品提交
const exchangesPost = (data) => req({
url : "experiences/exchanges",
method: "POST",
data: data
})
export default ({ export default ({
index, index,
Enroll, Enroll,
@@ -118,5 +135,8 @@ export default ({
dailyList, dailyList,
dailyPost, dailyPost,
score, score,
kuaiDi kuaiDi,
exchangesCreate,
exchangesShow,
exchangesPost
}) })

View File

@@ -12,8 +12,8 @@ import {updToken} from './updateToken'
// wx6bd4fcc040bfa025 水感应 正式appid // wx6bd4fcc040bfa025 水感应 正式appid
// wx9ae0c63d0c58caeb 测试appid 三猿 // wx9ae0c63d0c58caeb 测试appid 三猿
// wx3056ec23196eaf02 水感应 测试 // wx3056ec23196eaf02 水感应 测试
// const api = "https://api.shui.shuiganying.com/api/" // 正式环境 const api = "https://api.shui.shuiganying.com/api/" // 正式环境
const api = "https://shuitest.shuiganying.com/api/" // 测试环境 // const api = "https://shuitest.shuiganying.com/api/" // 测试环境
const header = { const header = {
"Accept" : "application/json" "Accept" : "application/json"
} }

View File

@@ -38,7 +38,8 @@
"pages/water/index", "pages/water/index",
"pages/recruit/expressTrack/expressTrack", "pages/recruit/expressTrack/expressTrack",
"pages/recruit/unveil/unveil", "pages/recruit/unveil/unveil",
"pages/recruit/refertoEdit/refertoEdit" "pages/recruit/refertoEdit/refertoEdit",
"pages/recruit/exchange/exchange"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",

View File

@@ -0,0 +1,84 @@
/*
* 手太欠
* 愿这世界都如故事里一样 美好而动人~
*/
Page({
/**
* 页面的初始数据
*/
data: {
barHeight : getApp().globalData.barHeight, // 状态栏高度
address : '', // 地址
addressId : '', // 地址id
dataShow : '', // 数据
exchangesHide: false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {},
onShow() {
// 水滴兑换商品前置
this.createInfo();
// 水滴兑换商品展示
// this.ShowInfo();
},
/**
* 水滴兑换商品前置
*/
createInfo (){
wx.$api.recruit.exchangesCreate().then(res => {
this.setData({
address : res.data.address,
addressId : res.data.address.address_id
})
}).catch(err => { })
},
/**
* 水滴兑换商品展示
*/
ShowInfo (){
wx.$api.recruit.exchangesShow().then(res => {
this.setData({
dataShow: res.data
})
}).catch(err => { })
},
/**
* 水滴兑换提交
*/
createGo (){
wx.$api.recruit.exchangesPost({address_id: this.data.addressId}).then(res => {
this.setData({
exchangesHide: true
})
}).catch(err => { })
},
// 返回上一页
returnGo() {
wx.navigateBack({
delta: 1
})
},
/**
* 关闭弹框
*/
refertoTap() {
this.setData({
exchangesHide: false
})
wx.redirectTo({
url: '/pages/user/index'
})
}
})

View File

@@ -0,0 +1,4 @@
{
"usingComponents": {},
"navigationStyle": "custom"
}

View File

@@ -0,0 +1,75 @@
<view class="navigation {{isFixedTop > 0 ? 'active' : ''}}" style="padding-top:{{barHeight}}px;">
<image bindtap="returnGo" class="navigation-arrow" src="{{isFixedTop > 0 ? '/static/icons/arrowBlack.png' : '/static/icons/arrowWrite.png'}}"></image>
</view>
<image class="recruit-title" src="https://cdn.shuiganying.com/images/2023/07/21/9d9c0384330026a97c8b0ff35cc09d40.png" mode="widthFix"></image>
<view class="recruit">
<image class="recruit-back" src="https://cdn.shuiganying.com/images/2023/07/21/5409af95a4c54c9c9cf774921e792353.png" mode="widthFix"></image>
<view class="recruit-cont">
<view class="recruit-padding">
<view class="recruit-block">
<view class="recruit-border">
<view class="goodsCont-item">
<view class="goodsCont-item-cont">
<image src="https://cdn.shuiganying.com/images/2023/07/21/d13f569152040d39a6e25e571a84d68b.png" mode="widthFix" class="goodsCont-item-photo"></image>
<view class="goodsCont-item-price">
<image src="https://cdn.shuiganying.com/images/2023/05/17/054f6658624c4b1ed78bb834a8d3c4d6.png" mode="widthFix" class="goodsCont-item-price-back"></image>
<view class="goodsCont-item-price-cont">
<view class="goodsCont-item-price-left">
水感应喷雾
</view>
<view class="goodsCont-item-price-right goodsCont-item-price-white">
<view class="goodsCont-item-price-number">¥<text>129</text>/瓶</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 地址 -->
<view class="recruit-block">
<view class="recruit-border">
<navigator hover-class="none" url="/pages/site/index?type=goodsAddress" class="address-cont" wx:if="{{address}}">
<view class="siteTop">
<image class="siteTop-img" src="https://cdn.shuiganying.com/images/2023/07/21/af4c2254c0eb79492966ca4a89d73e85.png" mode="widthFix"></image>
<view class="siteTop-name">
<text>{{address.name}}</text>{{address.mobile}}
</view>
</view>
<view class="siteText">
<text>{{address.full_address}}</text>
<image class="siteTop-arrow" src="https://cdn.shuiganying.com/images/2023/07/21/09cb0b91639fb0db1d304f60816f06c4.png" mode="widthFix"></image>
</view>
</navigator>
<view class="address-add" wx:else>
<navigator hover-class="none" url="/pages/site/index?type=goodsAddress" class="address-go">新增收货地址 +</navigator>
</view>
</view>
</view>
<!-- 按钮 -->
<view class="recruit-btn" bindtap="createGo">
<image class="recruit-btn-img" src="https://cdn.shuiganying.com/images/2023/07/21/76a01a5c46aa872e37c6af02ab2f6ace.png" mode="widthFix"></image>
<view class="recruit-btn-text">兑换水感应喷雾一瓶</view>
</view>
</view>
<!-- 底部 -->
<view class="recruit-bottom">
<image class="recruit-bottom-img" src="https://cdn.shuiganying.com/images/2023/07/07/99bbdab2c12d05bb267fb43886f6a5b6.png" mode="widthFix"></image>
<view class="recruit-bottom-text">水感应·好“雾”星球</view>
</view>
</view>
</view>
<view class="refertoEject {{exchangesHide ? 'active' : ''}}" catchtouchmove='true'></view>
<view class="refertoCont {{exchangesHide ? 'active' : ''}}" catchtouchmove='true'>
<image class="refertoCont-img" src="https://cdn.shuiganying.com/images/2023/07/21/9c9f4fa4b00d825bf3eeb83df7a4b76e.png" mode="widthFix"></image>
<view class="refertoCont-name" hover-class="none" url="/pages/index/assess/assess?type=1" open-type="redirectTo" bindtap="refertoTap">
<text>收下啦 ~</text>
</view>
<image class="refertoCont-close" bindtap="refertoTap" src="https://cdn.shuiganying.com/images/2023/07/07/f9975891c1efa9b5fcd59fe33a75ed60.png" mode="widthFix"></image>
</view>

View File

@@ -0,0 +1,285 @@
.navigation{
position: fixed;
top: 0;
left: 0;
z-index: 99;
width: 100%;
height: 90rpx;
background-color: transparent;
transition: .2s;
}
.navigation.active {
background-color: transparent;
}
.navigation-arrow {
width: 44rpx;
height: 44rpx;
margin: 20rpx 15rpx 0 20rpx;
}
/* 兑换 */
.recruit-title {
width: 100%;
}
.recruit,
.clockIn {
margin: 10rpx 0;
position: relative;
width: 100%;
z-index: 9;
}
.recruit-back {
position: absolute;
left: 0;
top: 0;
width: 100%;
}
.recruit-cont {
width: 100%;
position: absolute;
left: 0;
top: 0;
}
.recruit-padding {
padding: 0 30rpx;
box-sizing: border-box;
}
.recruit-block {
background-color: #5390f4;
border-radius: 50rpx;
padding: 20rpx;
box-sizing: border-box;
margin: 30rpx 0 50rpx;
}
.recruit-border {
border: 4rpx solid #000000;
border-radius: 50rpx;
padding: 30rpx 20rpx;
box-sizing: border-box;
}
.goodsCont-item {
position: relative;
overflow: hidden;
width: 100%;
padding-top: 100%;
}
.goodsCont-item-back,
.goodsCont-item-cont {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.goodsCont-item-photo {
width: 100%;
display: block;
}
.goodsCont-item-price {
position: relative;
padding-top: 15%;
}
.goodsCont-item-price-back,
.goodsCont-item-price-cont {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.goodsCont-item-price-back {
display: block;
}
.goodsCont-item-price-cont {
padding: 14rpx 40rpx;
box-sizing: border-box;
display: flex;
}
.goodsCont-item-price-text {
font-size: 22rpx;
}
.goodsCont-item-price-left {
flex: 1;
line-height: 64rpx;
font-weight: 600;
}
.goodsCont-item-price-white {
color: #ffffff;
}
.goodsCont-item-price-number {
font-size: 24rpx;
}
.goodsCont-item-price-number text {
font-weight: 600;
font-size: 40rpx;
padding-left: 6rpx;
}
.goodsCont-item-price-right {
width: 26%;
text-align: center;
line-height: 66rpx;
}
.recruit-bottom {
position: relative;
height: 180rpx;
}
.recruit-bottom-img {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
display: block;
}
.recruit-bottom-text {
position: absolute;
left: 0;
bottom: 40rpx;
width: 100%;
z-index: 9;
color: #ffffff;
text-align: center;
font-size: 28rpx;
}
.recruit-btn {
position: relative;
margin: 60rpx 0 100rpx;
height: 100rpx;
}
.recruit-btn-img,
.recruit-btn-text {
position: absolute;
left: 0;
top: 0;
width: 100%;
}
.recruit-btn-text {
color: #ffffff;
text-align: center;
line-height: 100rpx;
font-size: 34rpx;
}
.siteTop {
color: #ffffff;
display: flex;
line-height: 80rpx;
padding: 0 20rpx;
box-sizing: border-box;
font-size: 34rpx;
}
.siteTop-img {
width: 48rpx;
margin: 15rpx 30rpx 0 0;
}
.siteTop-name text {
font-size: 36rpx;
margin-right: 40rpx;
display: inline-block;
}
.siteText {
font-size: 30rpx;
padding: 0 100rpx;
box-sizing: border-box;
color: #ffffff;
line-height: 50rpx;
opacity: .92;
position: relative;
margin-bottom: 15rpx;
}
.siteTop-arrow {
position: absolute;
top: 0;
width: 34rpx;
right: 20rpx;
}
/* 弹出 */
.refertoEject {
position: fixed;
width: 100vw;
height: 100vh;
left: 0;
top: 0;
background-color: rgba(0, 0, 0, .6);
z-index: 1000;
display: none;
}
.refertoEject.active {
display: block;
}
.refertoCont {
-webkit-box-orient: vertical;
-webkit-box-pack: center;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 10000;
padding: 0 10%;
box-sizing: border-box;
text-align: center;
display: none;
}
.refertoCont.active {
display: -webkit-box;
}
.refertoCont-name {
width: 100%;
text-align: center;
margin-top: -50rpx;
margin-bottom: 60rpx;
}
.refertoCont-name text {
display: inline-block;
background-color: #84c83a;
color: #ffffff;
line-height: 84rpx;
border-radius: 100rpx;
padding: 0 60rpx;
font-weight: 600;
box-shadow: 0 4rpx 10rpx rgba(83, 134, 24, 1);
}
.refertoCont-close {
width: 68rpx;
display: block;
margin: 0 auto;
}

View File

@@ -76,9 +76,9 @@
<!-- <image src="/static/icons/rejectIcon.png" mode="widthFix"></image> --> <!-- <image src="/static/icons/rejectIcon.png" mode="widthFix"></image> -->
</view> </view>
<view class="referto-tips"> <view class="referto-tips" wx:if="{{recruitData.experience_notice != ''}}">
<view class="referto-tips-name"><image src="https://cdn.shuiganying.com/images/2023/07/20/d0a4bd7fb4f923d4d1de8e868736dfa3.png" mode="widthFix"></image>温馨提示:</view> <view class="referto-tips-name"><image src="https://cdn.shuiganying.com/images/2023/07/20/d0a4bd7fb4f923d4d1de8e868736dfa3.png" mode="widthFix"></image>温馨提示:</view>
<view>大运会期间云南、贵州、四川、重庆和拉萨暂时不能快递压力喷雾商品,请您耐心等待</view> <view>{{recruitData.experience_notice}}</view>
</view> </view>
<!-- 底部 --> <!-- 底部 -->

View File

@@ -951,7 +951,7 @@
} }
.referto-tips { .referto-tips {
padding: 20rpx 40rpx; padding: 10rpx 40rpx 20rpx;
box-sizing: border-box; box-sizing: border-box;
font-size: 28rpx; font-size: 28rpx;
line-height: 40rpx; line-height: 40rpx;

View File

@@ -5,6 +5,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
notice : '', //地区提示
paySuccess : false, paySuccess : false,
experienceId: '', experienceId: '',
typesArr : [], typesArr : [],
@@ -55,6 +56,7 @@ Page({
} }
] ]
this.setData({ this.setData({
notice : res.data.experience_notice,
typesArr : [{experience_type_id: null, name: "请选择体验内容"}, ...res.data.types], typesArr : [{experience_type_id: null, name: "请选择体验内容"}, ...res.data.types],
cityArr : [...areas, ...res.data.areas], cityArr : [...areas, ...res.data.areas],
paySuccess : false paySuccess : false

View File

@@ -9,6 +9,10 @@
<view class="referto-title-name"><text>活动报名</text></view> <view class="referto-title-name"><text>活动报名</text></view>
<view class="referto-title-tips">activity</view> <view class="referto-title-tips">activity</view>
</view> </view>
<view class="referto-tips" wx:if="{{notice != ''}}">
<view class="referto-tips-name"><image src="https://cdn.shuiganying.com/images/2023/07/20/d0a4bd7fb4f923d4d1de8e868736dfa3.png" mode="widthFix"></image>温馨提示:</view>
<view>{{notice}}</view>
</view>
<form bindsubmit="siteform" class="site-form"> <form bindsubmit="siteform" class="site-form">
<view class="picker-remark"> <view class="picker-remark">
<label>体验类型</label> <label>体验类型</label>
@@ -43,7 +47,8 @@
</picker> </picker>
</view> --> </view> -->
<view class="site-input"> <view class="site-input">
<input placeholder="请输入详细地址" name="address" type="text"></input> <label>收货地址</label>
<input placeholder="请输入详细的收货地址" name="address" type="text"></input>
</view> </view>
<view class="site-btn" wx:if="{{cityArr[cityIndex].surplus != 0}}"> <view class="site-btn" wx:if="{{cityArr[cityIndex].surplus != 0}}">
<button form-type="submit" size="mini" disabled="{{disabled}}">提交申请</button> <button form-type="submit" size="mini" disabled="{{disabled}}">提交申请</button>

View File

@@ -352,3 +352,24 @@ page {
border-radius: 80rpx; border-radius: 80rpx;
line-height: 74rpx; line-height: 74rpx;
} }
.referto-tips-name {
font-weight: 600;
margin-bottom: 10rpx;
line-height: 44rpx;
display: flex;
}
.referto-tips-name image {
width: 30rpx;
margin: 8rpx 10rpx 0 0;
}
.referto-tips {
font-size: 28rpx;
line-height: 40rpx;
text-align: justify;
margin-bottom: 40rpx;
color: #db0000;
}

View File

@@ -9,9 +9,9 @@
<view class="referto-title-name"><text>活动报名</text></view> <view class="referto-title-name"><text>活动报名</text></view>
<view class="referto-title-tips">activity</view> <view class="referto-title-tips">activity</view>
</view> </view>
<view class="referto-tips"> <view class="referto-tips" wx:if="{{notice != ''}}">
<view class="referto-tips-name"><image src="https://cdn.shuiganying.com/images/2023/07/20/d0a4bd7fb4f923d4d1de8e868736dfa3.png" mode="widthFix"></image>温馨提示:</view> <view class="referto-tips-name"><image src="https://cdn.shuiganying.com/images/2023/07/20/d0a4bd7fb4f923d4d1de8e868736dfa3.png" mode="widthFix"></image>温馨提示:</view>
<view>大运会期间云南、贵州、四川、重庆和拉萨暂时不能快递压力喷雾商品,请您耐心等待</view> <view>{{notice}}</view>
</view> </view>
<form bindsubmit="siteform" class="site-form"> <form bindsubmit="siteform" class="site-form">
<view class="picker-remark"> <view class="picker-remark">

View File

@@ -11,6 +11,7 @@ Page({
data: { data: {
logsArr : [], // 提货列表数据 logsArr : [], // 提货列表数据
score : '', //总数量 score : '', //总数量
isExchange : '', //是否兑换
page : {}, //分页信息 page : {}, //分页信息
lodingStats : false, //加载状态 lodingStats : false, //加载状态
}, },
@@ -42,6 +43,7 @@ Page({
if(page == 1 || page == undefined) listArr = [] if(page == 1 || page == undefined) listArr = []
newData = listArr.concat(res.data.logs.data) newData = listArr.concat(res.data.logs.data)
this.setData({ this.setData({
isExchange : res.data.is_exchange,
score : res.data.score, score : res.data.score,
logsArr : newData, logsArr : newData,
page : res.data.logs.page, page : res.data.logs.page,

View File

@@ -2,15 +2,18 @@
水滴的使用规则:可以进行商品兑换 水滴的使用规则:可以进行商品兑换
<image src="/static/icons/water_close.png"></image> <image src="/static/icons/water_close.png"></image>
</view> </view>
<view class="water"> <view class="water {{isExchange ? 'active' : ''}}">
<view class="water-top"> <view class="water-top">
水滴账户<image src="/static/icons/water_icon.png"></image> 水滴账户<image src="/static/icons/water_icon.png"></image>
</view> </view>
<view class="water-number"> <view class="water-number">
{{score}} {{score}}
</view> </view>
<view class="water-convert" wx:if="{{isExchange}}">
<navigator hover-class="none" url="/pages/recruit/exchange/exchange" class="water-convert-go">水滴兑换 ></navigator>
</view>
</view> </view>
<view class="detailed"> <view class="detailed {{isExchange ? 'active' : ''}}">
<view class="title"> <view class="title">
水滴明细 水滴明细
</view> </view>

View File

@@ -31,6 +31,10 @@
z-index: 9; z-index: 9;
} }
.water.active {
height: 230rpx;
}
.water-top image { .water-top image {
width: 30rpx; width: 30rpx;
height: 30rpx; height: 30rpx;
@@ -43,7 +47,22 @@
margin-top: 10rpx; margin-top: 10rpx;
color: #5283ea; color: #5283ea;
font-weight: 600; font-weight: 600;
}
.water-convert {
width: 100%;
text-align: center;
margin-top: 30rpx;
}
.water-convert-go {
background-color: #ffde49;
color: #3a2f00;
display: inline-block;
line-height: 68rpx;
padding: 0 35rpx;
border-radius: 80rpx;
font-size: 30rpx;
} }
.detailed { .detailed {
@@ -57,6 +76,10 @@
overflow-y: scroll; overflow-y: scroll;
} }
.detailed.active {
top: 400rpx;
}
.title { .title {
text-align: center; text-align: center;
color: #5283ea; color: #5283ea;

View File

@@ -45,7 +45,7 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.17.0", "libVersion": "2.17.0",
"appid": "wx9ae0c63d0c58caeb", "appid": "wx6bd4fcc040bfa025",
"projectname": "miniprogram-92", "projectname": "miniprogram-92",
"condition": {}, "condition": {},
"editorSetting": { "editorSetting": {

View File

@@ -17,7 +17,7 @@
}, },
{ {
"name": "", "name": "",
"pathName": "pages/recruit/signWrite/signWrite", "pathName": "pages/recruit/referto/referto",
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null