Browse Source

des修复

master
jiazhipeng 7 months ago
parent
commit
241a42f0c5
  1. 2
      app.js
  2. 6
      pages/component/TitleHeader.js
  3. 12
      pages/order/orderList/index.js
  4. 6
      pages/user/order/postOrderInfo/index.js
  5. 3
      pages/user/order/sceneOrderInfo/index.js
  6. 6
      pages/user/order/showOrderInfo/index.js
  7. 9
      utils/https.js
  8. 7
      utils/util.js

2
app.js

@ -38,7 +38,7 @@ App({
// 获取前端配置文件
commonApi._post("pbservice/Other/getClientConfig", {unique_key: "wechatxcx"}).then(res => {
let data = JSON.parse(res.data);
data.isTest = data.isTest132? true : false;
data.isTest = data.isTest133? true : false;
data.indexSeason = null
this.globalData.configJson = data
}).then(() => {

6
pages/component/TitleHeader.js

@ -92,6 +92,12 @@ Component({
else if (pages[pages.length-1].route.indexOf('orderList') != -1){
// 清空购物车
try {
console.log("清除购物车")
app.globalData.list = null;app.globalData.createDate = null;
app.globalData.index = 0;app.globalData.productPrice = 0;app.globalData.ticketPrice = 0;
} catch(e) { console.log("清空购物车失败", e) }
wx.navigateTo({
url: '/pages/user/cartlist/list'
})

12
pages/order/orderList/index.js

@ -80,7 +80,6 @@ Page({
app.globalData.createDate.coupon_id= this.data.coupon ? this.data.coupon.id : null;
let service = "order/create", postData = {data: JSON.stringify(app.globalData.createDate)}
commonApi.user_post(service, postData).then(res => {
})
},
changePrice: function () {
@ -165,6 +164,17 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
// 清空购物车
console.log("清除购物车")
try {
app.globalData.list = null
app.globalData.createDate = null
app.globalData.index = 0
app.globalData.productPrice = 0
app.globalData.ticketPrice = 0
} catch(e) {
console.log("清空购物车失败", e)
}
},

6
pages/user/order/postOrderInfo/index.js

@ -191,8 +191,12 @@ Page({
goDetail(e){
console.log(e.currentTarget.dataset);
let item = e.currentTarget.dataset.set
util.gotoDetail(item)
if (item.compose_product_id) {
wx.navigateTo({
url: '/pages/info/roadInfo/index?id='+item.compose_product_id
})
return
}
if (item.is_package == 1) {
wx.navigateTo({
url:"/pages/info/postProductInfo/index?id="+item.product_id

3
pages/user/order/sceneOrderInfo/index.js

@ -226,9 +226,6 @@ Page({
goDetail(e){
console.log(e.currentTarget.dataset);
let item = e.currentTarget.dataset.set
util.gotoDetail(item)
return
// 组合产品 跳线路
if (item.compose_product_id) {
wx.navigateTo({

6
pages/user/order/showOrderInfo/index.js

@ -223,8 +223,12 @@ Page({
goDetail(e){
console.log(e.currentTarget.dataset);
let item = e.currentTarget.dataset.set
util.gotoDetail(item)
if (item.compose_product_id) {
wx.navigateTo({
url: '/pages/info/roadInfo/index?id='+item.compose_product_id
})
return
}
if (item.is_package==1) {
wx.navigateTo({

9
utils/https.js

@ -225,6 +225,15 @@ function user_post_new(url, data = {}, type) {
if (url.indexOf('/order/create') != -1 && res.data.code == 1 && res.data.data) {
// 下单成功
wx.removeStorageSync('prizeId')
// 清空购物车
try {
console.log("清除购物车")
let app = getApp()
app.globalData.list = null;app.globalData.createDate = null;
app.globalData.index = 0;app.globalData.productPrice = 0;app.globalData.ticketPrice = 0;
} catch(e) { console.log("清空购物车失败", e) }
if (res.data.data.pay_status == 1) {
// 0元直接付款成功
wx.navigateTo({

7
utils/util.js

@ -579,6 +579,13 @@ const detailPagePoint = function (url, res) {
// app 要传进来 util 获取不到
const orderByShoppingCart = function (listData, app) {
app.globalData.list = []
app.globalData.postProduct = []
app.globalData.product = null
app.globalData.createDate = null
app.globalData.index = 0
app.globalData.productPrice = 0
app.globalData.ticketPrice = 0
let productType,flag,isCar;
commonApi.user_post('wx/get_user_keep', {
jumpurl: '/pages/user/cartlist/list',

Loading…
Cancel
Save