Commit 72a69f56 by 严立

LL - 下单流程问题修复

parent f048acfc
...@@ -46,32 +46,32 @@ App({ ...@@ -46,32 +46,32 @@ App({
}, },
wxRequest: function (obj) { wxRequest: function (obj) {
let that = this var token = this.globalData.token
var token = that.globalData.token
var param = obj.data ? JSON.stringify(obj.data) : "" var param = obj.data ? JSON.stringify(obj.data) : ""
var header = obj.header ? obj.header : { 'token': token || '', } var header = obj.header ? obj.header : { 'token': token || '', }
wx.request({ wx.request({
url: that.globalData.baseUrl + obj.url, url: this.globalData.baseUrl + obj.url,
data: param, data: param,
method: obj.method || "POST", method: obj.method || "POST",
header: header, header: header,
success: function (res) { success: (res) => {
// console.log("接口:", that.globalData.baseUrl + obj.url); // console.log("接口:", this.globalData.baseUrl + obj.url);
// console.log("参数:", JSON.stringify(obj.data)); // console.log("参数:", JSON.stringify(obj.data));
// console.log("返回:", res); // console.log("返回:", res);
let code = res.data.code * 1; let code = res.data.code * 1;
if (200 == code && true == res.data.success) { if (200 == code) {
// if (200 == code && true == res.data.success) {
if (obj.success) { if (obj.success) {
obj.success(res.data) obj.success(res.data)
} }
} else if (402 == code) { // token失效 } else if (402 == code) { // token失效
// that.refreshToken({ this.refreshToken({
// success: function () { success: function () {
// that.wxRequest(obj) this.wxRequest(obj)
// } }
// }) })
} else { } else {
if (obj.fail) { if (obj.fail) {
let err = { let err = {
...@@ -82,10 +82,10 @@ App({ ...@@ -82,10 +82,10 @@ App({
} }
} }
}, },
fail: function (err) { fail: (err) => {
console.log("接口:", that.globalData.baseUrl + obj.url); console.log("接口:", this.globalData.baseUrl + obj.url)
console.log("参数:", obj.data); console.log("参数:", obj.data)
console.log("返回:", err); console.log("返回:", err)
if (obj.fail) { if (obj.fail) {
let err = { let err = {
statusCode: 9999, statusCode: 9999,
...@@ -149,16 +149,16 @@ App({ ...@@ -149,16 +149,16 @@ App({
} }
}, },
registUserInfo(obj) { registUserInfo: function (obj) {
this.wxRequest({ this.wxRequest({
url: '/api/v1/login/getDecryptData', url: '/api/v1/login/getDecryptData',
data: obj.param, data: obj.param,
success: function (res) { success: (res) => {
if (obj.success) { if (obj.success) {
obj.success(res) obj.success(res)
} }
}, },
fail: function (err) { fail: (err) => {
if (obj.fail) { if (obj.fail) {
obj.fail(err) obj.fail(err)
} }
...@@ -166,25 +166,23 @@ App({ ...@@ -166,25 +166,23 @@ App({
}) })
}, },
refreshToken(obj) { refreshToken: function (obj) {
let that = this
this.wxRequest({ this.wxRequest({
url: '/api/v1/login/refreshToken', url: '/api/v1/login/refreshToken',
header: { header: {
token: this.globalData.token, token: this.globalData.token,
refreshToken: this.globalData.refreshToken refreshToken: this.globalData.refreshToken
}, },
success: function (res) { success: (res) => {
let token = res.data.token let token = res.data.token
let refreshToken = res.data.refreshToken let refreshToken = res.data.refreshToken
that.globalData.token = token this.globalData.token = token
that.globalData.refreshToken = refreshToken this.globalData.refreshToken = refreshToken
if (obj.success) { if (obj.success) {
obj.success() obj.success()
} }
} }
}) })
} }
......
...@@ -14,6 +14,10 @@ Page({ ...@@ -14,6 +14,10 @@ Page({
}, },
onLoad: function () { onLoad: function () {
},
onShow: function () {
this.queryRecommend() this.queryRecommend()
}, },
......
...@@ -36,6 +36,11 @@ Page({ ...@@ -36,6 +36,11 @@ Page({
this.querySideBar() this.querySideBar()
}, },
onUnload: function () {
// 离开页面清空商品数据
wx.setStorageSync('shoppingCartBuffer', [])
},
/** /**
* 添加动画初始 * 添加动画初始
* @function * @function
...@@ -143,7 +148,7 @@ Page({ ...@@ -143,7 +148,7 @@ Page({
for (let i = 0, l = funcResponse.length; i < l; i++) { for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = { let funcItem = {
'id': funcResponse[i].id, // 商品标识 'id': funcResponse[i].id, // 商品标识
'typeId': funcResponse[i].classifyId, // 商品分类标识 'typeId': funcResponse[i].genre, // 商品分类标识
'inventoriesId': funcResponse[i].inventoriesId, // 仓库标识 'inventoriesId': funcResponse[i].inventoriesId, // 仓库标识
'name': funcResponse[i].name, 'name': funcResponse[i].name,
'cover': funcResponse[i].coverImg, // 商品封面 'cover': funcResponse[i].coverImg, // 商品封面
...@@ -157,6 +162,7 @@ Page({ ...@@ -157,6 +162,7 @@ Page({
'describe': funcResponse[i].synopsis, 'describe': funcResponse[i].synopsis,
'describeDetail': '', // 商品描述详情,在点击详情时获得数据 'describeDetail': '', // 商品描述详情,在点击详情时获得数据
'tags': funcResponse[i].tags, 'tags': funcResponse[i].tags,
'notificationId': funcResponse[i].notificationId, // 下单须知
'quantityMin': 1, 'quantityMin': 1,
'quantityMax': funcResponse[i].number, 'quantityMax': funcResponse[i].number,
......
...@@ -7,6 +7,7 @@ Page({ ...@@ -7,6 +7,7 @@ Page({
animationData: {}, animationData: {},
animationPointHeight: 0, animationPointHeight: 0,
animationPointOrigin: 0,
winAnimationPoint: false, winAnimationPoint: false,
...@@ -30,12 +31,19 @@ Page({ ...@@ -30,12 +31,19 @@ Page({
}, },
onLoad: function () { onLoad: function () {
this.resetShoppingCart()
this.setCartAnimation() this.setCartAnimation()
this.setShopInfo() this.setShopInfo()
this.querySideBar() this.querySideBar()
}, },
onShow: function () {
if (wx.getStorageSync('shoppingCartBuffer').length === 0) {
this.resetShoppingCart()
}
},
/** /**
* 添加动画初始 * 添加动画初始
* @function * @function
...@@ -48,6 +56,16 @@ Page({ ...@@ -48,6 +56,16 @@ Page({
duration: 500, duration: 500,
timingFunction: 'ease' timingFunction: 'ease'
}) })
// 获取购物车高度
const funcQuery = wx.createSelectorQuery()
funcQuery.select('#cart').boundingClientRect()
funcQuery.exec((result) => {
console.log(result)
this.setData({
animationPointOrigin: result[0].top + 4
})
})
}, },
/** /**
...@@ -69,7 +87,7 @@ Page({ ...@@ -69,7 +87,7 @@ Page({
winAnimationPoint: true, winAnimationPoint: true,
}) })
let funcTimer = setTimeout(() => { let funcTimer = setTimeout(() => {
this.animation.translate(0, 0).step() this.animation.translate(0, this.data.animationPointOrigin).step()
this.setData({ this.setData({
animationData: this.animation.export(), animationData: this.animation.export(),
// winAnimationPoint: false, // winAnimationPoint: false,
...@@ -86,6 +104,14 @@ Page({ ...@@ -86,6 +104,14 @@ Page({
console.log(this.data.shopInfo) console.log(this.data.shopInfo)
}, },
resetShoppingCart: function () {
this.setData({
shoppingCart: [],
shoppingCartTotal: 0,
})
wx.setStorageSync('shoppingCartBuffer', [])
},
/** /**
* 查询分类 * 查询分类
* @function * @function
...@@ -143,7 +169,7 @@ Page({ ...@@ -143,7 +169,7 @@ Page({
for (let i = 0, l = funcResponse.length; i < l; i++) { for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = { let funcItem = {
'id': funcResponse[i].id, // 商品标识 'id': funcResponse[i].id, // 商品标识
'typeId': funcResponse[i].classifyId, // 商品分类标识 'typeId': funcResponse[i].genre, // 商品分类标识
'inventoriesId': funcResponse[i].inventoriesId, // 仓库标识 'inventoriesId': funcResponse[i].inventoriesId, // 仓库标识
'name': funcResponse[i].name, 'name': funcResponse[i].name,
'cover': funcResponse[i].coverImg, // 商品封面 'cover': funcResponse[i].coverImg, // 商品封面
...@@ -157,9 +183,10 @@ Page({ ...@@ -157,9 +183,10 @@ Page({
'describe': funcResponse[i].synopsis, 'describe': funcResponse[i].synopsis,
'describeDetail': '', // 商品描述详情,在点击详情时获得数据 'describeDetail': '', // 商品描述详情,在点击详情时获得数据
'tags': funcResponse[i].tags, 'tags': funcResponse[i].tags,
'notificationId': funcResponse[i].notificationId, // 下单须知
'quantityMin': 1, 'quantityMin': 1,
'quantityMax': funcResponse[i].number, 'quantityMax': funcResponse[i].number < 20 ? funcResponse[i].number : 20, // 最大上限 20 件
'isActive': true, 'isActive': true,
} }
...@@ -183,6 +210,9 @@ Page({ ...@@ -183,6 +210,9 @@ Page({
winLoading: false, winLoading: false,
commodityList: funcCommodityList, commodityList: funcCommodityList,
}) })
console.log('commodityList')
console.log(JSON.stringify(this.data.commodityList))
}, },
}) })
}, },
...@@ -212,6 +242,7 @@ Page({ ...@@ -212,6 +242,7 @@ Page({
* @returns * @returns
*/ */
onCommodityDetail: function (event) { onCommodityDetail: function (event) {
console.log('onCommodityDetail', event)
let funcItem = event.currentTarget.dataset.item let funcItem = event.currentTarget.dataset.item
App.wxRequest({ App.wxRequest({
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
<view class="menu-list"> <view class="menu-list">
<view class="right-content-title">{{menuTitle}}</view> <view class="right-content-title">{{menuTitle}}</view>
<block wx:for="{{commodityList}}" wx:for-index="index" wx:for-item="item" wx:key="index"> <block wx:for="{{commodityList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
<view class="commodity-item row"> <view class="commodity-item row" data-item="{{item}}" bind:tap="onCommodityDetail">
<view class="item-img" data-item="{{item}}" bindtap="onCommodityDetail"> <view class="item-img">
<image src="{{item.cover}}" mode="widthFix"></image> <image src="{{item.cover}}" mode="widthFix"></image>
</view> </view>
<view class="item-info"> <view class="item-info">
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
</view> </view>
<view class="item-operation-add"> <view class="item-operation-add">
<button class="row con-c align-c" data-item="{{item}}" bindtap="onCommodityAdd"> <button class="row con-c align-c" data-item="{{item}}" catchtap="onCommodityAdd">
<image mode="widthFix" src="{{imageBase + 'icon/cart-3.png'}}"></image> <image mode="widthFix" src="{{imageBase + 'icon/cart-3.png'}}"></image>
</button> </button>
</view> </view>
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
</block> </block>
<!-- 购物车按钮 --> <!-- 购物车按钮 -->
<view class="cart-btn row con-c align-c" bindtap="onShoppingCart"> <view id="cart" class="cart row con-c align-c" bindtap="onShoppingCart">
<!-- 添加动画圆点 --> <!-- 添加动画圆点 -->
<view class="cart-animation" wx:if="{{winAnimationPoint}}" animation="{{animationData}}"></view> <view class="cart-animation" wx:if="{{winAnimationPoint}}" animation="{{animationData}}"></view>
......
...@@ -58,7 +58,7 @@ page { ...@@ -58,7 +58,7 @@ page {
color: #959da9; color: #959da9;
} }
.cart-btn { .cart {
position: fixed; position: fixed;
right: 48rpx; right: 48rpx;
bottom: 160rpx; bottom: 160rpx;
...@@ -378,9 +378,10 @@ image { ...@@ -378,9 +378,10 @@ image {
/* 购物车样式 */ /* 购物车样式 */
.cart-animation { .cart-animation {
position: fixed; position: fixed;
top: 0;
right: 48rpx; right: 48rpx;
width: 26rpx; width: 26rpx;
height: 26rpx; height: 26rpx;
border-radius: 50%; border-radius: 50%;
background: red; background: #86c5e1;
} }
\ No newline at end of file
...@@ -36,6 +36,11 @@ Page({ ...@@ -36,6 +36,11 @@ Page({
this.querySideBar() this.querySideBar()
}, },
onUnload: function () {
// 离开页面清空商品数据
wx.setStorageSync('shoppingCartBuffer', [])
},
/** /**
* 添加动画初始 * 添加动画初始
* @function * @function
...@@ -143,7 +148,7 @@ Page({ ...@@ -143,7 +148,7 @@ Page({
for (let i = 0, l = funcResponse.length; i < l; i++) { for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = { let funcItem = {
'id': funcResponse[i].id, // 商品标识 'id': funcResponse[i].id, // 商品标识
'typeId': funcResponse[i].classifyId, // 商品分类标识 'typeId': funcResponse[i].genre, // 商品分类标识
'inventoriesId': funcResponse[i].inventoriesId, // 仓库标识 'inventoriesId': funcResponse[i].inventoriesId, // 仓库标识
'name': funcResponse[i].name, 'name': funcResponse[i].name,
'cover': funcResponse[i].coverImg, // 商品封面 'cover': funcResponse[i].coverImg, // 商品封面
...@@ -157,6 +162,7 @@ Page({ ...@@ -157,6 +162,7 @@ Page({
'describe': funcResponse[i].synopsis, 'describe': funcResponse[i].synopsis,
'describeDetail': '', // 商品描述详情,在点击详情时获得数据 'describeDetail': '', // 商品描述详情,在点击详情时获得数据
'tags': funcResponse[i].tags, 'tags': funcResponse[i].tags,
'notificationId': funcResponse[i].notificationId, // 下单须知
'quantityMin': 1, 'quantityMin': 1,
'quantityMax': funcResponse[i].number, 'quantityMax': funcResponse[i].number,
......
...@@ -81,7 +81,7 @@ Page({ ...@@ -81,7 +81,7 @@ Page({
for (let i = 0, l = funcResponse.length; i < l; i++) { for (let i = 0, l = funcResponse.length; i < l; i++) {
let funcItem = { let funcItem = {
'id': funcResponse[i].id, // 商品标识 'id': funcResponse[i].id, // 商品标识
'typeId': funcResponse[i].classifyId, // 商品分类标识 'typeId': funcResponse[i].genre, // 商品类型
'inventoriesId': funcResponse[i].inventorie[0].inventoriesId, // 仓库标识 'inventoriesId': funcResponse[i].inventorie[0].inventoriesId, // 仓库标识
'name': funcResponse[i].name, 'name': funcResponse[i].name,
'cover': funcResponse[i].coverImg, // 商品封面 'cover': funcResponse[i].coverImg, // 商品封面
...@@ -112,7 +112,6 @@ Page({ ...@@ -112,7 +112,6 @@ Page({
funcCommodityList.push(funcItem) funcCommodityList.push(funcItem)
} }
console.log(JSON.stringify(funcCommodityList))
break break
// 普通商品 // 普通商品
...@@ -153,7 +152,6 @@ Page({ ...@@ -153,7 +152,6 @@ Page({
} }
funcCommodityList.push(funcItem) funcCommodityList.push(funcItem)
} }
console.log(JSON.stringify(funcCommodityList))
break break
} }
...@@ -176,8 +174,6 @@ Page({ ...@@ -176,8 +174,6 @@ Page({
funcCommodityInfo.isActive = true funcCommodityInfo.isActive = true
wx.setStorageSync('shoppingCartBuffer', [funcCommodityInfo]) wx.setStorageSync('shoppingCartBuffer', [funcCommodityInfo])
console.log(JSON.stringify(funcCommodityInfo))
wx.navigateTo({ wx.navigateTo({
url: '/pages/pay/order-input/order-input?type=' + this.data.shopInfo.shopType url: '/pages/pay/order-input/order-input?type=' + this.data.shopInfo.shopType
}) })
......
...@@ -29,98 +29,17 @@ Page({ ...@@ -29,98 +29,17 @@ Page({
projectType: 3, projectType: 3,
btn: '购买门票', btn: '购买门票',
titleImg: '', titleImg: '',
list: [ list: []
{
id: 0,
cover: '',
name: '海错图平日票',
msg: {
0: '周一至周五'
},
priceSpecial: '42',
price: '49',
unit: '人'
},
{
id: 1,
cover: '',
name: '海错图平日票',
msg: {
0: '周六至周日'
},
priceSpecial: '42',
price: '49',
unit: '人'
}
]
}, },
projectSpa: { projectSpa: {
projectType: 2, projectType: 2,
btn: '查看服务', btn: '查看服务',
list: [ list: []
{
id: '0',
name: 'SPA套餐',
cover: '',
priceSpecial: '298 - 698',
price: '300 - 900',
unit: '人'
}
]
}, },
projectChild: { projectChild: {
projectType: 1, projectType: 1,
btn: '购买门票', btn: '购买门票',
list: [ list: []
{
id: 0,
name: '日票(次票)',
priceSpecial: '10',
price: '49',
unit: '次',
msg: {
0: '单次进园',
1: '室外游乐设备免费',
2: '室内场馆及马场需单独收费'
}
},
{
id: 1,
name: '日票(套票)',
priceSpecial: '80',
price: '100',
unit: '次',
msg: {
0: '单次进园',
1: '室外游乐设备免费',
2: '室内场馆及马场均免费'
}
},
{
id: 2,
name: '儿童营地月卡',
priceSpecial: '300',
price: '500',
unit: '人',
msg: {
0: '一个月内无限次进园',
1: '室外游乐设备免费',
2: '室内场馆及马场均免费'
}
},
{
id: 3,
name: '儿童营地年卡',
priceSpecial: '1680',
price: '2680',
unit: '人',
msg: {
0: '一年内无限次进园',
1: '室外游乐设备免费',
2: '室内场馆及马场均免费'
}
}
]
} }
} }
}, },
...@@ -178,7 +97,7 @@ Page({ ...@@ -178,7 +97,7 @@ Page({
'priceSpecialText': App.modular.utils.formatAmount(funcResponse[i].inventorie[0].ownerPrice), // 业主价文本格式 'priceSpecialText': App.modular.utils.formatAmount(funcResponse[i].inventorie[0].ownerPrice), // 业主价文本格式
'priceDiscount': funcResponse[i].inventorie[0].price, // 活动价 'priceDiscount': funcResponse[i].inventorie[0].price, // 活动价
'priceDiscountText': App.modular.utils.formatAmount(funcResponse[i].inventorie[0].price), // 活动价文本格式 'priceDiscountText': App.modular.utils.formatAmount(funcResponse[i].inventorie[0].price), // 活动价文本格式
'priceType': 1, 'priceType': '',
'describe': funcResponse[i].synopsis, 'describe': funcResponse[i].synopsis,
'tags': funcResponse[i].tags, 'tags': funcResponse[i].tags,
} }
......
...@@ -17,7 +17,7 @@ Page({ ...@@ -17,7 +17,7 @@ Page({
amountPay: 0, // 支付金额 amountPay: 0, // 支付金额
amountDiscount: 0, // 优惠金额 amountDiscount: 0, // 优惠金额
winToast: false,
...@@ -80,15 +80,6 @@ Page({ ...@@ -80,15 +80,6 @@ Page({
onLoad: function () { onLoad: function () {
this.setShopInfo() this.setShopInfo()
// // 读取上级页面的购物车数据,默认选中所有。
// let funcShoppingCart = wx.getStorageSync('shoppingCartBuffer')
// for (let i = 0, l = funcShoppingCart.length; i < l; i++) {
// // 设置默认库存为 100 ,在提交订单时矫正为实际库存
// funcShoppingCart[i].quantityMin = 1
// funcShoppingCart[i].quantityMax = 100
// funcShoppingCart[i].isActive = true
// }
this.setData({ this.setData({
shoppingCart: wx.getStorageSync('shoppingCartBuffer') shoppingCart: wx.getStorageSync('shoppingCartBuffer')
}) })
...@@ -96,6 +87,10 @@ Page({ ...@@ -96,6 +87,10 @@ Page({
this.selectionTotal() this.selectionTotal()
}, },
onShow: function () {
},
/** /**
* 设置本店信息 * 设置本店信息
* @function * @function
...@@ -142,12 +137,16 @@ Page({ ...@@ -142,12 +137,16 @@ Page({
let funcIndex = event.currentTarget.dataset.index let funcIndex = event.currentTarget.dataset.index
let funcShoppingCart = this.data.shoppingCart let funcShoppingCart = this.data.shoppingCart
if (funcShoppingCart[funcIndex].quantity === 1) return // 当数量减少到零时,移除改商品
if (funcShoppingCart[funcIndex].quantity === 1) {
funcShoppingCart.splice(funcIndex, 1)
} else {
funcShoppingCart[funcIndex].quantity = funcShoppingCart[funcIndex].quantity - 1 funcShoppingCart[funcIndex].quantity = funcShoppingCart[funcIndex].quantity - 1
}
this.setData({ this.setData({
shoppingCart: funcShoppingCart shoppingCart: funcShoppingCart
}) })
this.selectionTotal() this.selectionTotal()
}, },
...@@ -161,8 +160,8 @@ Page({ ...@@ -161,8 +160,8 @@ Page({
let funcIndex = event.currentTarget.dataset.index let funcIndex = event.currentTarget.dataset.index
let funcShoppingCart = this.data.shoppingCart let funcShoppingCart = this.data.shoppingCart
if (funcShoppingCart[funcIndex].quantityMax < funcShoppingCart[funcIndex].quantity) return if (funcShoppingCart[funcIndex].quantityMax <= funcShoppingCart[funcIndex].quantity) return
funcShoppingCart[funcIndex].quantity = funcShoppingCart[funcIndex].quantity + 1 funcShoppingCart[funcIndex].quantity = funcShoppingCart[funcIndex].quantity + 10
this.setData({ this.setData({
shoppingCart: funcShoppingCart shoppingCart: funcShoppingCart
}) })
...@@ -271,14 +270,46 @@ Page({ ...@@ -271,14 +270,46 @@ Page({
amountPay: funcAmountPay, amountPay: funcAmountPay,
amountDiscount: funcAmountDiscount, amountDiscount: funcAmountDiscount,
selectionTotal: funcSelectionTotal, selectionTotal: funcSelectionTotal,
allSelectionIsActive: funcCommodityTotal === funcSelectionTotal ? true : false,
}) })
if (funcCommodityTotal === funcSelectionTotal && funcCommodityTotal !== 0) {
this.setData({
allSelectionIsActive: true
})
} else {
this.setData({
allSelectionIsActive: false
})
}
// 只要改变购物车数据就缓存 // 只要改变购物车数据就缓存
wx.setStorageSync('shoppingCartBuffer', this.data.shoppingCart) wx.setStorageSync('shoppingCartBuffer', this.data.shoppingCart)
}, },
onPaySubmit: function () { onPaySubmit: function () {
// 检查购物车是否拥有商品
let funcShoppingCart = this.data.shoppingCart
if (funcShoppingCart.length === 0) {
this.setData({
winToast: true
})
return
}
// 检查是否有商品被选中
let funcIsSelection = false
for (let i = 0, l = funcShoppingCart.length; i < l; i++) {
if (funcShoppingCart[i].isActive) {
funcIsSelection = true
}
}
if (!funcIsSelection) {
this.setData({
winToast: true
})
return
}
// let isEnough = true // let isEnough = true
// this.setData({ // this.setData({
// isEnough // isEnough
......
<navigation class="navigation" titleText="购物车" background="#FFFFFF;" backIcon="/image/back.png"></navigation> <navigation class="navigation" titleText="购物车" background="#FFFFFF;" backIcon="/image/back.png"></navigation>
<l-toast show="{{winToast}}" icon="error" title="请选购商品后结算"></l-toast>
<view class="container"> <view class="container">
<view class="shop-info row align-c"> <view class="shop-info row align-c">
<image wx:if="{{shopLogo}}" src="{{resourcesBase + shopLogo}}" mode="left"></image> <image wx:if="{{shopLogo}}" src="{{resourcesBase + shopLogo}}" mode="left"></image>
...@@ -66,9 +68,9 @@ ...@@ -66,9 +68,9 @@
<view class="list-item-quantity col con-e align-e"> <view class="list-item-quantity col con-e align-e">
<view class="list-item-quantity-operation row con-b align-c"> <view class="list-item-quantity-operation row con-b align-c">
<text class="{{item.quantity === item.quantityMin ? 'list-item-quantity-disable' : ''}}" data-index="{{index}}" bindtap="onQuantityReduce">-</text> <text class="{{item.quantity === item.quantityMin ? '' : ''}}" data-index="{{index}}" bindtap="onQuantityReduce">-</text>
<text>{{item.quantity}}</text> <text>{{item.quantity}}</text>
<text class="{{item.quantityMax < item.quantity ? 'list-item-quantity-disable' : ''}}" data-index="{{index}}" bindtap="onQuantityAdd">+</text> <text class="{{item.quantityMax <= item.quantity ? 'list-item-quantity-disable' : ''}}" data-index="{{index}}" bindtap="onQuantityAdd">+</text>
</view> </view>
<view class="list-item-quantity-warning"> <view class="list-item-quantity-warning">
<text>{{item.quantityMax < 5 ? '仅剩' + item.quantityMax + '件' : ''}}</text> <text>{{item.quantityMax < 5 ? '仅剩' + item.quantityMax + '件' : ''}}</text>
......
...@@ -296,9 +296,17 @@ Page({ ...@@ -296,9 +296,17 @@ Page({
let state = res.data.state * 1 // 0 待审核 1 审核通过 2 不通过 let state = res.data.state * 1 // 0 待审核 1 审核通过 2 不通过
let stateTest = '去认证' let stateTest = '去认证'
switch (state) { switch (state) {
case 0: stateTest = '审核中'; break; case 0:
case 1: stateTest = '审核通过 '; break; stateTest = '审核中'
case 2: stateTest = '审核失败'; break; break
case 1:
stateTest = '审核通过 '
break
case 2:
stateTest = '审核失败'
break
} }
this.setData({ this.setData({
type: state == 1 ? 1 : 0, type: state == 1 ? 1 : 0,
......
...@@ -222,6 +222,7 @@ Page({ ...@@ -222,6 +222,7 @@ Page({
}) })
this.setData({ this.setData({
'orderList': [], 'orderList': [],
'orderPages': 1,
}) })
this.queryOrder() this.queryOrder()
}, },
...@@ -246,6 +247,7 @@ Page({ ...@@ -246,6 +247,7 @@ Page({
}) })
this.setData({ this.setData({
'orderList': [], 'orderList': [],
'orderPages': 1,
}) })
this.queryOrder() this.queryOrder()
}, },
...@@ -267,7 +269,7 @@ Page({ ...@@ -267,7 +269,7 @@ Page({
* @returns * @returns
*/ */
onOrderUse: function (event) { onOrderUse: function (event) {
this.onOrderDetail()
}, },
/** /**
......
<!-- 订单分类选择 -->
<view class="navigation-order row con-b align-c"> <view class="navigation-order row con-b align-c">
<image src="{{imageBase + 'icon/arrow-l-1.png'}}" bindtap="onNavigationBack"></image> <image src="{{imageBase + 'icon/arrow-l-1.png'}}" bindtap="onNavigationBack"></image>
<view class="order-type row con-c align-c" bindtap="onOrderType"> <view class="order-type row con-c align-c" bindtap="onOrderType">
...@@ -7,6 +8,7 @@ ...@@ -7,6 +8,7 @@
<image src=""></image> <image src=""></image>
</view> </view>
<!-- 订单状态选择 -->
<view class="order-type-selection col" wx:if="{{winOrderType}}" bindtap="onOrderType"> <view class="order-type-selection col" wx:if="{{winOrderType}}" bindtap="onOrderType">
<view> <view>
<view class="order-type-row row con-b align-c"> <view class="order-type-row row con-b align-c">
...@@ -51,6 +53,7 @@ ...@@ -51,6 +53,7 @@
</view> </view>
</view> </view>
<!-- 订单列表 -->
<view class="container-order"> <view class="container-order">
<view class="status row con-b align-c"> <view class="status row con-b align-c">
<block wx:for="{{statusList}}" wx:for-index="index" wx:for-item="item" wx:key="index"> <block wx:for="{{statusList}}" wx:for-index="index" wx:for-item="item" wx:key="index">
...@@ -74,14 +77,14 @@ ...@@ -74,14 +77,14 @@
<text class="warning" wx:if="{{item.status === 3}}">待评价</text> <text class="warning" wx:if="{{item.status === 3}}">待评价</text>
<text class="message" wx:if="{{item.status === -1}}">已取消</text> <text class="message" wx:if="{{item.status === -1}}">已取消</text>
<text class="message" wx:if="{{item.status === 4}}">已过期</text> <text class="message" wx:if="{{item.status === 4}}">已过期</text>
<text class="message" wx:if="{{item.status === 3}}">已评价</text> <text class="message" wx:if="{{item.status === 6}}">已评价</text>
</view> </view>
</view> </view>
<!-- 商品数量样式一 --> <!-- 商品数量样式一 -->
<view class="order-list-item-service row con-b align-c" wx:if="{{item.commodity.length === 1}}"> <view class="order-list-item-service row con-b align-c" wx:if="{{item.commodity.length === 1}}">
<image class="cover" src="{{item.commodity[0].cover}}"></image> <image class="cover" src="{{item.commodity[0].cover}}"></image>
<text class="name">精灵鸟理想国单人次票精灵鸟理想国单人次票</text> <text class="name">{{item.commodity[0].name}}</text>
<text class="total">{{'x ' + item.total}}</text> <text class="total">{{'x ' + item.total}}</text>
</view> </view>
...@@ -111,3 +114,29 @@ ...@@ -111,3 +114,29 @@
</block> </block>
</view> </view>
</view> </view>
<!-- 二维码弹窗 -->
<view class="code-mask row con-c align-c" wx:if="{{winCode}}">
<view class="code col con-c align-c">
<view class="code-tip col con-c align-c">
<text>{{'请将券码出示给门店核销人员'}}</text>
<text>{{'请将券码出示给门店核销人员'}}</text>
</view>
<view class="code-info col con-c align-c">
<view class="code-info-title">
<text>{{'《 阿凡达 》电影票'}}</text>
</view>
<view class="code-info-qrcode">
<image src="{{'data:image/png;base64,' + code.codeBase64}}"></image>
</view>
<view class="code-info-copy row con-b align-c">
<text>券码</text>
<text>{{'2719 7092 0925'}}</text>
<text>复制</text>
</view>
</view>
<view class="code-close row con-c align-c" bindtap="onCodeClose">
<image src="{{imageBase + 'icon/close-1.png'}}"></image>
</view>
</view>
</view>
\ No newline at end of file
...@@ -112,7 +112,7 @@ page { ...@@ -112,7 +112,7 @@ page {
width: 750rpx; width: 750rpx;
height: 100%; height: 100%;
padding-bottom: 120rpx; padding-bottom: 120rpx;
background: linear-gradient(180deg, #FFFFFF 0%, #F3F4F6 100%); background: #F3F4F6;
} }
.order-list-item { .order-list-item {
...@@ -206,3 +206,98 @@ page { ...@@ -206,3 +206,98 @@ page {
line-height: 32rpx; line-height: 32rpx;
color: #FFFFFF; color: #FFFFFF;
} }
/* 券码 */
.code-mask {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, .6);
}
.code {
padding: 56rpx 40rpx 64rpx 40rpx;
}
.code-tip text:nth-child(1) {
height: 36rpx;
font-size: 26rpx;
font-weight: 500;
line-height: 36rpx;
color: #FFFFFF;
}
.code-tip text:nth-child(2) {
height: 42rpx;
margin-top: 28rpx;
font-size: 30rpx;
font-weight: 400;
line-height: 42rpx;
color: #FFFFFF;
}
.code-info-qrcode {
margin-top: 56rpx;
}
.code-info-qrcode > image {
display: block;
width: 296rpx;
height: 296rpx;
}
.code-info {
width: 526rpx;
height: 666rpx;
margin-top: 56rpx;
border-radius: 4px;
background: #FFFFFF;
}
.code-info-copy {
width: 446rpx;
height: 96rpx;
margin-top: 56rpx;
padding: 0 24rpx;
border-radius: 4px;
background: #F2F3F5;
}
.code-info-copy text:nth-child(1) {
height: 36rpx;
font-size: 26rpx;
font-weight: 500;
line-height: 36rpx;
color: #959DA9;
}
.code-info-copy text:nth-child(2) {
height: 36rpx;
font-size: 26rpx;
font-weight: 500;
line-height: 36rpx;
color: #15191F;
}
.code-info-copy text:nth-child(3) {
height: 36rpx;
font-size: 26rpx;
font-weight: 500;
line-height: 36rpx;
color: #5DB5DD;
}
.code-close {
width: 80rpx;
height: 80rpx;
margin-top: 48rpx;
border-radius: 50%;
background: #A9A8A7;
}
.code-close > image {
width: 48rpx;
height: 48rpx;
}
\ No newline at end of file
...@@ -11,8 +11,8 @@ Page({ ...@@ -11,8 +11,8 @@ Page({
orderInfo: {}, orderInfo: {},
fromPage: '', fromPage: '',
code: {}, codeInfo: {},
winCode: false, isFromUse: false,
winCode: false, winCode: false,
}, },
...@@ -22,11 +22,11 @@ Page({ ...@@ -22,11 +22,11 @@ Page({
this.setData({ this.setData({
shopInfo: wx.getStorageSync('shopInfoBuffer'), shopInfo: wx.getStorageSync('shopInfoBuffer'),
orderInfo: funcOrderInfo, orderInfo: funcOrderInfo,
fromPage: options.fromPage === 'order' ? 'order' : '' fromPage: options.fromPage === 'order' ? 'order' : '',
isFromUse: options.showCode === 'true' ? true : false,
}) })
console.log(funcOrderInfo, '--------------------------') console.log(this.data.shopInfo)
this.queryOrderDetail() this.queryOrderDetail()
}, },
...@@ -78,8 +78,11 @@ Page({ ...@@ -78,8 +78,11 @@ Page({
orderInfo: funcOrderInfo orderInfo: funcOrderInfo
}) })
console.log(JSON.stringify(funcOrderInfo)) // 判断是否自动展示二维码
console.log(this.data.shopInfo) // 订单列表 去使用 按钮
if (this.data.isFromUse) {
}
} }
}) })
}, },
...@@ -93,16 +96,29 @@ Page({ ...@@ -93,16 +96,29 @@ Page({
}, },
success: (response) => { success: (response) => {
let funcResponse = response.data let funcResponse = response.data
let funcCode = { let funcCodeInfo = {
'codeBase64': funcResponse.qrcode 'codeNo': funcResponse.serialNumber,
'codeName': funcResponse.name,
'codeBase64': funcResponse.qrcode,
} }
this.setData({ this.setData({
code: funcCode, codeInfo: funcCodeInfo,
winCode: true, winCode: true,
}) })
} }
}) })
console.log(funcOrderInfo) },
onCodeCopy: function () {
wx.setClipboardData({
data: this.data.codeInfo.codeNo,
})
},
onCodeClose: function () {
this.setData({
winCode: false,
})
}, },
navBack: function () { navBack: function () {
...@@ -111,6 +127,5 @@ Page({ ...@@ -111,6 +127,5 @@ Page({
url: '/pages/mine/home/home', url: '/pages/mine/home/home',
}) })
} }
console.log('navBack') },
}
}) })
\ No newline at end of file
...@@ -46,23 +46,58 @@ ...@@ -46,23 +46,58 @@
<!-- 订单信息 --> <!-- 订单信息 -->
<view class="info"> <view class="info">
<!-- 年卡月卡 --> <!-- 年卡月卡 -->
<view class="info-content col con-c" wx:if="{{orderInfo.commodityType === 1}}"> <block wx:if="{{orderInfo.commodityType === 1}}">
<view class="info-content col con-c">
<view class="info-content-item row"> <view class="info-content-item row">
<text class="info-content-item-label">使用门店</text> <text class="info-content-item-label">使用门店</text>
<text class="info-content-item-title">儿童营地</text> <text class="info-content-item-title">{{shopInfo.name}}</text>
</view> </view>
<view class="info-content-item row"> <view class="info-content-item row">
<text class="info-content-item-label"></text> <text class="info-content-item-label"></text>
<text class="info-content-item-describe">周一至周日 10:00 - 20:00</text> <text class="info-content-item-describe">周一至周日 10:00 - 20:00</text>
</view> </view>
</view> </view>
</block>
<!-- 普通商品 --> <!-- 普通商品 -->
<block wx:if="{{orderInfo.commodityType === 2}}">
<view class="info-content col con-c">
<view class="info-content-item row">
<text class="info-content-item-label">使用门店</text>
<text class="info-content-item-title">{{shopInfo.name}}</text>
</view>
<view class="info-content-item row">
<text class="info-content-item-label"></text>
<text class="info-content-item-describe">周一至周日 10:00 - 20:00</text>
</view>
<view class="info-content-item row">
<text class="info-content-item-label">订单信息</text>
<text class="info-content-item-tip">儿童营地</text>
</view>
<view class="info-content-item row">
<text class="info-content-item-label"></text>
<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>
<view class="info-line-point-right"></view>
</view>
<view class="info-code col con-c align-c">
<text>{{'件餐品可用'}}</text>
<button class="row con-c align-c">一键扫码</button>
<text>{{'2019.09.30 - 2020.12.30'}}</text>
</view>
</block>
<!-- 餐品 --> <!-- 餐品 -->
<view class="info-content col con-c" wx:if="{{orderInfo.commodityType === 2}}"> <block wx:if="{{orderInfo.commodityType === 5}}">
<view class="info-content col con-c">
<view class="info-content-item row"> <view class="info-content-item row">
<text class="info-content-item-label">使用门店</text> <text class="info-content-item-label">使用门店</text>
<text class="info-content-item-title">{{orderInfo.shopName}}</text> <text class="info-content-item-title">{{shopInfo.name}}</text>
</view> </view>
<view class="info-content-item row"> <view class="info-content-item row">
<text class="info-content-item-label"></text> <text class="info-content-item-label"></text>
...@@ -78,8 +113,21 @@ ...@@ -78,8 +113,21 @@
</view> </view>
</view> </view>
<view class="info-line row con-b align-c">
<view class="info-line-point-left"></view>
<view class="info-line-line"></view>
<view class="info-line-point-right"></view>
</view>
<view class="info-code col con-c align-c">
<text>{{'件餐品可用'}}</text>
<button class="row con-c align-c">一键扫码</button>
<text>{{'2019.09.30 - 2020.12.30'}}</text>
</view>
</block>
<!-- 活动 --> <!-- 活动 -->
<view class="info-content col con-c" wx:if="{{orderInfo.commodityType === -1}}"> <block wx:if="{{orderInfo.commodityType === -1}}">
<view class="info-content col con-c">
<view class="info-content-item row"> <view class="info-content-item row">
<text class="info-content-item-label">报名活动</text> <text class="info-content-item-label">报名活动</text>
<text class="info-content-item-title">儿童营地儿童营地儿童营地儿童营地儿童营地儿童营地</text> <text class="info-content-item-title">儿童营地儿童营地儿童营地儿童营地儿童营地儿童营地</text>
...@@ -100,10 +148,23 @@ ...@@ -100,10 +148,23 @@
<text class="info-content-item-label"></text> <text class="info-content-item-label"></text>
<text class="info-content-item-tip">18030303030</text> <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>
<view class="info-line-point-right"></view>
</view>
<view class="info-code col con-c align-c">
<text>{{'张门票可用'}}</text>
<button class="row con-c align-c">一键扫码</button>
<text>{{'2019.09.30 - 2020.12.30'}}</text>
</view> </view>
</view>
</block>
<!-- 观影 --> <!-- 观影 -->
<view class="info-content col con-c" wx:if="{{orderInfo.commodityType === -2}}"> <block wx:if="{{orderInfo.commodityType === -2}}">
<view class="info-content col con-c">
<view class="info-content-item row"> <view class="info-content-item row">
<text class="info-content-item-label">电影</text> <text class="info-content-item-label">电影</text>
<text class="info-content-item-title">儿童营地</text> <text class="info-content-item-title">儿童营地</text>
...@@ -121,6 +182,18 @@ ...@@ -121,6 +182,18 @@
<text class="info-content-item-tip">18030303030</text> <text class="info-content-item-tip">18030303030</text>
</view> </view>
</view> </view>
<view class="info-line row con-b align-c">
<view class="info-line-point-left"></view>
<view class="info-line-line"></view>
<view class="info-line-point-right"></view>
</view>
<view class="info-code col con-c align-c">
<text>{{'张电影票可用'}}</text>
<button class="row con-c align-c">一键扫码</button>
<text>{{'2019.09.30 - 2020.12.30'}}</text>
</view>
</block>
</view> </view>
<!-- 商品信息 --> <!-- 商品信息 -->
...@@ -145,7 +218,7 @@ ...@@ -145,7 +218,7 @@
<text>{{item.amount}}</text> <text>{{item.amount}}</text>
</view> </view>
</view> </view>
<view class="commodity-item-operation"> <view class="commodity-item-operation" wx:if="{{item.codeId}}">
<button class="row con-c align-c" data-item="{{item}}" bindtap="onCouponCode">查看券码</button> <button class="row con-c align-c" data-item="{{item}}" bindtap="onCouponCode">查看券码</button>
</view> </view>
</view> </view>
...@@ -173,8 +246,27 @@ ...@@ -173,8 +246,27 @@
</view> </view>
</view> </view>
<view class="code" wx:if="{{winCode}}"> <!-- 二维码弹窗 -->
<view class="code-info"> <view class="code-mask row con-c align-c" wx:if="{{winCode}}">
<image class="code-info-content" src="{{'data:image/png;base64,' + code.codeBase64}}"></image> <view class="code col con-c align-c">
<view class="code-tip row con-c align-c">
<text>{{'请将券码出示给门店核销人员'}}</text>
</view>
<view class="code-info col con-c align-c">
<view class="code-info-title">
<text>{{codeInfo.codeName}}</text>
</view>
<view class="code-info-qrcode">
<image src="{{'data:image/png;base64,' + codeInfo.codeBase64}}"></image>
</view>
<view class="code-info-copy row con-b align-c">
<text>券码</text>
<text>{{codeInfo.codeNo}}</text>
<text bindtap="onCodeCopy">复制</text>
</view>
</view>
<view class="code-close row con-c align-c" bindtap="onCodeClose">
<image src="{{imageBase + 'icon/close-1.png'}}"></image>
</view>
</view> </view>
</view> </view>
\ No newline at end of file
...@@ -97,9 +97,74 @@ ...@@ -97,9 +97,74 @@
color: #15191F; color: #15191F;
} }
.info-line {
position: relative;
background: #F3F4F6;
}
.info-line-line {
width: 670rpx;
height: 1px;
border: 1px #E2E7EF dashed;
}
.info-line-point-left {
position: absolute;
left: -18rpx;
width: 36rpx;
height: 36rpx;
border-radius: 50%;
background: #FFFFFF;
}
.info-line-point-right {
position: absolute;
right: -18rpx;
width: 36rpx;
height: 36rpx;
border-radius: 50%;
background: #FFFFFF;
}
.info-code {
width: 670rpx;
min-height: 330rpx;
background: #F3F4F6;
}
.info-code text:nth-child(1) {
height: 48rpx;
font-size: 34rpx;
font-weight: 500;
line-height: 48rpx;
color: #15191F;
}
.info-code button {
width: 606rpx;
height: 96rpx;
margin-top: 40rpx;
border-radius: 4px;
background: #86C5E1;
font-size: 30rpx;
font-weight: 500;
line-height: 42rpx;
color: #FFFFFF;
}
.info-code text:nth-child(3) {
height: 36rpx;
margin-top: 40rpx;
font-size: 26rpx;
font-weight: 400;
line-height: 36rpx;
color: #959DAA;
}
/* 商品信息 */ /* 商品信息 */
.commodity { .commodity {
margin: 0 40rpx; margin: 64rpx 40rpx 0 40rpx;
} }
.commodity-title { .commodity-title {
...@@ -201,7 +266,96 @@ ...@@ -201,7 +266,96 @@
} }
/* 券码 */ /* 券码 */
.code-info-content { .code-mask {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, .6);
}
.code {
padding: 56rpx 40rpx 64rpx 40rpx;
}
.code-tip text:nth-child(1) {
height: 36rpx;
font-size: 26rpx;
font-weight: 500;
line-height: 36rpx;
color: #FFFFFF;
}
.code-tip text:nth-child(2) {
height: 42rpx;
margin-top: 28rpx;
font-size: 30rpx;
font-weight: 400;
line-height: 42rpx;
color: #FFFFFF;
}
.code-info-qrcode {
margin-top: 56rpx;
}
.code-info-qrcode > image {
display: block;
width: 296rpx; width: 296rpx;
height: 296rpx; height: 296rpx;
} }
.code-info {
width: 526rpx;
height: 666rpx;
margin-top: 56rpx;
border-radius: 4px;
background: #FFFFFF;
}
.code-info-copy {
width: 446rpx;
height: 96rpx;
margin-top: 56rpx;
padding: 0 24rpx;
border-radius: 4px;
background: #F2F3F5;
}
.code-info-copy text:nth-child(1) {
height: 36rpx;
font-size: 26rpx;
font-weight: 500;
line-height: 36rpx;
color: #959DA9;
}
.code-info-copy text:nth-child(2) {
height: 36rpx;
font-size: 26rpx;
font-weight: 500;
line-height: 36rpx;
color: #15191F;
}
.code-info-copy text:nth-child(3) {
height: 36rpx;
font-size: 26rpx;
font-weight: 500;
line-height: 36rpx;
color: #5DB5DD;
}
.code-close {
width: 80rpx;
height: 80rpx;
margin-top: 48rpx;
border-radius: 50%;
background: #A9A8A7;
}
.code-close > image {
width: 48rpx;
height: 48rpx;
}
\ No newline at end of file
...@@ -30,6 +30,9 @@ Page({ ...@@ -30,6 +30,9 @@ Page({
formIdNum: '', formIdNum: '',
isSubmit: false, isSubmit: false,
winToast: false,
toastContent: '',
// 购买内容 // 购买内容
buyContent: '', // 商品封面 buyContent: '', // 商品封面
buyContentCover: '', buyContentCover: '',
...@@ -293,9 +296,6 @@ Page({ ...@@ -293,9 +296,6 @@ Page({
shoppingCartList: funcShoppingCart, shoppingCartList: funcShoppingCart,
payAmount: App.modular.utils.formatAmount(funcPayAmount), payAmount: App.modular.utils.formatAmount(funcPayAmount),
}) })
console.log('----------')
console.log('funcShoppingCart', JSON.stringify(this.data.shoppingCartList))
}, },
/** /**
...@@ -329,7 +329,6 @@ Page({ ...@@ -329,7 +329,6 @@ Page({
}, },
onInputBlur: function(event) { onInputBlur: function(event) {
console.log(event)
let funcType = event.target.dataset.type let funcType = event.target.dataset.type
let funcIndex = event.target.dataset.index let funcIndex = event.target.dataset.index
let funcValue = event.detail.value let funcValue = event.detail.value
...@@ -485,8 +484,6 @@ Page({ ...@@ -485,8 +484,6 @@ Page({
} }
} }
} }
console.log('inspectData', funcPass)
return funcPass return funcPass
}, },
...@@ -503,9 +500,8 @@ Page({ ...@@ -503,9 +500,8 @@ Page({
// 整合商品数据 // 整合商品数据
let funcCommodity = [] let funcCommodity = []
let funcShoppingCartList = this.data.shoppingCartList let funcShoppingCartList = this.data.shoppingCartList
console.log(funcShoppingCartList)
for (let i = 0, l = funcShoppingCartList.length; i < l; i++) { for (let i = 0, l = funcShoppingCartList.length; i < l; i++) {
if (funcShoppingCartList.isActive) { if (funcShoppingCartList[i].isActive) {
let funcItem = { let funcItem = {
'smCommodity': { 'smCommodity': {
'id': funcShoppingCartList[i].id, 'id': funcShoppingCartList[i].id,
...@@ -546,10 +542,17 @@ Page({ ...@@ -546,10 +542,17 @@ Page({
'smPersonalDetails': funcUserInfo 'smPersonalDetails': funcUserInfo
}, },
success: (response) => { success: (response) => {
let funcResponse = response.data.wxRequest
// 库存不足 // 库存不足
// if (funcResponse.) console.log(response)
if (/库存不足/.test(response.data.message)) {
this.setData({
winToast: true,
toastContent: response.msg,
})
return
}
let funcResponse = response.data.wxRequest
// 库存充足正常下单支付 // 库存充足正常下单支付
pagePayId = response.data.orderId pagePayId = response.data.orderId
this.setData({ this.setData({
...@@ -598,7 +601,6 @@ Page({ ...@@ -598,7 +601,6 @@ Page({
'orderId': pagePayId 'orderId': pagePayId
}, },
success: (response) => { success: (response) => {
console.log(response)
// -1 - 已取消,0 - 未付款,1 - 未发货,2 - 待使用,3 - 已使用,4 - 已过期 // -1 - 已取消,0 - 未付款,1 - 未发货,2 - 待使用,3 - 已使用,4 - 已过期
let funcResponse = response.data let funcResponse = response.data
if (funcResponse.status === '2') { if (funcResponse.status === '2') {
...@@ -623,7 +625,7 @@ Page({ ...@@ -623,7 +625,7 @@ Page({
clearInterval(App.globalData.payStateTimer) clearInterval(App.globalData.payStateTimer)
if (funcPayResult) { if (funcPayResult) {
// 支付成功进入成功页面 // 支付成功进入成功页面
wx.navigateTo({ wx.reLaunch({
url: '/pages/pay/order-state/order-state?state=' + funcPayResult + '&amount=' + this.data.buyContentAmount + '&orderId=' + this.data.orderId url: '/pages/pay/order-state/order-state?state=' + funcPayResult + '&amount=' + this.data.buyContentAmount + '&orderId=' + this.data.orderId
}) })
} else { } else {
......
<l-toast show="{{winToast}}" icon="error" title="{{toastContent}}"></l-toast>
<!-- 购买须知详情 --> <!-- 购买须知详情 -->
<view class="notice-detail" wx:if="{{winNoticeDetail}}" bindtap="onNoticeClose"> <view class="notice-detail" wx:if="{{winNoticeDetail}}" bindtap="onNoticeClose">
<view class="notice-item" animation="{{animation}}"> <view class="notice-item" animation="{{animation}}">
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
height: 96rpx; height: 96rpx;
border-radius: 4px; border-radius: 4px;
border: 1px solid #86C5E1; border: 1px solid #86C5E1;
background: #FFFFFF;
font-size: 30rpx; font-size: 30rpx;
font-weight: 500; font-weight: 500;
......
...@@ -58,7 +58,6 @@ Page({ ...@@ -58,7 +58,6 @@ Page({
onLoad: function (options) { onLoad: function (options) {
this.setNavigationLogo() this.setNavigationLogo()
this.queryActivity()
}, },
onShow: function () { onShow: function () {
...@@ -82,10 +81,6 @@ Page({ ...@@ -82,10 +81,6 @@ Page({
}) })
}, },
queryActivity: function () {
},
/** /**
* 设置标题高度 * 设置标题高度
* @function * @function
......
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