Commit d93318d3 by wjw

Merge branch 'master' of http://120.77.182.185/yanl/mini-shimao.git into master

parents 3f10e4ac 24d5165a
...@@ -13,6 +13,7 @@ App({ ...@@ -13,6 +13,7 @@ App({
}, },
globalData: { globalData: {
test:'999',
appImageBase: '../../../image/', appImageBase: '../../../image/',
appResourcesBase: 'https://sm-web.meiqicloud.com/userfiles/appResourcesS2/', appResourcesBase: 'https://sm-web.meiqicloud.com/userfiles/appResourcesS2/',
shopId: iEnvironmental.shopId, shopId: iEnvironmental.shopId,
......
...@@ -25,7 +25,7 @@ Page({ ...@@ -25,7 +25,7 @@ Page({
'name': '待使用' 'name': '待使用'
}, },
{ {
'value': '-1, 4', 'value': `-1','4`,
'name': '取消/过期' 'name': '取消/过期'
}, },
], ],
......
...@@ -69,13 +69,12 @@ ...@@ -69,13 +69,12 @@
<text class="name">{{item.commodity[0].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>
<!-- 商品数量样式二 --> <!-- 商品数量样式二 -->
<view class="order-list-item-service row con-b align-c" wx:if="{{item.commodity.length >= 2}}"> <view class="order-list-item-service row con-b align-c" wx:if="{{item.commodity.length >= 2}}">
<block wx:for="{{item.commodity}}" wx:for-index="commodityIndex" wx:for-item="commodityItem" wx:key="commodityIndex"> <block wx:for="{{item.commodity}}" wx:for-index="commodityIndex" wx:for-item="commodityItem" wx:key="commodityIndex">
<image class="cover" src="{{commodityItem.cover}}"></image> <image class="cover" src="{{commodityItem.cover}}"></image>
</block> </block>
<text class="total">{{'共 ' + item.total + ' 件'}}</text> <text class="total">{{'共 ' + item.commodity.length + ' 件'}}</text>
</view> </view>
<view class="order-list-item-operation row con-b align-c"> <view class="order-list-item-operation row con-b align-c">
......
...@@ -86,7 +86,7 @@ page { ...@@ -86,7 +86,7 @@ page {
.container-order { .container-order {
/* margin-top: 170rpx; */ /* margin-top: 170rpx; */
margin-top: 288rpx; padding-top: 288rpx;
} }
......
const App = getApp() const App = getApp()
Page({ Page({
data: { data: {
orderType: 1, // 1 - 年卡/月卡,2 - 次票, 3 - SPA, 4 - 文创, 5 - 餐品, 6 - 活动, 7 - 观影 orderType: 1, // 1 - 年卡/月卡,2 - 次票, 3 - SPA, 4 - 文创, 5 - 餐品, 6 - 活动, 7 - 观影
couponInfo: null, couponInfo: null,
// { // {
// type: '套票', // type: '套票',
...@@ -88,18 +88,18 @@ Page({ ...@@ -88,18 +88,18 @@ Page({
submitOperation() { submitOperation() {
let that = this let that = this
wx.lin.showDialog({ wx.lin.showDialog({
type:"confirm", type: "confirm",
title:"", title: "",
content:"是否确认核销券码" , content: "是否确认核销券码",
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
console.log('用户点击确定') console.log('用户点击确定')
that.doVolume() that.doVolume()
} else if (res.cancel) { } else if (res.cancel) {
console.log('用户点击取消') console.log('用户点击取消')
} }
} }
}) })
}, },
doVolume() { doVolume() {
...@@ -116,24 +116,24 @@ Page({ ...@@ -116,24 +116,24 @@ Page({
data: { data: {
volumeId: that.data.couponDetail.volumeId, volumeId: that.data.couponDetail.volumeId,
}, },
success: function(res) { success: function (res) {
if (res.data.code * 1 == 200) { if (res.data.code * 1 == 200) {
wx.lin.showToast({ wx.lin.showToast({
image: '/image/success.png', image: '/image/success.png',
title: '核销成功', title: '核销成功',
}) })
setTimeout(()=>{ setTimeout(() => {
wx.navigateBack() wx.navigateBack()
},2000); }, 2000);
} else { } else {
wx.lin.showToast({ wx.lin.showToast({
image: '/image/error.png', image: '/image/error.png',
title: res.data.msg, title: res.data.msg,
}) })
} }
}, },
fail: function(err) { fail: function (err) {
wx.lin.showToast({ wx.lin.showToast({
image: '/image/error.png', image: '/image/error.png',
title: err.msg, title: err.msg,
......
...@@ -2,12 +2,14 @@ let App = getApp() ...@@ -2,12 +2,14 @@ let App = getApp()
Page({ Page({
data: { data: {
winToastText: '操作成功',
winToast: false,
isDoing: false,
showNotice: false, showNotice: false,
swiperCurrent: 0, swiperCurrent: 0,
showCodePopup: false, showCodePopup: false,
imageBase: App.globalData.appImageBase, imageBase: App.globalData.appImageBase,
resourcesBase: App.globalData.appResourcesBase, resourcesBase: App.globalData.appResourcesBase,
shopInfo: {}, shopInfo: {},
orderType: 1, // 1 - 年卡/月卡,2 - 次票, 3 - SPA, 4 - 文创, 5 - 餐品, 6 - 活动, 7 - 观影 orderType: 1, // 1 - 年卡/月卡,2 - 次票, 3 - SPA, 4 - 文创, 5 - 餐品, 6 - 活动, 7 - 观影
...@@ -18,49 +20,17 @@ Page({ ...@@ -18,49 +20,17 @@ Page({
isFromUse: false, isFromUse: false,
winCode: false, winCode: false,
residuePayTime: "", //剩余支付时间 residuePayTime: "", //剩余支付时间
sealImgs: [{
type: 1, codeList: [],
url: App.globalData.appResourcesBase + 'sealOfOrder/ertongyingdi-2.png'
}], sealSrc: '',
sealTest: App.globalData.appResourcesBase + 'sealOfOrder/ertongyingdi-2.png', shopConfig: App.globalData.shopId,
sealBig: App.globalData.appResourcesBase + 'sealOfOrder/ertongyingdi-1.png', imgBasehost: App.globalData.appResourcesBase
seals: {
seal1: {
passSrc: App.globalData.appResourcesBase + 'sealOfOrder/ertongyingdi-2.png',
willPaySrc: App.globalData.appResourcesBase + 'sealOfOrder/ertongyingdi-2.png',
},
seal1: {
passSrc: App.globalData.appResourcesBase + 'sealOfOrder/ertongyingdi-2.png',
willPaySrc: App.globalData.appResourcesBase + 'sealOfOrder/ertongyingdi-2.png',
},
seal1: {
passSrc: App.globalData.appResourcesBase + 'sealOfOrder/ertongyingdi-2.png',
willPaySrc: App.globalData.appResourcesBase + 'sealOfOrder/ertongyingdi-2.png',
},
},
codeList: [{
id: 0,
title: '《 阿凡达 》电影票',
img: './image/QRcode.png',
num: '2179 7092 0925'
},
{
id: 1,
title: '《 阿凡达 》电影票',
img: './image/QRcode.png',
num: '2179 7092 0925'
},
{
id: 2,
title: '《 阿凡达 》电影票',
img: './image/QRcode.png',
num: '2179 7092 0925'
}
]
}, },
onLoad: function (options) { onLoad: function (options) {
let funcOrderInfo = this.data.orderInfo let funcOrderInfo = this.data.orderInfo
funcOrderInfo.id = options.id funcOrderInfo.id = options.id
this.setData({ this.setData({
...@@ -74,7 +44,107 @@ Page({ ...@@ -74,7 +44,107 @@ Page({
success: (result) => { success: (result) => {
this.queryOrderDetail() this.queryOrderDetail()
}, },
})
},
// 再次下单
onOrderAgain: function (event) {
let commodityType = this.data.orderInfo.commodityType
let shopAppId = wx.getStorageSync('shopInfoBuffer') ? wx.getStorageSync('shopInfoBuffer').appId : ""
wx.navigateTo({
url: `/pages/commodity/menu-food/menu-food?formPage=order&shopAppId=${shopAppId}&commodityType=${commodityType}`,
})
},
// 去支付
onOrderPay: function (event) {
// 数据校验不通过
let that = this
let wxRequest = this.data.orderInfo.wxRequest
// 待支付返回的wx支付参数
if (wxRequest) {
wx.requestPayment({
timeStamp: wxRequest.timeStamp,
nonceStr: wxRequest.nonceStr,
package: wxRequest.package,
signType: wxRequest.signType,
paySign: wxRequest.paySign,
success(res) {
// let state = `orderInfo.state`
// that.setData({
// [state]: 2,
// })
that.queryOrderDetail()
},
fail(res) {}
})
}
},
// 去评价
onOrderEvaluate: function (event) {
let item = JSON.stringify(this.data.orderInfo)
wx.navigateTo({
url: `/pages/pay/order-comment/order-comment?orderItem=${item}`,
})
},
// 删除订单&取消订单
onDelOrCancelOrder: function (event) {
// wx.lin.showDialog({
// type: "confirm",
// title: "",
// content: "是否确认核销券码",
// success: (res) => {
// if (res.confirm) {
// console.log('用户点击确定')
// that.doVolume()
// } else if (res.cancel) {
// console.log('用户点击取消')
// }
// }
// })
let type = event.currentTarget.dataset.type
let that = this
wx.showLoading({
title: '处理中',
mask: true
})
this.setData({
isDoing: true,
})
App.wxRequest({
url: '/api/v1/order/cancelOrder',
data: {
'orderId': this.data.orderInfo.id,
'type': type,
},
success: (response) => {
wx.hideLoading()
let winToastText = type == 1 ? '订单删除成功' : '订单取消成功'
that.setData({
isDoing: false,
winToast: true,
winToastText: winToastText
})
setTimeout(function () {
if (type == 1) {
// 删除操作
wx.redirectTo({
url: '/pages/mine/order/order',
})
} else {
// 取消操作
let state = `orderInfo.state`
that.setData({
isDoing: false,
[state]: -1
})
}
}, 2000)
}
}) })
}, },
// 使用须知 // 使用须知
...@@ -148,8 +218,22 @@ Page({ ...@@ -148,8 +218,22 @@ Page({
'tipTimeSubmit': funcResponse.createDate, 'tipTimeSubmit': funcResponse.createDate,
'tipTimePay': App.modular.miment(funcResponse.paymentTime).format('YYYY-MM-DD hh:mm:ss'), 'tipTimePay': App.modular.miment(funcResponse.paymentTime).format('YYYY-MM-DD hh:mm:ss'),
'tipIntegral': funcResponse.integral, 'tipIntegral': funcResponse.integral,
'officeName': funcResponse.officeName 'officeName': funcResponse.officeName,
'wxRequest': funcResponse.wxRequest
} }
// 设置印章
let shopName = funcResponse.officeName;
let shopFilter = this.data.shopConfig.filter(
item => {
return item.name.toLowerCase() == shopName.toLowerCase()
}
)
funcOrderInfo.shopInfo = shopFilter[0]
console.log(shopFilter[0], '-----------shopFilter[0]------');
// 添加订单商品列表 // 添加订单商品列表
let funcCommodity = funcResponse.smOrderDetails let funcCommodity = funcResponse.smOrderDetails
...@@ -158,7 +242,7 @@ Page({ ...@@ -158,7 +242,7 @@ Page({
'cover': funcCommodity[i].imgUrl, 'cover': funcCommodity[i].imgUrl,
'name': funcCommodity[i].name, // 名称 'name': funcCommodity[i].name, // 名称
'quantity': funcCommodity[i].number, // 数量 'quantity': funcCommodity[i].number, // 数量
'amount': funcCommodity[i].totalPrices, // 总价 'amount': funcCommodity[i].unitPrice, // 总价
'state': Number(funcCommodity[i].status), // 状态 'state': Number(funcCommodity[i].status), // 状态
'codeId': funcCommodity[i].volumeId, // 券码 'codeId': funcCommodity[i].volumeId, // 券码
} }
...@@ -207,16 +291,21 @@ Page({ ...@@ -207,16 +291,21 @@ Page({
}) })
}, },
// 弹出单张二维码 // 弹出单张二维码
onCouponCode: function (event) { onCouponCode: function (event) {
let funcOrderInfo = event.currentTarget.dataset.item let funcOrderInfo = event.currentTarget.dataset.item
wx.showLoading({
title: '加载中',
})
App.wxRequest({ App.wxRequest({
url: '/api/v1/volume/getVolume', url: '/api/v1/volume/getVolume',
data: { data: {
'volumeId': funcOrderInfo.codeId 'volumeId': funcOrderInfo.codeId
}, },
success: (response) => { success: (response) => {
wx.hideLoading({
success: (res) => {},
})
let funcResponse = response.data let funcResponse = response.data
let funcCodeInfo = { let funcCodeInfo = {
'codeNo': funcResponse.serialNumber, 'codeNo': funcResponse.serialNumber,
......
...@@ -791,7 +791,7 @@ ...@@ -791,7 +791,7 @@
} }
.footer-btn { .footer-btn {
padding: 32rpx 20rpx 0; padding: 32rpx 20rpx;
border-top: 1px solid #E2E7EF; border-top: 1px solid #E2E7EF;
} }
......
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