领取优惠卷,我的优惠卷
This commit is contained in:
parent
2dc51c6b1e
commit
2f7b338d00
3
app.json
3
app.json
@ -14,7 +14,8 @@
|
|||||||
"pages/readTxt/readTxt",
|
"pages/readTxt/readTxt",
|
||||||
"pages/mine/mineAccount/mineInfo/mineInfo",
|
"pages/mine/mineAccount/mineInfo/mineInfo",
|
||||||
"pages/mine/mineAccount/mineOrder/mineOrder",
|
"pages/mine/mineAccount/mineOrder/mineOrder",
|
||||||
"pages/mine/mineAccount/mineContact/mineContact"
|
"pages/mine/mineAccount/mineContact/mineContact",
|
||||||
|
"pages/treaty/rule/rule"
|
||||||
],
|
],
|
||||||
"window": {
|
"window": {
|
||||||
"navigationBarTextStyle": "black",
|
"navigationBarTextStyle": "black",
|
||||||
|
@ -10,16 +10,33 @@ Component({
|
|||||||
visible: {
|
visible: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
value: false
|
value: false
|
||||||
|
},
|
||||||
|
coupons: {
|
||||||
|
type: Object,
|
||||||
|
value: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
data: {
|
||||||
|
checked: false
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
toggleCheck() {
|
||||||
|
this.setData({
|
||||||
|
checked: !this.data.checked
|
||||||
|
})
|
||||||
|
},
|
||||||
// 关闭弹窗
|
// 关闭弹窗
|
||||||
onClose() {
|
onClose() {
|
||||||
this.setData({
|
this.setData({
|
||||||
visible: false
|
visible: false
|
||||||
});
|
});
|
||||||
this.triggerEvent('close'); // 触发关闭事件
|
this.triggerEvent('close', this.data.checked); // 触发关闭事件
|
||||||
|
},
|
||||||
|
onFurl() {
|
||||||
|
this.setData({
|
||||||
|
visible: false
|
||||||
|
})
|
||||||
|
this.triggerEvent('furl', this.data.checked); //触发收下试卷
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
@ -1,6 +1,25 @@
|
|||||||
<view class="ad-popup" wx:if="{{visible}}">
|
<view class="ad-popup" wx:if="{{visible}}">
|
||||||
<view class="ad-content">
|
<view class="ad-content">
|
||||||
<image class="img" src="{{imageUrl}}" mode="aspectFill" />
|
<view class="ic-close close-icon" bind:tap="onClose"></view>
|
||||||
<view class="close-btn" bindtap="onClose">×</view>
|
<view class="image-box">
|
||||||
|
<view class="ad-bg img"></view>
|
||||||
|
<view class="content">
|
||||||
|
<view class="price-box">
|
||||||
|
<view class="p-icon">¥</view>
|
||||||
|
<view class="p-content">{{coupons.amount/100}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="ad-desc-box">
|
||||||
|
<text class="ad-desc">{{coupons.title}}</text>
|
||||||
|
<view class="ad-period">有效期:{{coupons.useGmtStart}}至{{coupons.useGmtEnd}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="custom-checkbox-group" bindtap="toggleCheck">
|
||||||
|
<view class="custom-checkbox {{checked ? 'checked' : ''}}">
|
||||||
|
<text wx:if="{{checked}}">✓</text>
|
||||||
|
</view>
|
||||||
|
<view style="margin-left: 5px;margin-top: 1px;">今日不再显示</view>
|
||||||
|
</view>
|
||||||
|
<view class="btn" bind:tap="onFurl">收下优惠卷</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
File diff suppressed because one or more lines are too long
@ -14,6 +14,7 @@ const apiPath = {
|
|||||||
createProject: '/api/proj/create-quick', //快速创建项目
|
createProject: '/api/proj/create-quick', //快速创建项目
|
||||||
reCreate: '/api/proj/generate/proj-id/${projId}', //重新生成
|
reCreate: '/api/proj/generate/proj-id/${projId}', //重新生成
|
||||||
proLangList: '/api/env/custom/list-active-lang', //项目语言
|
proLangList: '/api/env/custom/list-active-lang', //项目语言
|
||||||
|
ruleData: '/app/agreementportal/getrelease/89c4ca41-a44e-4ae2-bad3-6fa6536dd453', //使用规则 project="operator"
|
||||||
}
|
}
|
||||||
class ProjectService {
|
class ProjectService {
|
||||||
//项目列表
|
//项目列表
|
||||||
@ -60,6 +61,10 @@ class ProjectService {
|
|||||||
static doGetProLangList() {
|
static doGetProLangList() {
|
||||||
return request(apiPath.proLangList, "GET")
|
return request(apiPath.proLangList, "GET")
|
||||||
}
|
}
|
||||||
|
//获取使用规则数据
|
||||||
|
static doGetRuleDate() {
|
||||||
|
return request(apiPath.ruleData, "GET", null, null, "operator")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ProjectService;
|
export default ProjectService;
|
@ -16,6 +16,8 @@ const apiPath = {
|
|||||||
mineContact: '/api/proj-contact/listpage/self', //联系人列表
|
mineContact: '/api/proj-contact/listpage/self', //联系人列表
|
||||||
updateContact: '/api/proj-contact/update/{projContactId}', //更新联系人
|
updateContact: '/api/proj-contact/update/{projContactId}', //更新联系人
|
||||||
delContact: '/api/proj-contact/remove/{ids}', //删除联系人
|
delContact: '/api/proj-contact/remove/{ids}', //删除联系人
|
||||||
|
canClaimsCoupons: '/api/coupon/list-can-claim', //获取可以申领的优惠卷
|
||||||
|
saveCoupons: '/api/coupon/user/save', //领取优惠卷
|
||||||
}
|
}
|
||||||
class UserService {
|
class UserService {
|
||||||
static doLogin(data) {
|
static doLogin(data) {
|
||||||
@ -67,6 +69,14 @@ class UserService {
|
|||||||
const path = apiPath.delContact.replace('{ids}', id)
|
const path = apiPath.delContact.replace('{ids}', id)
|
||||||
return request(path, "DELETE")
|
return request(path, "DELETE")
|
||||||
}
|
}
|
||||||
|
//获取可以申领的优惠卷
|
||||||
|
static doGetClaimsCouponsList() {
|
||||||
|
return request(apiPath.canClaimsCoupons, "GET")
|
||||||
|
}
|
||||||
|
//领取优惠卷
|
||||||
|
static doSaveCoupons(data) {
|
||||||
|
return request(apiPath.saveCoupons, "POST", data)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default UserService;
|
export default UserService;
|
@ -1,5 +1,6 @@
|
|||||||
// index.js
|
// index.js
|
||||||
import ProjectService from '../../net/api/projectApi'
|
import ProjectService from '../../net/api/projectApi'
|
||||||
|
import UserApi from '../../net/api/userApi'
|
||||||
import {
|
import {
|
||||||
previewUrl,
|
previewUrl,
|
||||||
copyrightUrl
|
copyrightUrl
|
||||||
@ -71,6 +72,9 @@ Page({
|
|||||||
downloading: false, //下载文件中
|
downloading: false, //下载文件中
|
||||||
isLoadMore: false, //是否正在加载更多中
|
isLoadMore: false, //是否正在加载更多中
|
||||||
hasMore: true, //是否有更多数据
|
hasMore: true, //是否有更多数据
|
||||||
|
showAd: false, //显示优惠卷广告
|
||||||
|
tempCoupons: null, //优惠卷
|
||||||
|
isNoShowToday: false, //今日不再显示
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
const _self = this
|
const _self = this
|
||||||
@ -86,13 +90,39 @@ Page({
|
|||||||
_self.setData({
|
_self.setData({
|
||||||
contentHeight: h
|
contentHeight: h
|
||||||
})
|
})
|
||||||
|
const noShowToday = Cache.get('noShowToday')
|
||||||
|
const currentDate = new Date().toLocaleDateString();
|
||||||
|
if (noShowToday && noShowToday === currentDate) {
|
||||||
|
this.setData({
|
||||||
|
isNoShowToday: true
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
_self.doGetClaimsCoupons()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//获取可以申领的优惠卷
|
||||||
|
doGetClaimsCoupons() {
|
||||||
|
const _self = this
|
||||||
|
UserApi.doGetClaimsCouponsList()
|
||||||
|
.then(res => {
|
||||||
|
if (res && res.length > 0) {
|
||||||
|
_self.setData({
|
||||||
|
tempCoupons: res[0],
|
||||||
|
showAd: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, err => {
|
||||||
|
console.log(err)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
//创建项目
|
//创建项目
|
||||||
createCopy() {
|
createCopy() {
|
||||||
wx.navigateTo({
|
this.setData({
|
||||||
url: '/pages/copyright/createBuy/createBuy',
|
showAd: true
|
||||||
})
|
})
|
||||||
|
// wx.navigateTo({
|
||||||
|
// url: '/pages/copyright/createBuy/createBuy',
|
||||||
|
// })
|
||||||
},
|
},
|
||||||
//充值
|
//充值
|
||||||
goPayment() {
|
goPayment() {
|
||||||
@ -395,5 +425,53 @@ Page({
|
|||||||
})
|
})
|
||||||
const params = _self.buildParams(_self.data.pageData.page, false)
|
const params = _self.buildParams(_self.data.pageData.page, false)
|
||||||
_self.doGetSelfList(params, false)
|
_self.doGetSelfList(params, false)
|
||||||
|
},
|
||||||
|
//关闭广告
|
||||||
|
doCloseAd(e) {
|
||||||
|
const isShow = e.detail
|
||||||
|
// isShow=true 今日不再显示
|
||||||
|
if (isShow) {
|
||||||
|
const currentDate = new Date().toLocaleDateString();
|
||||||
|
Cache.set('noShowToday', currentDate)
|
||||||
|
this.setData({
|
||||||
|
isNoShowToday: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//收下优惠卷
|
||||||
|
doFurlCoupons(e) {
|
||||||
|
console.log('收下优惠卷')
|
||||||
|
const _self = this
|
||||||
|
const isShow = e.detail
|
||||||
|
// isShow=true 今日不再显示
|
||||||
|
if (isShow) {
|
||||||
|
const currentDate = new Date().toLocaleDateString();
|
||||||
|
Cache.set('noShowToday', currentDate)
|
||||||
|
this.setData({
|
||||||
|
isNoShowToday: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
wx.showLoading({
|
||||||
|
title: '领取中...',
|
||||||
|
})
|
||||||
|
const coupons = {
|
||||||
|
couponId: _self.data.tempCoupons.couponId
|
||||||
|
}
|
||||||
|
UserApi.doSaveCoupons(coupons)
|
||||||
|
.then(res => {
|
||||||
|
wx.hideLoading()
|
||||||
|
_self.setData({
|
||||||
|
successHint: '本次领取操作已成功,您可以在 “我的” 页面查看相关信息。',
|
||||||
|
showSuccess: true,
|
||||||
|
showAd: false
|
||||||
|
})
|
||||||
|
}, err => {
|
||||||
|
wx.hideLoading()
|
||||||
|
_self.setData({
|
||||||
|
errorHint: err.msg ? err.msg : '本次领取操作未成功,请重新进入小程序后再次尝试。',
|
||||||
|
showError: true,
|
||||||
|
showAd: false
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
@ -4,7 +4,8 @@
|
|||||||
"mp-half-screen-dialog": "weui-miniprogram/half-screen-dialog/half-screen-dialog",
|
"mp-half-screen-dialog": "weui-miniprogram/half-screen-dialog/half-screen-dialog",
|
||||||
"mp-toptips": "weui-miniprogram/toptips/toptips",
|
"mp-toptips": "weui-miniprogram/toptips/toptips",
|
||||||
"down-progress": "/components/down-progress/down-progress",
|
"down-progress": "/components/down-progress/down-progress",
|
||||||
"mp-loading": "weui-miniprogram/loading/loading"
|
"mp-loading": "weui-miniprogram/loading/loading",
|
||||||
|
"ad-popup": "/components/ad-popup/ad-popup"
|
||||||
},
|
},
|
||||||
"navigationStyle": "custom"
|
"navigationStyle": "custom"
|
||||||
}
|
}
|
@ -96,7 +96,7 @@
|
|||||||
<view class="hint">温馨提示:若您想把下载的文件留存到本地,打开预览页面后,在界面右上角操作栏内,选择使用其他软件打开或者保存文件功能就能实现。</view>
|
<view class="hint">温馨提示:若您想把下载的文件留存到本地,打开预览页面后,在界面右上角操作栏内,选择使用其他软件打开或者保存文件功能就能实现。</view>
|
||||||
<view class="download-desc">
|
<view class="download-desc">
|
||||||
<view class="link-title">项目预览链接</view>
|
<view class="link-title">项目预览链接</view>
|
||||||
<text class="link">{{sysPreviewUrl}}</text>
|
<text class="link" selectable="true">{{sysPreviewUrl}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="download-item">
|
<view class="download-item">
|
||||||
<view class="download-title">
|
<view class="download-title">
|
||||||
@ -152,23 +152,5 @@
|
|||||||
<down-progress isShow="{{downloading}}" progress="{{downloadProgress}}"></down-progress>
|
<down-progress isShow="{{downloading}}" progress="{{downloadProgress}}"></down-progress>
|
||||||
<mp-toptips ext-class="custom-tips" msg="{{errorHint}}" type="error" show="{{showError}}"></mp-toptips>
|
<mp-toptips ext-class="custom-tips" msg="{{errorHint}}" type="error" show="{{showError}}"></mp-toptips>
|
||||||
<mp-toptips ext-class="custom-tips" msg="{{successHint}}" delay="2000" type="success" show="{{showSuccess}}"></mp-toptips>
|
<mp-toptips ext-class="custom-tips" msg="{{successHint}}" delay="2000" type="success" show="{{showSuccess}}"></mp-toptips>
|
||||||
|
<ad-popup coupons="{{tempCoupons}}" bindclose="doCloseAd" bindfurl="doFurlCoupons" visible="{{showAd}}"></ad-popup>
|
||||||
<wxs src="../../utils/comm.wxs" module="tools"></wxs>
|
<wxs src="../../utils/comm.wxs" module="tools"></wxs>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <view class="download-item">
|
|
||||||
<view class="download-title icon-tool">操作手册</view>
|
|
||||||
<view class="download-btn-box">
|
|
||||||
<view class="download-btn" bind:tap="download" data-path="/route/proj/download/manual/">DOC</view>
|
|
||||||
<view class="download-btn" bind:tap="download" data-path="/route/proj/download/manual/pdf/">PDF</view>
|
|
||||||
</view>
|
|
||||||
</view> -->
|
|
||||||
<!-- <view class="download-item">
|
|
||||||
<view class="download-title icon-source">源代码</view>
|
|
||||||
<view class="download-btn-box">
|
|
||||||
<view class="download-btn" bind:tap="download" data-path="/route/proj/download/code/">DOC</view>
|
|
||||||
<view class="download-btn" bind:tap="download" data-path="/route/proj/download/code/pdf/">PDF</view>
|
|
||||||
</view>
|
|
||||||
</view> -->
|
|
@ -374,6 +374,9 @@
|
|||||||
.download-item:nth-of-type(n+2) {
|
.download-item:nth-of-type(n+2) {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
.download-item:last-child{
|
||||||
|
margin-bottom: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
.download-title {
|
.download-title {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -497,4 +500,8 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
color: rgb(248, 185, 50);
|
color: rgb(248, 185, 50);
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.weui-half-screen-dialog__ft{
|
||||||
|
height: 0;
|
||||||
|
padding: 0;
|
||||||
}
|
}
|
@ -11,21 +11,40 @@ Page({
|
|||||||
* 页面的初始数据
|
* 页面的初始数据
|
||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
couponsList: [],
|
|
||||||
loadingStatus: 'loading',
|
|
||||||
currentPage: 1,
|
|
||||||
listRefreshTrig: false,
|
|
||||||
currentStatus: 1,
|
currentStatus: 1,
|
||||||
rows: 10,
|
height: windowHeight,
|
||||||
isLoadMore: false, //是否正在加载更多
|
couponsList: [], //订单列表
|
||||||
height: windowHeight
|
pageData: {
|
||||||
|
page: 1,
|
||||||
|
rows: 10,
|
||||||
|
isEffective: '',
|
||||||
|
isUsed: '',
|
||||||
|
}, //检索参数
|
||||||
|
loadingState: 'loading', //加载状态
|
||||||
|
listRefreshTrig: false, //list刷新状态
|
||||||
|
isLoadMore: false, //加载更多的状态
|
||||||
|
hasMore: true, //是否有更多数据
|
||||||
|
keywords: '', //搜索关键字
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
wx.setNavigationBarTitle({
|
||||||
|
title: '我的优惠卷',
|
||||||
|
})
|
||||||
|
wx.setNavigationBarColor({
|
||||||
|
frontColor: '#000000', // 必写项,字体颜色仅支持#ffffff和#000000
|
||||||
|
backgroundColor: '#F0F0F0', // 传递的颜色值,仅支持十六进制颜色
|
||||||
|
animation: { // 可选项
|
||||||
|
duration: 500,
|
||||||
|
timingFunc: 'easeIn'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
//加载数据
|
||||||
this.doRefreshList()
|
this.doRefreshList()
|
||||||
|
|
||||||
},
|
},
|
||||||
//tab切换
|
//tab切换
|
||||||
doChangeStatus(e) {
|
doChangeStatus(e) {
|
||||||
@ -36,74 +55,95 @@ Page({
|
|||||||
this.doRefreshList()
|
this.doRefreshList()
|
||||||
},
|
},
|
||||||
//获取我的优惠卷
|
//获取我的优惠卷
|
||||||
doGetMyCoupons(data) {
|
doGetMyCoupons(isRefresh) {
|
||||||
const _self = this
|
const _self = this
|
||||||
ProApi.doGetCouponseList(data)
|
_self.setData({
|
||||||
|
couponsList: isRefresh ? [] : _self.data.couponsList,
|
||||||
|
loadingState: isRefresh ? 'loading' : ''
|
||||||
|
})
|
||||||
|
ProApi.doGetCouponseList(_self.data.pageData)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
wx.stopPullDownRefresh()
|
var status = 'success'
|
||||||
console.log('优惠卷')
|
status = res.rows && res.rows.length > 0 ? 'success' : 'empty'
|
||||||
console.log(res)
|
|
||||||
_self.setData({
|
_self.setData({
|
||||||
loadingStatus: res.rows && res.rows.length > 0 ? 'success' : 'empty',
|
loadingState: isRefresh ? status : '',
|
||||||
couponsList: _self.data.couponsList.concat(res.rows),
|
couponsList: _self.data.couponsList.concat(res.rows),
|
||||||
listRefreshTrig: false,
|
listRefreshTrig: false,
|
||||||
isLoadMore: false
|
isLoadMore: false
|
||||||
})
|
})
|
||||||
}, err => {
|
|
||||||
console.log(err)
|
|
||||||
wx.stopPullDownRefresh()
|
|
||||||
_self.setData({
|
_self.setData({
|
||||||
couponsList: [],
|
hasMore: _self.data.couponsList.length < res.total
|
||||||
loadingStatus: 'error',
|
})
|
||||||
|
}, err => {
|
||||||
|
_self.setData({
|
||||||
|
loadingState: 'error',
|
||||||
listRefreshTrig: false,
|
listRefreshTrig: false,
|
||||||
isLoadMore: false
|
isLoadMore: false,
|
||||||
|
hasMore: true
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//构建请求参数
|
|
||||||
buildParams(value) {
|
|
||||||
const _self = this
|
|
||||||
console.log(value)
|
|
||||||
var data = {}
|
|
||||||
if (value == 1) {
|
|
||||||
data.isEffective = 1
|
|
||||||
data.isUsed = 0
|
|
||||||
} else if (value == 2) {
|
|
||||||
data.isEffective = ''
|
|
||||||
data.isUsed = 1
|
|
||||||
} else {
|
|
||||||
data.isEffective = 0
|
|
||||||
data.isUsed = 0
|
|
||||||
}
|
|
||||||
data.rows = _self.data.rows
|
|
||||||
return data
|
|
||||||
},
|
|
||||||
//下拉刷新
|
//下拉刷新
|
||||||
doRefreshList() {
|
doRefreshList() {
|
||||||
const _self = this
|
const _self = this
|
||||||
|
var isEffective = ''
|
||||||
|
var isUsed = ''
|
||||||
|
if (_self.data.currentStatus == 1) {
|
||||||
|
isEffective = 1
|
||||||
|
isUsed = 0
|
||||||
|
} else if (_self.data.currentStatus == 2) {
|
||||||
|
isEffective = ''
|
||||||
|
isUsed = 1
|
||||||
|
} else {
|
||||||
|
isEffective = 0
|
||||||
|
isUsed = 0
|
||||||
|
}
|
||||||
_self.setData({
|
_self.setData({
|
||||||
currentPage: 1,
|
|
||||||
listRefreshTrig: true,
|
listRefreshTrig: true,
|
||||||
loadingStatus: 'loading'
|
loadingState: 'loading',
|
||||||
|
hasMore: true,
|
||||||
|
'pageData.page': 1,
|
||||||
|
'pageData.isEffective': isEffective,
|
||||||
|
'pageData.isUsed': isUsed,
|
||||||
|
isLoadMore: false
|
||||||
})
|
})
|
||||||
var data = _self.buildParams(_self.data.currentStatus)
|
_self.doGetMyCoupons(true)
|
||||||
data.page = _self.data.currentPage
|
|
||||||
_self.doGetMyCoupons(data)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//加载更多
|
//加载更多
|
||||||
doLoadMore() {
|
doLoadMore() {
|
||||||
if (this.data.isLoadMore) {
|
//判断是否正在加载中 与是否存在更多数据
|
||||||
|
const _self = this
|
||||||
|
if (_self.data.isLoadMore || !_self.data.hasMore) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.log('加载更多')
|
var isEffective = ''
|
||||||
const _self = this
|
var isUsed = ''
|
||||||
|
if (_self.data.currentStatus == 1) {
|
||||||
|
isEffective = 1
|
||||||
|
isUsed = 0
|
||||||
|
} else if (_self.data.currentStatus == 2) {
|
||||||
|
isEffective = ''
|
||||||
|
isUsed = 1
|
||||||
|
} else {
|
||||||
|
isEffective = 0
|
||||||
|
isUsed = 0
|
||||||
|
}
|
||||||
_self.setData({
|
_self.setData({
|
||||||
currentPage: ++_self.data.currentPage,
|
isLoadMore: true,
|
||||||
isLoadMore: true
|
'pageData.page': ++_self.data.pageData.page,
|
||||||
|
'pageData.isEffective': isEffective,
|
||||||
|
'pageData.isUsed': isUsed,
|
||||||
})
|
})
|
||||||
var data = _self.buildParams(_self.data.currentStatus)
|
_self.doGetMyCoupons(false)
|
||||||
data.page = _self.data.currentPage
|
},
|
||||||
_self.doGetMyCoupons(data)
|
//显示使用规则
|
||||||
|
showRule() {
|
||||||
|
ProApi.doGetRuleDate()
|
||||||
|
.then(res => {
|
||||||
|
console.log(res)
|
||||||
|
}, err => {
|
||||||
|
console.log(err)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"usingComponents": {
|
"usingComponents": {
|
||||||
|
"mp-loading": "weui-miniprogram/loading/loading",
|
||||||
"container-loading": "/components/container-loading/container-loading"
|
"container-loading": "/components/container-loading/container-loading"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,32 +1,47 @@
|
|||||||
<view class="list-title-btns">
|
<view class="list-title-btns">
|
||||||
<view bind:tap="doChangeStatus" data-value="1" class="{{currentStatus==1? 'btn-select':'btn-normal'}} border-left">可用</view>
|
<view bind:tap="doChangeStatus" data-value="1" class="{{currentStatus==1? 'btn-select':'btn-normal'}} border-left">
|
||||||
<view bind:tap="doChangeStatus" data-value="2" class="{{currentStatus==2? 'btn-select':'btn-normal'}} border-right">已使用</view>
|
<view class="tab">
|
||||||
<view bind:tap="doChangeStatus" data-value="3" class="{{currentStatus==3? 'btn-select':'btn-normal'}} border-right">不可用</view>
|
<text>可用</text>
|
||||||
|
<view class="{{currentStatus==1?'border-select':'border-normal'}}"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view bind:tap="doChangeStatus" data-value="2" class="{{currentStatus==2? 'btn-select':'btn-normal'}} border-right">
|
||||||
|
<view class="tab">
|
||||||
|
<text>已使用</text>
|
||||||
|
<view class="{{currentStatus==2?'border-select':'border-normal'}}"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view bind:tap="doChangeStatus" data-value="3" class="{{currentStatus==3? 'btn-select':'btn-normal'}} border-right">
|
||||||
|
<view class="tab">
|
||||||
|
<text>不可用</text>
|
||||||
|
<view class="{{currentStatus==3?'border-select':'border-normal'}}"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="margin-top: 50px;">
|
<view style="margin-top: 60px;">
|
||||||
<container-loading loadingState="{{loadingStatus}}">
|
<container-loading loadingState="{{loadingState}}">
|
||||||
<scroll-view scroll-y style="height: {{height}}px;" bindrefresherrefresh="doRefreshList" refresher-enabled refresher-triggered="{{listRefreshTrig}}" bindscrolltolower="doLoadMore" lower-threshold='30'>
|
<scroll-view scroll-y style="height: {{height}}px;" bindrefresherrefresh="doRefreshList" refresher-enabled refresher-triggered="{{listRefreshTrig}}" bindscrolltolower="doLoadMore" lower-threshold='30'>
|
||||||
<view class="coupons-list-box">
|
<view class="coupons-list-box">
|
||||||
<block wx:for="{{couponsList}}" wx:key="index">
|
<block wx:for="{{couponsList}}" wx:key="index">
|
||||||
<view class="tickets">
|
<view class="tickets {{tools.boderStyle(currentStatus)}}">
|
||||||
<view class="l-tickets">
|
<view class="l-tickets-box">
|
||||||
<view class="ticket-title">
|
<view class="l-tickets {{tools.fontColor(currentStatus)}}">
|
||||||
<view style="display: flex;flex-direction: row;justify-content: center;align-items: center;">
|
<view class="l-icon">¥</view>
|
||||||
<view class="coupons-icon" style="width: 24px;height: 24px;">
|
<view class="l-price">{{item.coupon.amount/100}}</view>
|
||||||
</view>
|
|
||||||
<text>优惠卷</text>
|
|
||||||
</view>
|
|
||||||
<view></view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="ticket-content">{{item.coupon.title}}</view>
|
<view class="use-link" bind:tap="showRule">使用规则</view>
|
||||||
<view class="ticket-desc">有效期:{{item.coupon.useGmtStart}}至{{item.coupon.useGmtEnd}}</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 虚线 -->
|
||||||
|
<view class="v-divide"></view>
|
||||||
<view class="r-tickets">
|
<view class="r-tickets">
|
||||||
减{{amount/100}}元
|
<view class="r-title">{{item.coupon.title}}</view>
|
||||||
|
<view class="r-time">{{item.coupon.useGmtStart}}-{{item.coupon.useGmtEnd}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
|
<mp-loading show="{{isLoadMore}}" type="circle"></mp-loading>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</container-loading>
|
</container-loading>
|
||||||
</view>
|
</view>
|
||||||
|
<wxs src="../../../../utils/comm.wxs" module="tools"></wxs>
|
@ -1,6 +1,6 @@
|
|||||||
/* pages/mine/mineAccount/mineCoupons/mineCoupons.wxss */
|
/* pages/mine/mineAccount/mineCoupons/mineCoupons.wxss */
|
||||||
page {
|
page {
|
||||||
background-color: white;
|
background: linear-gradient(to bottom, #F0F0F0, #FFFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-title-btns {
|
.list-title-btns {
|
||||||
@ -17,24 +17,46 @@ page {
|
|||||||
|
|
||||||
.btn-select {
|
.btn-select {
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
background-color: rgba(244, 206, 152, 0.18);
|
|
||||||
color: rgba(233, 157, 66, 1);
|
color: rgba(233, 157, 66, 1);
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
border: 1px solid rgba(244, 206, 152, 0.18);
|
color: #2A9E75;
|
||||||
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-normal {
|
.btn-normal {
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
background-color: rgba(255, 255, 255, 1);
|
|
||||||
color: rgba(16, 16, 16, 1);
|
color: rgba(16, 16, 16, 1);
|
||||||
flex: 1;
|
flex: 1;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border: 1px solid rgba(248, 248, 248, 1);
|
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.border-select {
|
||||||
|
width: 20px;
|
||||||
|
height: 4px;
|
||||||
|
background-color: #2A9E75;
|
||||||
|
margin-top: 10px;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.border-normal {
|
||||||
|
width: 20px;
|
||||||
|
height: 4px;
|
||||||
|
margin-top: 10px;
|
||||||
|
border-radius: 2px;
|
||||||
|
background-color: #F0F0F0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.coupons-list-box {
|
.coupons-list-box {
|
||||||
@ -49,64 +71,105 @@ page {
|
|||||||
padding: 5px;
|
padding: 5px;
|
||||||
width: 90vw;
|
width: 90vw;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: white;
|
||||||
|
flex-direction: row;
|
||||||
|
padding: 20px 0px;
|
||||||
|
box-shadow: 0px 0px 1px 1px #F0F0F0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tickets:nth-of-type(n+2) {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tickets-yellow {
|
||||||
|
border-left: 5px solid #FFA900;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tickets-gray {
|
||||||
|
border-left: 5px solid #A9A9A9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tickets-green {
|
||||||
|
border-left: 5px solid #2A9E75;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font-yellow {
|
||||||
|
color: #FFA900
|
||||||
|
}
|
||||||
|
|
||||||
|
.font-gray {
|
||||||
|
color: #A9A9A9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.font-green {
|
||||||
|
color: #2A9E75;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-divide {
|
||||||
|
height: auto;
|
||||||
|
border-right: 1.5px dashed rgba(221, 221, 221, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.l-tickets-box {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
flex: 0.3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.l-tickets {
|
.l-tickets {
|
||||||
width: 60vw;
|
|
||||||
position: relative;
|
|
||||||
padding: 10px;
|
|
||||||
background: radial-gradient(circle at right top, transparent 16rpx, #ffaa0017 0) right top / 100% 50% no-repeat,
|
|
||||||
radial-gradient(circle at right bottom, transparent 16rpx, #ffaa0017 0) right bottom / 100% 50% no-repeat;
|
|
||||||
filter: drop-shadow(3px 0 3px rgba(0, 0, 0, .3));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.l-tickets::after {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
height: 100%;
|
|
||||||
width: 8rpx;
|
|
||||||
top: 0;
|
|
||||||
left: -8rpx;
|
|
||||||
background: radial-gradient(circle at left center, transparent 8rpx, #ffaa0017 0) left center / 8rpx 20rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.r-tickets {
|
|
||||||
flex: 1;
|
|
||||||
position: relative;
|
|
||||||
background: radial-gradient(circle at left top, transparent 16rpx, #ffaa0017 0, #ffaa0017 100%) right top / 100% 50% no-repeat,
|
|
||||||
radial-gradient(circle at left bottom, transparent 16rpx, #ffaa0017 0, #ffaa0017 100%) right bottom / 100% 50% no-repeat;
|
|
||||||
filter: drop-shadow(3px 0 3px rgba(0, 0, 0, .3));
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: flex-end;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.use-link {
|
||||||
|
color: #0a86fa;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.l-icon {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 500;
|
margin-bottom: 6px;
|
||||||
color: #5D3900;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.r-tickets::after {
|
.l-price {
|
||||||
content: '';
|
font-size: 30px;
|
||||||
position: absolute;
|
font-weight: bold;
|
||||||
height: 100%;
|
margin-left: 5px;
|
||||||
width: 8rpx;
|
|
||||||
top: 0;
|
|
||||||
right: -8rpx;
|
|
||||||
background: radial-gradient(circle at right center, transparent 8rpx, #ffaa0017 0) right center / 8rpx 20rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.r-tickets::before {
|
.r-tickets {
|
||||||
content: '';
|
display: flex;
|
||||||
width: 1rpx;
|
flex-direction: column;
|
||||||
background: linear-gradient(to top, #fff 0%, #fff 50%, transparent 50%) top left / 1rpx 20rpx repeat-y;
|
justify-content: center;
|
||||||
position: absolute;
|
align-items: flex-start;
|
||||||
left: 0;
|
font-size: 14px;
|
||||||
top: 16rpx;
|
flex: 0.7;
|
||||||
bottom: 16rpx;
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.r-title {
|
||||||
|
line-height: 25px;
|
||||||
|
color: #313131;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: left;
|
||||||
|
font-family: PingFangSC-medium;
|
||||||
|
}
|
||||||
|
|
||||||
|
.r-time {
|
||||||
|
line-height: 17px;
|
||||||
|
color: rgba(118, 118, 118, 1);
|
||||||
|
font-size: 12px;
|
||||||
|
text-align: left;
|
||||||
|
font-family: PingFangSC-regular;
|
||||||
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ticket-container:nth-last-of-type(n+1) {
|
.ticket-container:nth-last-of-type(n+1) {
|
||||||
|
25
pages/treaty/rule/rule.js
Normal file
25
pages/treaty/rule/rule.js
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// pages/treaty/rule/rule.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
id: '',
|
||||||
|
title: ''
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
const _self = this
|
||||||
|
this.setData({
|
||||||
|
id: options.id,
|
||||||
|
title: options.title
|
||||||
|
})
|
||||||
|
wx.setNavigationBarTitle({
|
||||||
|
title: _self.data.title,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
})
|
3
pages/treaty/rule/rule.json
Normal file
3
pages/treaty/rule/rule.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
2
pages/treaty/rule/rule.wxml
Normal file
2
pages/treaty/rule/rule.wxml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<!--pages/treaty/rule/rule.wxml-->
|
||||||
|
<text>pages/treaty/rule/rule.wxml</text>
|
1
pages/treaty/rule/rule.wxss
Normal file
1
pages/treaty/rule/rule.wxss
Normal file
@ -0,0 +1 @@
|
|||||||
|
/* pages/treaty/rule/rule.wxss */
|
@ -65,10 +65,44 @@ var proType = function (value) {
|
|||||||
return str
|
return str
|
||||||
|
|
||||||
}
|
}
|
||||||
|
var boderStyle = function (value) {
|
||||||
|
var str = 'tickets-yellow' // tickets-gray tickets-green
|
||||||
|
console.log(value)
|
||||||
|
switch (value) {
|
||||||
|
case '1': //可用
|
||||||
|
str = 'tickets-yellow'
|
||||||
|
break
|
||||||
|
case '2': //已经使用
|
||||||
|
str = 'tickets-gray'
|
||||||
|
break
|
||||||
|
case '3': //不可用
|
||||||
|
str = 'tickets-green'
|
||||||
|
break
|
||||||
|
}
|
||||||
|
console.log(str)
|
||||||
|
return str
|
||||||
|
}
|
||||||
|
var fontColor = function (value) {
|
||||||
|
var str = 'font-yellow' // tickets-gray tickets-green
|
||||||
|
switch (value) {
|
||||||
|
case '1': //可用
|
||||||
|
str = 'font-yellow'
|
||||||
|
break
|
||||||
|
case '2': //已经使用
|
||||||
|
str = 'font-gray'
|
||||||
|
break
|
||||||
|
case '3': //不可用
|
||||||
|
str = 'font-green'
|
||||||
|
break
|
||||||
|
}
|
||||||
|
return str
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
isEmpty: isEmpty,
|
isEmpty: isEmpty,
|
||||||
status: status,
|
status: status,
|
||||||
orderStatus: orderStatus,
|
orderStatus: orderStatus,
|
||||||
proType: proType
|
proType: proType,
|
||||||
|
boderStyle: boderStyle,
|
||||||
|
fontColor: fontColor
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user