Commit 862a7ead by 严立

LL - 购物流程问题修复

parents 967cf83b 26d02c4b
......@@ -12,6 +12,18 @@ Page({
winSide: true,
sideHeight: 1250,
swiperImage: [
{
id: 0,
url: ''
},
{
id: 0,
url: ''
}
],
bannerImage: '',
detailImage: [],
detailImageUrl: [
App.globalData.appResourcesBase + 'campsite/campsite-1.png',
......@@ -88,4 +100,25 @@ Page({
clearTimeout(logicData.pageScrollTimer)
}, 40)
},
// 跳转到购买年卡/月卡/次卡界面
onBuyCoupon: function (event) {
console.log(event)
let { type } = event.currentTarget.dataset
wx.navigateTo({
url: '/pages/pay/order-input/order-input?type=' + type
})
},
// 跳转到购买饮品界面
onBuySnacks() {
wx.navigateTo({
url: '/pages/commodity/menu-snacks/menu-snacks',
})
},
// 跳转到购买文创界面
onBuySnacks() {
wx.navigateTo({
url: '/pages/commodity/menu-art/menu-art',
})
}
})
\ No newline at end of file
<view class="container">
<view class="appointment">
<!-- <view class="appointment">
<l-button l-class="appointment-button" bind:lintap="onServic">电话预约</l-button>
</view>
</view> -->
<view class="appointment-side col con-b align-c" hidden="{{winSide}}">
<button class="appointment-side-top" bindtap="onBackTop">
<image src="{{imageBase + 'top.png'}}"></image>
</button>
<button class="appointment-side-phone" bind:tap="onServic">
<!-- <button class="appointment-side-phone" bind:tap="onServic">
<image src="{{imageBase + 'phone.png'}}"></image>
</button>
</button> -->
</view>
<!-- 头部背景图 -->
<image class="banner" src="bannerImage"></image>
<!-- 分享按钮 -->
<view class="share col con-c align-c">
<image class="icon-share" src="/image/icon/share-3.png"></image>
</view>
<!-- 位置按钮 -->
<view class="location col con-c align-c">
<image class="icon-location" src="/image/icon/location-3.png"></image>
</view>
<!-- 入园购票 -->
<view class="buy-coupon">
<view class="buy-coupon-title row align-c">
<image></image>
<image></image>
</view>
<view class="buy-coupon-type row con-b">
<image bindtap="onBuyCoupon" data-type="2"></image>
<image bindtap="onBuyCoupon" data-type="1"></image>
<image bindtap="onBuyCoupon" data-type="1"></image>
</view>
</view>
<!-- 饮品预订 文创周边-->
<view class="buy-other row con-b">
<!-- 饮品预订 -->
<view class="buy-snacks row" bindtap="onBuySnacks">
<view class="buy-left col con-c">
<image></image>
</view>
<view class="buy-right col con-c">
<image></image>
<image class="snacks-img"></image>
</view>
</view>
<!-- 文创周边 -->
<view class="buy-art row" bindtap="onBuyArt">
<view class="buy-left col con-c">
<image></image>
</view>
<view class="buy-right col con-c">
<image></image>
<image class="art-img"></image>
</view>
</view>
</view>
<!-- 滚动图片 -->
<!-- 单张图片 -->
<view class="swiper" wx:if="{{swiperImage.length === 1}}">
</view>
<!-- 多张图片 -->
<swiper class="swiper" indicator-dots indicator-color="#F6DADA" indicator-active-color="#E57C99" autoplay circular wx:else>
<block>
<swiper-item>
<image mode="widthFix" src=""></image>
</swiper-item>
</block>
</swiper>
<block wx:for="{{detailImageUrl}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<image mode="widthFix" src="{{item}}"></image>
</block>
</view>
\ No newline at end of file
......@@ -50,3 +50,128 @@
.container > image {
width: 750rpx;
}
.banner {
width: 750rpx;
height: 1676rpx;
background-color: #ccc;
}
.share {
position: absolute;
top: 710rpx;
right: 136rpx;
width: 64rpx;
height: 64rpx;
background: #F28FA2;
box-shadow: 8rpx 8rpx 20rpx 0rpx rgba(242,143,162,0.3);
border-radius: 50%;
}
.location {
position: absolute;
top: 710rpx;
right: 40rpx;
width: 64rpx;
height: 64rpx;
background: #F28FA2;
box-shadow: 8rpx 8rpx 20rpx 0rpx rgba(242,143,162,0.3);
border-radius: 50%;
}
.icon-share, .icon-location {
width: 40rpx;
height: 40rpx;
}
.buy-coupon {
position: absolute;
top: 804rpx;
width: 670rpx;
height: 312rpx;
padding: 40rpx 32rpx;
background: rgba(255, 255, 255, 0.65);
box-shadow: 8rpx 10rpx 52rpx 0rpx rgba(238,211,153,0.3);
border-radius: 4rpx;
}
.buy-coupon-title image:nth-child(1) {
width: 120rpx;
height: 34rpx;
background-color: red;
}
.buy-coupon-title image:nth-child(2) {
width: 32rpx;
height: 32rpx;
margin-left: 8rpx;
background-color: red;
}
.buy-coupon-type {
margin-top: 32rpx;
}
.buy-coupon-type image {
width: 170rpx;
height: 166rpx;
background-color: aqua;
}
.buy-other {
position: absolute;
top: 1140rpx;
width: 670rpx;
}
.buy-snacks, .buy-art {
width: 322rpx;
height: 154rpx;
background: rgba(255, 255, 255, 0.65);
box-shadow: 8rpx 8rpx 52rpx 0rpx rgba(238,211,153,0.3);
border-radius: 4rpx;
}
.buy-left, .buy-right {
position: relative;
margin-left: 32rpx;
}
.buy-left image{
width: 120rpx;
height: 34rpx;
}
.buy-right image:first-child {
width: 132rpx;
height: 136rpx;
}
.snacks-img {
position: absolute;
top: 28rpx;
left: 42rpx;
width: 50rpx;
height: 76rpx;
}
.art-img {
position: absolute;
top: 30rpx;
left: 12rpx;
width: 86rpx;
height: 70rpx;
}
.swiper {
width: 750rpx;
height: 1160rpx;
background-color: lightblue;
}
.wx-swiper-dots{
position:relative;
left: 0;
right: 0;
}
.wx-swiper-dots.wx-swiper-dots-horizontal{
margin-bottom: 64rpx;
}
\ No newline at end of file
let App = getApp()
Page({
data: {
showMenu: false
showMenu: false,
menu: '全 部',
menuList: [
{id: 0, name: '全 部'},
{id: 1, name: '获 取'},
{id: 2, name: '已使用'}
],
pageNo: '1',
pageSize: '-1',
type: '', // "" 全部 0 获取 1消费(0 发放 1 兑换)
accumulateList: [],
selectedList: []
},
onLoad: function (options) {
this.getAccumulate()
},
// 获取积分列表
getAccumulate: function () {
App.wxRequest({
url: '/api/v1/smUser/getIntegralDetails',
data: {
'pageNo': this.data.pageNo,
'pageSize': this.data.pageSize,
type: ''
},
success: (response) => {
let accumulateList = response.data
let selectedList = accumulateList
this.setData({
accumulateList,
selectedList
})
}
})
},
// 显示菜单
onShowMenu: function () {
this.setData({
showMenu: true
})
},
// 隐藏菜单
onHideMenu: function () {
this.setData({
showMenu: false
})
},
/**
* 查询今日放映
* @function
* @param type 0全部 1获取 2已使用
* @returns
*/
onTabMenu: function (event) {
let { index } = event.currentTarget.dataset
let menu = this.data.menuList[index].name
let selectedList = []
if (index === 0) {
selectedList = this.data.accumulateList
} else {
selectedList = selectedList.filter(v => v.type === index-1)
}
this.setData({
menu,
selectedList
})
this.onHideMenu()
}
})
\ No newline at end of file
<navigation class="navigation" titleText="我的积分" color="#FFFFFF" backIcon="/image/back-w.png"></navigation>
<view class="container con-s">
<view class="container con-s" bindtap="onHideMenu">
<!-- 积分背景图 -->
<image class="banner" src=""></image>
......@@ -12,52 +12,38 @@
<text>积分用于兑换积分商品,积分商城即将上线,敬请期待</text>
</view>
<view class="banner-menu row align-c">
<text>全部</text>
<view class="banner-menu row con-b align-c" catchtap="onShowMenu">
<text>{{menu}}</text>
<image src="/image/icon/arrow-b-2.png"></image>
<view class="banner-menu-down col" wx:if="{{showMenu}}">
<text>全部</text>
<text>获取</text>
<text>已使用</text>
<block wx:for="{{menuList}}" wx:key="id">
<text class="{{menu === item.name ? 'selected' : ''}}" catchtap="onTabMenu" data-index="{{index}}">{{item.name}}</text>
</block>
</view>
</view>
<!-- 积分列表 -->
<!-- 无积分 -->
<!-- <view class="accumulate-empty" wx:if="{{true}}">
<view class="accumulate-empty" wx:if="{{accumulateList.length === 0}}">
<text>暂无积分明细</text>
</view> -->
</view>
<!-- 有积分 -->
<view class="accumulate-wrapper col align-c">
<block>
<view class="accumulate row con-b align-c">
<view class="accumulate-left col con-b">
<view class="accumulate-type">
<text>消费</text>
</view>
<view class="accumulate-time">
<text>2020-08-26 11:47</text>
</view>
</view>
<view class="accumulate-right {{item.type === '0' ? 'accumulate-type-color' : ''}}">
<text wx:if="{{item.type === '0'}}">+</text>
<text wx:else>-</text>
<text>50</text>
</view>
</view>
<view class="accumulate-wrapper col align-c" wx:else>
<block wx:for="{{accumulateList}}" wx:key="index">
<view class="accumulate row con-b align-c">
<view class="accumulate-left col con-b">
<view class="accumulate-type">
<text>消费</text>
<text wx:if="item.type === '0'">获取</text>
<text wx:else>消费</text>
</view>
<view class="accumulate-time">
<text>2020-08-26 11:47</text>
<text>{{item.createDate}}</text>
</view>
</view>
<view class="accumulate-right {{item.type === '0' ? 'accumulate-type-color' : ''}}">
<text wx:if="{{item.type === '0'}}">+</text>
<text wx:else>-</text>
<text>50</text>
<text>{{item.integral}}</text>
</view>
</view>
</block>
......
page {
height: 100vh;
background: linear-gradient(180deg, #FFFFFF 0%, #F3F4F6 100%);
}
.container {
position: relative;
height: 100vh;
}
.banner {
......@@ -31,10 +31,10 @@ page {
position: absolute;
top: 254rpx;
right: 40rpx;
width: 140rpx;
width: 166rpx;
height: 56rpx;
padding-left: 24rpx;
color: #000;
padding: 0 24rpx;
color: #15191F;
font-size: 26rpx;
background: rgba(255, 255, 255, 0.95);
border-radius: 4rpx;
......@@ -51,7 +51,7 @@ page {
z-index: 99999999;
left: 0;
top: 64rpx;
width: 140rpx;
width: 166rpx;
height: 180rpx;
background: rgba(255, 255, 255, 0.95);
box-shadow: 10px 4px 40px 0px rgba(181,164,164,0.3);
......@@ -67,6 +67,10 @@ page {
border-radius: 4rpx;
}
.selected {
color: #15191F !important;
}
.accumulate-tips {
width: 670rpx;
margin-top: 8rpx;
......
......@@ -126,7 +126,7 @@ Page({
App.login({
success: (token) => {
this.getMyActivityList()
this.getList()
// this.getList()
this.getAuth()
}
})
......
......@@ -245,13 +245,38 @@
</view>
</view>
<!-- 夜间入园预约 -->
<!-- <view class="appointment-wrapper">
<view class="appointment-time"></view>
</view> -->
<view class="appointment-wrapper">
<view class="appointment-time">
<text>7月15日 10:00-12:00</text>
</view>
<view class="appointment-activity-content row align-c con-b">
<view class="appointment-content col con-b">
<view class="appointment-activity-title">
<text>夜间入园预约</text>
</view>
<view class="appointment-activity-num">
<text>预约人数 3人</text>
</view>
</view>
<view class="border-right"></view>
<view class="appointment-subscribe" data-item="{{item}}" bindtap="gohotelAccommodation">预约凭证</view>
</view>
</view>
<!-- 看房预约 -->
<!-- <view class="appointment-wrapper">
<view class="appointment-time"></view>
</view> -->
<view class="appointment-wrapper">
<view class="appointment-time">
<text>7月15日 10:00-12:00</text>
</view>
<view class="appointment-activity-content row align-c con-b">
<view class="appointment-content col con-c">
<view class="appointment-activity-title">
<text>看房预约</text>
</view>
</view>
<view class="border-right"></view>
<view class="appointment-subscribe" data-item="{{item}}" bindtap="gohotelAccommodation">预约凭证</view>
</view>
</view>
</view>
<!-- more -->
<view class="more row align-c con-c" bindtap="onShowMoreActivity">
......
......@@ -546,6 +546,28 @@
font-size: 26rpx;
}
.appointment-content {
width: 305rpx;
height: 110rpx;
}
.border-right {
width: 1rpx;
height: 75rpx;
background-color: #E2E7EF;
}
.appointment-subscribe {
width: 150rpx;
height: 70rpx;
border: 1px solid #15191f;
border-radius: 4px;
line-height: 70rpx;
text-align: center;
font-size: 26rpx;
font-weight: 500;
color: #15191f;
}
.more {
margin-top: 32rpx;
}
......
......@@ -4,23 +4,29 @@ Page({
data: {
imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase,
orderTypeTitle: '全部分类',
orderTypeHeight: 0,
orderType: [],
orderTypeActive: 0,
statusList: [
{ 'value': '', 'name': '全部' },
{ 'value': '0', 'name': '待付款' },
{ 'value': '1', 'name': '待使用' },
{ 'value': '-1, 4', 'name': '取消/过期' },
isDoing: false,
statusList: [{
'value': '',
'name': '全部'
},
{
'value': '0',
'name': '待付款'
},
{
'value': '1',
'name': '待使用'
},
{
'value': '-1, 4',
'name': '取消/过期'
},
],
statusActive: 0,
orderList: [],
orderPages: 1,
winOrderType: false,
......@@ -61,6 +67,7 @@ Page({
'status': Number(funcResponse[i].status),
'amount': funcResponse[i].totalMoney,
'commodity': [],
'wxRequest': funcResponse[i].wxRequest
}
// 添加订单商品列表
......@@ -113,7 +120,10 @@ Page({
success: (response) => {
console.log(response)
let funcResponse = response.data
let funcList = [{ 'value': '', 'name': '全部分类' }]
let funcList = [{
'value': '',
'name': '全部分类'
}]
for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = {
'value': funcResponse[i].value,
......@@ -209,7 +219,21 @@ Page({
* @returns
*/
onOrderCancel: function (event) {
let that = this
wx.showLoading({
title: '处理中',
mask: true
})
this.setData({
isDoing: true
})
let funcItem = event.target.dataset.item
// let index = event.target.dataset.index
// // 无刷新更新数据
// let status = `orderList[${index}].status`
// this.setData({
// [status]:-1
// })
App.wxRequest({
url: '/api/v1/order/cancelOrder',
data: {
......@@ -217,14 +241,19 @@ Page({
'type': 0,
},
success: (response) => {
console.log(response)
}
wx.hideLoading()
that.setData({
isDoing: false
})
this.setData({
that.setData({
'orderList': [],
'orderPages': 1,
})
this.queryOrder()
that.queryOrder()
}
})
},
/**
......@@ -234,6 +263,14 @@ Page({
* @returns
*/
onOrderRemove: function (event) {
let that = this
wx.showLoading({
title: '处理中',
mask: true
})
this.setData({
isDoing: true
})
let funcItem = event.target.dataset.item
App.wxRequest({
url: '/api/v1/order/cancelOrder',
......@@ -242,14 +279,48 @@ Page({
'type': 1,
},
success: (response) => {
console.log(response)
}
})
this.setData({
wx.hideLoading()
that.setData({
isDoing: false,
'orderList': [],
'orderPages': 1,
})
this.queryOrder()
that.queryOrder()
console.log(response)
}
})
},
/**
* 检验数据是否都通过
* @function
* @param
* @returns
*/
inspectData: function () {
let funcPass = true
// 校验数组用户信息
let funcRegisterInfo = this.data.registerInfo
for (let i = 0, l = funcRegisterInfo.length; i < l; i++) {
if (funcRegisterInfo[i].name === '' || funcRegisterInfo[i].errorName !== '') {
this.setUserInfo('name', funcRegisterInfo[i].name, i, App.modular.rule.item('name', funcRegisterInfo[i].name))
funcPass = false
}
if (funcRegisterInfo[i].phone === '' || funcRegisterInfo[i].errorPhone !== '') {
this.setUserInfo('phone', funcRegisterInfo[i].phone, i, App.modular.rule.item('phone', funcRegisterInfo[i].phone))
funcPass = false
}
// 仅在需要的订单场景下校验
if ([1].indexOf(this.data.orderType) >= 0) {
if (funcRegisterInfo[i].identity === '' || funcRegisterInfo[i].errorIdentity !== '') {
this.setUserInfo('identity', funcRegisterInfo[i].identity, i, App.modular.rule.item('identity', funcRegisterInfo[i].identity))
funcPass = false
}
}
}
return funcPass
},
/**
......@@ -258,7 +329,34 @@ Page({
* @param
* @returns
*/
onOrderPay: function (event) {
// 数据校验不通过
let that = this
let funcItem = event.currentTarget.dataset.item
let wxRequest = funcItem.wxRequest
// 待支付返回的wx支付参数
if (wxRequest) {
wx.requestPayment({
timeStamp: wxRequest.timeStamp,
nonceStr: wxRequest.nonceStr,
package: wxRequest.package,
signType: wxRequest.signType,
paySign: wxRequest.paySign,
success(res) {
that.setData({
'orderList': [],
'orderPages': 1,
})
that.queryOrder()
},
fail(res) {}
})
}
},
......@@ -269,7 +367,7 @@ Page({
* @returns
*/
onOrderUse: function (event) {
this.onOrderDetail()
this.onOrderDetail(event)
},
/**
......@@ -289,6 +387,10 @@ Page({
* @returns
*/
onOrderAgain: function (event) {
console.log(event, 'onOrderAgain');
wx.navigateTo({
url: '/pages/commodity/menu-food/menu-food',
})
},
......
......@@ -99,15 +99,15 @@
<view class="order-list-item-operation row con-b align-c">
<view class="row align-c">
<text class="amount">实付:</text>
<text class="amount">¥20.00</text>
<text class="amount">¥{{item.amount}}</text>
</view>
<view class="row align-c">
<button wx:if="{{item.status === 0}}" class="delete row con-c align-c" data-item="{{item}}" catchtap="onOrderCancel">取消订单</button>
<button wx:if="{{item.status === -1 || item.status === 4}}" class="delete row con-c align-c" data-item="{{item}}" catchtap="onOrderRemove">删除订单</button>
<button wx:if="{{item.status === 0}}" class="again row con-c align-c" data-item="{{item}}" catchtap="onOrderPay">去支付</button>
<button wx:if="{{item.status === 2}}" class="again row con-c align-c" data-item="{{item}}" catchtap="onOrderUse">去使用</button>
<button wx:if="{{item.status === 3}}" class="again row con-c align-c" data-item="{{item}}" catchtap="onOrderEvaluate">去评价</button>
<button wx:if="{{item.status === -1}}" class="again row con-c align-c" data-item="{{item}}" catchtap="onOrderAgain">再次下单</button>
<button wx:if="{{item.status === 0}}" class="delete row con-c align-c" data-index="{{index}}" data-item="{{item}}" catchtap="onOrderCancel" disabled="{{isDoing}}">取消订单</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === -1 || item.status === 4}}" class="delete row con-c align-c" data-item="{{item}}" catchtap="onOrderRemove">删除订单</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === 0}}" class="again row con-c align-c" data-item="{{item}}" catchtap="onOrderPay">去支付</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === 2}}" class="again row con-c align-c" data-item="{{item}}" catchtap="onOrderUse">去使用</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === 3}}" class="again row con-c align-c" data-item="{{item}}" catchtap="onOrderEvaluate">去评价</button>
<button disabled="{{isDoing}}" wx:if="{{item.status === -1}}" class="again row con-c align-c" data-item="{{item}}" catchtap="onOrderAgain">再次下单</button>
</view>
</view>
</view>
......
const App = getApp()
Page({
data: {
orderType: 1, // 1 - 年卡/月卡,2 - 次票, 3 - SPA, 4 - 文创, 5 - 餐品, 6 - 活动, 7 - 观影
couponInfo: {
type: '套票',
store: '儿童营地',
id: '26719921231',
useTime: '2020-11-06'
couponInfo: null,
// {
// type: '套票',
// store: '儿童营地',
// id: '26719921231',
// useTime: '2020-11-06'
// },
goodsList: null,
// [
// {
// id: 0,
// cover: '',
// name: '咖喱蔬菜大虾',
// quantity: '2',
// price: '30.60'
// },
// {
// id: 1,
// cover: '',
// name: '南瓜坚果汤',
// quantity: '3',
// price: '30.60'
// },
// ],
userList: null,
orderInfo: null,
// {
// name: '林有一',
// phone: '15802035122',
// idNum: '350600366462131',
// },
remarks: null, // 备注
couponDetail: null,
},
goodsList: [
{
id: 0,
cover: '',
name: '咖喱蔬菜大虾',
quantity: '2',
price: '30.60'
onLoad: function (options) {
console.log(options)
// if (options.type) options.type = Number(options.type)
// let orderType = options.type
// this.setData({
// orderType
// })
// this.setView()
if (options.couponDetail) {
let data = JSON.parse(options.couponDetail)
let tmpGoodsList = [];
data.smOrderDetails.forEach(item => {
var tmpItem = {
id: item.commodityId,
cover: item.imgUrl,
name: item.name,
quantity: item.number,
price: item.totalPrices,
}
tmpGoodsList.push(tmpItem)
})
let tmpUserList = [];
data.smPersonalDetails.forEach(item => {
var tmpItem = {
name: item.name,
phone: item.cellPhone,
idNum: item.identityCard,
}
tmpUserList.push(tmpItem)
})
this.setData({
['couponInfo.type']: data.goodType,
['couponInfo.store']: data.officeName,
['couponInfo.id']: data.serialNumber,
['couponInfo.useTime']: data.expireTime,
goodsList: tmpGoodsList,
userList: tmpUserList,
remarks: data.remarks,
couponDetail: data,
})
}
},
{
id: 1,
cover: '',
name: '南瓜坚果汤',
quantity: '3',
price: '30.60'
// 取消核销
cancelOperation() {
wx.navigateBack()
},
],
orderInfo: {
name: '林有一',
phone: '15802035122',
idNum: '350600366462131',
// 确认核销'
submitOperation() {
let that = this
wx.lin.showDialog({
type:"confirm",
title:"",
content:"是否确认核销券码" ,
success: (res) => {
if (res.confirm) {
console.log('用户点击确定')
that.doVolume()
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
onLoad: function (options) {
console.log(options)
if (options.type) options.type = Number(options.type)
let orderType = options.type
this.setData({
orderType
doVolume() {
let that = this
wx.lin.showToast({
icon: 'loading',
title: '正在核销',
show: true,
mask: true,
duration: 1000 * 60,
})
App.wxRequest({
url: '/api/v1/volume/doVolume',
data: {
volumeId: that.data.couponDetail.volumeId,
},
success: function(res) {
wx.lin.showToast({
image: '/image/success.png',
title: '核销成功',
})
this.setView()
setTimeout(()=>{
wx.navigateBack()
},2000);
},
setView() {
let orderType = this.data.orderType
switch (orderType) {
case 4:
this.setData({
goodsList: [
{
cover: '',
name: '《海错图》超级豪华精致古风限量版折扇',
quantity: '1',
price: '30.60'
fail: function(err) {
wx.lin.showToast({
image: '/image/error.png',
title: err.msg,
})
}
],
note: '身份证号变更为350600366462132'
})
break
case 5:
break
}
},
})
\ No newline at end of file
<navigation class="navigation" titleText="券码核销" background="#ffffff" backIcon="/image/back.png"></navigation>
<l-dialog />
<l-toast l-image-class="toast-image"></l-toast>
<view class="container">
<view class="list-wrapper">
<view class="title-wrapper">兑换券信息</view>
......@@ -25,7 +26,7 @@
<view class="goods-list">
<view class="goods-item row align-c" wx:for="{{goodsList}}" wx:key="id">
<view class="goods-img">
<image mode="widthFix" src="{{item.cover}}"></image>
<image mode="aspectFill" src="{{item.cover}}"></image>
</view>
<view class="goods-name">{{item.name}}</view>
<view class="goods-price-num col">
......@@ -38,47 +39,32 @@
</view>
</view>
</view>
<view class="list-wrapper">
<view class="list-wrapper" wx:for="{{userList}}" wx:key="index">
<view class="title-wrapper">订单详情</view>
<view class="info-wrapper row con-b">
<view class="info-name">姓名</view>
<view class="info-text">{{orderInfo.name}}</view>
<view class="info-text">{{item.name}}</view>
</view>
<view class="info-wrapper row con-b">
<view class="info-wrapper row con-b" wx:if="{{item.phone}}">
<view class="info-name">手机</view>
<view class="info-text">{{orderInfo.phone}}</view>
</view>
<view class="info-wrapper row con-b">
<view class="info-name">身份证</view>
<view class="info-text">{{orderInfo.idNum}}</view>
</view>
<view class="info-text">{{item.phone}}</view>
</view>
<view class="list-wrapper">
<view class="title-wrapper">订单详情</view>
<view class="info-wrapper row con-b">
<view class="info-name">姓名</view>
<view class="info-text">{{orderInfo.name}}</view>
</view>
<view class="info-wrapper row con-b">
<view class="info-name">手机</view>
<view class="info-text">{{orderInfo.phone}}</view>
</view>
<view class="info-wrapper row con-b">
<view class="info-wrapper row con-b" wx:if="{{item.idNum}}">
<view class="info-name">身份证</view>
<view class="info-text">{{orderInfo.idNum}}</view>
<view class="info-text">{{item.idNum}}</view>
</view>
</view>
<view class="list-wrapper" wx:if="{{note}}">
<view class="list-wrapper" wx:if="{{remarks}}">
<view class="title-wrapper">备注</view>
<view class="info-wrapper row con-b">
<view class="info-name">{{note}}</view>
<view class="info-name">{{remarks}}</view>
</view>
</view>
</view>
<view class="footer-wrapper">
<view class="footer-btn row con-b align-e">
<view class="cancel-btn">取消核销</view>
<view class="confirm-btn">确认核销</view>
<view class="cancel-btn" bindtap="cancelOperation">取消核销</view>
<view class="confirm-btn" bindtap="submitOperation">确认核销</view>
</view>
<Blank></Blank>
</view>
.container {
margin-top: 120rpx;
margin-top: 150rpx;
padding-bottom: 196rpx;
}
.list-wrapper {
......
const App = getApp()
Page({
data: {
avatarUrl: '/pages/mine/home/image/avatar.png',
showDialog: false
showDialog: false,
showDialogSmg: '非本店券码,无法使用',
couponCode: '',
},
onLoad: function (options) {
},
handleWriteOff() {
let showDialog = true
this.getVolumeDetails(this.data.couponCode)
},
//券码输入
bindCouponInput(e) {
this.setData({
showDialog
couponCode: e.detail.value
})
},
// 扫码
handleScanCode() {
let that = this
wx.scanCode({
onlyFromCamera: true,
success: (res) => {
console.log(res)
let result = res.result
that.getVolumeDetails(result)
}
})
},
getVolumeDetails(couponCode) {
if (!couponCode || couponCode.length == 0) {
wx.lin.showToast({
image: '/image/error.png',
title: '请输入券码',
})
return
}
let that = this
wx.lin.showToast({
icon: 'loading',
title: '正在识别',
show: true,
mask: true,
duration: 1000 * 60,
})
App.wxRequest({
url: '/api/v1/volume/getVolumeDetails',
data: {
serialNumber: couponCode,
},
success: function(res) {
wx.lin.hideToast()
let couponDetail = JSON.stringify(res.data)
wx.navigateTo({
url: '/pages/pay/coupon-detail/coupon-detail?couponDetail='+couponDetail,
})
},
fail: function(err) {
wx.lin.hideToast()
that.setData({
showDialogSmg: err.msg,
showDialog: true
})
}
})
}
......
<navigation class="navigation" titleText="券码核销" backIcon="/image/back.png"></navigation>
<l-toast l-image-class="toast-image"></l-toast>
<view class="container">
<!-- 头像信息 -->
<view class="header col align-c">
......@@ -25,12 +25,12 @@
</view>
<!-- 核销输入框 -->
<view class="coupon-input-wrapper row con-b">
<input placeholder="请输入券码" placeholder-style="color: #C2C7CF"></input>
<input placeholder="请输入券码" placeholder-style="color: #C2C7CF" bindinput="bindCouponInput" value="{{couponCode}}"></input>
<view class="coupon-input-btn" bindtap="handleWriteOff">核销</view>
<l-dialog show="{{showDialog}}" l-class="dialog-wrapper" l-title-class="dialog-title" l-confirm-class="dialog-confirm" title="非本店券码,无法使用">
<view class="dialog-content">所属门店:原味舒食</view>
<l-dialog show="{{showDialog}}" l-class="dialog-wrapper" l-title-class="dialog-title" l-confirm-class="dialog-confirm" title="{{showDialogSmg}}">
<!-- <view class="dialog-content">所属门店:原味舒食</view> -->
</l-dialog>
<l-toast show="{{true}}" l-image-class="toast-image" l-class="toast-bg" image="/image/success.png" title="核销成功" />
<!-- <l-toast show="{{true}}" l-image-class="toast-image" l-class="toast-bg" image="/image/success.png" title="核销成功" /> -->
</view>
<!-- 扫码核销 -->
......
......@@ -14,6 +14,8 @@ Page({
codeInfo: {},
isFromUse: false,
winCode: false,
residuePayTime: "",//剩余支付时间
},
onLoad: function (options) {
......@@ -53,7 +55,6 @@ Page({
'contactPhone': funcResponse.mobilePhone, // 联系人电话
'commodityType': Number(funcResponse.goodType), // 商品类型
'commodity': [],
'tipOrderNo': funcResponse.orderSerialNumber, // 订单编号
'tipTimeSubmit': funcResponse.createDate,
'tipTimePay': App.modular.miment(funcResponse.paymentTime).format('YYYY-MM-DD hh:mm:ss'),
......@@ -73,6 +74,28 @@ Page({
}
funcOrderInfo.commodity.push(funcCommodityItem)
}
// 倒计时
let that = this
if (funcOrderInfo.state == 0) {
let timeInter = setInterval(() => {
let creatdTime = new Date(funcOrderInfo.tipTimeSubmit.replace(/-/g, '/')).getTime()
let doTime = 15 * 60 * 1000
let endTime = creatdTime + doTime
let now = new Date().getTime()
let residueStamp = endTime - now
let residuePayTime = App.modular.miment(residueStamp).format('mm:ss') // 57
if (residueStamp > 0) {
that.setData({
residuePayTime: residuePayTime
})
} else {
that.queryOrderDetail()
clearInterval(timeInter)
}
}, 1000)
}
this.setData({
orderInfo: funcOrderInfo
......@@ -87,6 +110,8 @@ Page({
})
},
onCouponCode: function (event) {
let funcOrderInfo = event.currentTarget.dataset.item
App.wxRequest({
......
......@@ -8,7 +8,7 @@
<text>订单待付款</text>
</view>
<view class="state-content-tip row">
<text>内付款,否则将自动取消订单</text>
<text>请在 {{residuePayTime}} 内付款,否则将自动取消订单</text>
</view>
</view>
......@@ -23,7 +23,7 @@
<text>订单已过期</text>
</view>
<view class="state-content-tip row">
<text>内付款,否则将自动取消订单</text>
<text>有效期xxx-xxx</text>
</view>
</view>
......@@ -32,7 +32,7 @@
<text>订单已取消</text>
</view>
<view class="state-content-tip row">
<text>内付款,否则将自动取消订单</text>
<text>下单后15分钟内未付款,自动取消订单</text>
</view>
</view>
......@@ -79,7 +79,6 @@
<text class="info-content-item-tip">18030303030</text>
</view>
</view>
<view class="info-line row con-b align-c">
<view class="info-line-point-left"></view>
<view class="info-line-line"></view>
......
......@@ -18,9 +18,7 @@ Page({
data: {
imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase,
animation: {},
shopInfo: {},
orderId: '',
orderType: 1, // 1 - 年卡月卡,2 - 普通商品, 3 - 门票商品, 4 - 文创, 5 - 餐品, 6 - 活动, 7 - 观影
......
......@@ -9,7 +9,6 @@ Page({
statusList: [],
movieInfo: {},
showList: {},
free: '免费'
},
onLoad: function (options) {
let activityId = options.id
......
......@@ -8,7 +8,7 @@ Page({
pageSize: '-1'
},
statusActive: 0,
statusActive: 1,
statusList: [
{ 'id': 0, 'name': '今日放映' },
{ 'id': 1, 'name': '全部热映' },
......@@ -17,16 +17,7 @@ Page({
// 今日热映
movieToday: [],
//全部热映
movieAll: {
movieWeek: {
title: '本周热映',
list: []
},
movieNextWeek: {
title: '下周热映',
list: []
}
}
movieAll: {}
},
onLoad: function () {
this.getTodayFilm()
......@@ -81,7 +72,10 @@ Page({
v.filmLead = v.filmLead.replace(/\//g, ' ')
})
this.setData({
'movieAll.movieWeek.list': movieWeek
'movieAll.movieWeek': {
title: '本周热映',
list: movieWeek
}
})
}
})
......@@ -101,7 +95,10 @@ Page({
v.filmLead = v.filmLead.replace(/\//g, ' ')
})
this.setData({
'movieAll.movieNextWeek.list': movieNextWeek
'movieAll.movieNextWeek': {
title: '下周热映',
list: movieNextWeek
}
})
}
})
......
......@@ -74,8 +74,14 @@
</view>
<view wx:else>
<block wx:for="{{movieAll}}" wx:for-index="key" wx:for-item="movieList" wx:key="key">
<view class="movie-week" wx:if="{{movieList.list.length > 0}}">
<view class="movie-week row align-c con-c" wx:if="{{movieList.list.length > 0}}">
<view class="line"></view>
<view class="movie-week-title">
<image class="star-left" src=""></image>
<text>{{movieList.title}}</text>
<image class="star-right" src="/image/star-right.png"></image>
</view>
<view class="line"></view>
</view>
<block wx:for="{{movieList.list}}" wx:key="id">
<view class="all-movie-wrapper" bindtap="onToMovieDetail" data-movieId="{{item.activityId}}">
......
......@@ -150,8 +150,39 @@ page {
color: #C2C7CF;
font-size: 22rpx;
text-align: center;
letter-spacing: 3rpx;
line-height: 44rpx;
}
.movie-week-title {
position: relative;
margin: 0 8rpx;
padding: 8rpx 40rpx 4rpx;
}
.star-left {
position: absolute;
left: 0;
bottom: 0;
width: 36rpx;
height: 8rpx;
background-color: #ccc;
}
.star-right {
position: absolute;
right: 0;
top: 0;
width: 68rpx;
height: 40rpx;
background-color: #ccc;
}
.line {
width: 80rpx;
height: 1rpx;
background: #E2E7EF;
}
.all-movie-wrapper {
position: relative;
width: 670rpx;
......
......@@ -27,7 +27,7 @@
"outputPath": ""
},
"useIsolateContext": true,
"useCompilerModule": true,
"useCompilerModule": false,
"userConfirmedUseCompilerModuleSwitch": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
......@@ -187,6 +187,19 @@
"pathName": "pages/mine/accumulate/accumulate",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/mine/home/home",
"pathName": "pages/mine/home/home",
"query": "",
"scene": null
},
{
"id": -1,
"name": "pages/campsite/home/home",
"pathName": "pages/campsite/home/home",
"scene": null
}
]
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment