Commit f3b1a0ab by 李伟康

修复

1 parent 6a6b3892
......@@ -15,30 +15,28 @@ Component({
methods: {
toDetail() {
const { businessInfo, address } = this.data
let query = {
let param = {
supplier: businessInfo.supplier,
brandName: businessInfo.brandName,
lat: address.location.lat,
lng: address.location.lng,
}
const temp = JSON.stringify(query)
wx.navigateTo({
url: '/packageEquity/pages/commodity/detail/detail?param=' + temp
wx.p.router.go('/packageEquity/pages/commodity/detail/detail',{
param
})
},
toDetailPage(e) {
const { item } = e.currentTarget.dataset
const { businessInfo, address } = this.data
let query = {
let param = {
supplier: businessInfo.supplier,
brandName: businessInfo.brandName,
lat: address.location.lat,
lng: address.location.lng,
id: item.id
}
const temp = JSON.stringify(query)
wx.navigateTo({
url: '/packageEquity/pages/commodity/detail/detail?param=' + temp
wx.p.router.go('/packageEquity/pages/commodity/detail/detail',{
param
})
},
......
......@@ -99,13 +99,14 @@ Page({
const { item } = e.currentTarget.dataset
let url = ''
if (item.appearance == 1) {
let para = {
let param = {
supplier: item.supplier,
brandName: item.brandName,
location: true
}
const temp = JSON.stringify(para)
url = '/packageEquity/pages/commodity/detail/detail?param=' + temp
wx.p.router.go('/packageEquity/pages/commodity/detail/detail',{
param
})
} else if (item.appearance == 2) {
let para = {
supplier: item.supplier,
......
// pages/chargeWait/chargeWait.js
Page({
/**
* 页面的初始数据
*/
data: {
/**
* 页面的初始数据
*/
data: {
},
},
onLoad: function(options) {
console.log(wx.p);
let query = JSON.parse(options.query)
this.setData({
query
})
},
toOrderList() {
wx.redirectTo({
url:'/packageMine/pages/order/index/index'
})
},
toBack() {
wx.navigateBack({
delta: 1
})
}
onLoad: function (options) {
console.log(wx.p);
let query = JSON.parse(options.query)
this.setData({
query
})
},
toOrderList() {
wx.redirectTo({
url: '/packageMine/pages/order/index/index'
})
},
toBack() {
wx.p.router.back()
}
})
\ No newline at end of file
......@@ -34,7 +34,7 @@ Page({
let tempArr = []
res.map(item => {
let newArr = []
if (item.chargeGoddsList) {
if (item && item.chargeGoddsList) {
item.chargeGoddsList.forEach(ele => {
ele.denominationList.forEach(info => {
let tempObj = {
......
import { decimal } from '~/utils/format'
import {
decimal
} from '~/utils/format'
import mapApi from '../../../../utils/mapapi/mapapi'
Page({
data: {
......@@ -10,18 +12,19 @@ Page({
currentIndex: 0,
richText: '',
showModal: false,
isGameUse:false,
coupons:null,
showCoupons:false,
showComponent:false
isGameUse: false,
coupons: null,
showCoupons: false,
showComponent: false
},
noScroll(){},
noScroll() {},
onShow: function () {
this.toCheckMember()
},
onLoad: function (options) {
options = JSON.stringify(options)==='{}'?this.options:options
const query = options ? JSON.parse(decodeURIComponent(options.param)) : this.data.query
// options = JSON.stringify(options) === '{}' ? this.options : options
// const query = options ? JSON.parse(decodeURIComponent(options.param)) : this.data.query
const query = options.param
this.setNaviTitle(query.brandName)
if (!query.lat) {
const tem = wx.p.storage.get('address_info')
......@@ -38,7 +41,7 @@ Page({
// return
// }
wx.p.wxApi.showLoading()
this.toGetCommodity(query,options)
this.toGetCommodity(query, options)
this.setData({
// unauthorized,
showLogin: false,
......@@ -49,22 +52,26 @@ Page({
})
},
// 处理广汇权益明细进入的卡券
handleEquityOfGH(couponsItem){
let {curentGoodsItem} = this.data
curentGoodsItem.payCouponsPrice = decimal(curentGoodsItem.lineationPrice-(Number(couponsItem.denomination)), 2)
handleEquityOfGH(couponsItem) {
let {
curentGoodsItem
} = this.data
curentGoodsItem.payCouponsPrice = decimal(curentGoodsItem.lineationPrice - (Number(couponsItem.denomination)), 2)
this.setData({
curentGoodsItem,
coupons:couponsItem
coupons: couponsItem
})
},
// 获取当前商品绑定的优惠券并且处理价格
getCouponsItem(e){
getCouponsItem(e) {
const couponsItem = e.detail
let {curentGoodsItem} = this.data
curentGoodsItem.payCouponsPrice = decimal(curentGoodsItem.lineationPrice-(Number(couponsItem.denomination)), 2)
let {
curentGoodsItem
} = this.data
curentGoodsItem.payCouponsPrice = decimal(curentGoodsItem.lineationPrice - (Number(couponsItem.denomination)), 2)
this.setData({
curentGoodsItem,
coupons:couponsItem
coupons: couponsItem
})
},
// 选择优惠券
......@@ -80,7 +87,10 @@ Page({
// },
// 选择商品
selectGoodsItem(e) {
const { index, item } = e.currentTarget.dataset
const {
index,
item
} = e.currentTarget.dataset
let richText = ''
if (item.buysNotes) {
richText = decodeURIComponent(item.buysNotes)
......@@ -97,7 +107,7 @@ Page({
},
// 查询会员开通情况
toCheckMember() {
if(this.data.isGameUse)return
if (this.data.isGameUse) return
const SID = wx.p.storage.get('sessionId')
if (!SID) {
return
......@@ -114,10 +124,17 @@ Page({
})
},
// 获取商品信息
toGetCommodity(query,options) {
let { curentGoodsItem, currentIndex,isGameUse,coupons } = this.data
let tem = {...query}
if(tem.id&&!isGameUse){
toGetCommodity(query, options) {
let {
curentGoodsItem,
currentIndex,
isGameUse,
coupons
} = this.data
let tem = {
...query
}
if (tem.id && !isGameUse) {
delete tem.id
}
wx.p.api.equityApi.commodityMsg(tem).then(res => {
......@@ -147,11 +164,11 @@ Page({
richText = richText.replace(/\<span/g, '<span class="rich_text"')
richText = richText.replace(/\<a/g, '<a class="rich_text_a"')
}
if(isGameUse){
if (isGameUse) {
curentGoodsItem.payCouponsPrice = curentGoodsItem.lineationPrice
}
if(this.data.isGameUse){
tempList = tempList.filter(item=>item.id===query.id)
if (this.data.isGameUse) {
tempList = tempList.filter(item => item.id === query.id)
currentIndex = 0
}
this.setData({
......@@ -162,16 +179,16 @@ Page({
query,
currentIndex,
to: `to-${currentIndex}`,
showComponent:true,
showComponent: true,
showLogin: false
})
if (!tempList.length) {
wx.p.wxApi.showToast('原商品已下架,已为您推荐其他商品')
setTimeout(()=>{
setTimeout(() => {
wx.navigateBack({
delta: 1
});
},1500)
}, 1500)
return
}
this.toGetCommodityStock(query.id || tempList[0].id)
......@@ -184,7 +201,10 @@ Page({
}
wx.hideLoading()
wx.p.api.equityApi.checkStock(para).then(res => {
const { code, data } = res
const {
code,
data
} = res
let flag = false
if (code == 0 && data != 0) {
flag = true
......@@ -207,12 +227,19 @@ Page({
if (!isLogin) {
return
}
const { curentGoodsItem, isHaveInventory,isGameUse } = this.data
const {
curentGoodsItem,
isHaveInventory,
isGameUse
} = this.data
if (!isHaveInventory) {
return
}
if(isGameUse)return this.comfirmBuyItem()
const { noMemberPrice, salesPrice } = curentGoodsItem
if (isGameUse) return this.comfirmBuyItem()
const {
noMemberPrice,
salesPrice
} = curentGoodsItem
let diffPrice = 0
if (noMemberPrice) {
diffPrice = decimal(noMemberPrice - salesPrice, 2)
......@@ -242,7 +269,11 @@ Page({
if (!orderCode) {
return
}
const { curentGoodsItem,coupons,isGameUse } = this.data
const {
curentGoodsItem,
coupons,
isGameUse
} = this.data
let para = {
orderCode,
goodsId: curentGoodsItem.id,
......@@ -250,7 +281,7 @@ Page({
// payMannerId: 19,
paySource: 3,
}
if(isGameUse&&coupons){
if (isGameUse && coupons) {
para.usedCouponIds = [coupons.id]
}
wx.p.api.equityApi.payGoodsOrder(para).then(res => {
......@@ -260,7 +291,13 @@ Page({
},
// 处理支付
handlePay(payData, orderCode) {
const { timeStamp, nonceStr, packages, signType, paySign } = payData
const {
timeStamp,
nonceStr,
packages,
signType,
paySign
} = payData
let self = this
wx.requestPayment({
timeStamp: timeStamp,
......@@ -299,7 +336,9 @@ Page({
},
// /**获取当前位置 */
getLocation(query) {
this.getAddressInfo().then(({ location }) => {
this.getAddressInfo().then(({
location
}) => {
query.lat = location.lat
query.lng = location.lng
this.toGetCommodity(query)
......@@ -310,7 +349,9 @@ Page({
},
// 重新收起获取定位
relocation() {
const { query } = this.data
const {
query
} = this.data
const tem = wx.p.storage.get('address_info')
query.lat = tem ? tem.location.lat : ''
query.lng = tem ? tem.location.lng : ''
......@@ -321,7 +362,9 @@ Page({
return
}
this.toGetCommodity(query)
this.setData({ query })
this.setData({
query
})
},
/**授权失败 */
authFail() {
......@@ -335,7 +378,9 @@ Page({
},
// 打开地图
openMap() {
const { addressInfo } = this.data
const {
addressInfo
} = this.data
if (!addressInfo || !addressInfo.latitude) {
this.relocation()
return
......@@ -360,7 +405,7 @@ Page({
flag = false
this.setData({
showLogin: true,
showComponent:false
showComponent: false
})
}
return flag
......@@ -395,7 +440,10 @@ Page({
else
wx.getLocation({
type: 'gcj02'
}).then(({ latitude, longitude }) => {
}).then(({
latitude,
longitude
}) => {
mapApi.detailedAdrress([latitude, longitude]).then(detail => {
let info = {
...detail,
......@@ -407,4 +455,4 @@ Page({
})
})
}
})
})
\ No newline at end of file
......@@ -120,9 +120,4 @@ Page({
url: '/packageEquity/pages/agreement/index'
})
},
// toActive() {
// wx.navigateTo({
// url: '/packageShopmall/packageEquity/pages/active/active'
// })
// }
})
\ No newline at end of file
......@@ -119,9 +119,6 @@ Page({
wx.redirectTo({
url: '/packageEquity/pages/packageDetail/packageDetail?orderCode=' + query.orderCode
})
// wx.navigateBack({
// delta: 1
// })
}, 3000)
})
}
......
// packageMall/pages/detail/detail.js
import {
centsToyuan,
iosTimeFormat
centsToyuan
} from '~/utils/format'
const navStyle = 'background-color: transparent;'
let navBarHeight = 38
......@@ -127,28 +126,22 @@ Page({
})
},
goodsActionClick(e) {
let type = e.detail
let {
activeSku,
isActivity,
goodsInfo: {
activityStatus,
goodsStock,
buyFlag
}
} = this.data
if (activeSku) {
this.showSkuFun()
return
}
let type = e.detail,
{
activeSku,
isActivity,
goodsInfo: {
activityStatus,
goodsStock,
buyFlag
}
} = this.data
if (activeSku) return this.showSkuFun()
if (isActivity && activityStatus != 2) return
if (goodsStock == 0) return
if (buyFlag == 2) return
if (type == 'pay') {
this.pay()
} else {
this.join()
}
if (type == 'pay') this.pay()
else this.join()
},
async pay(e) {
const loginStatus = await wx.p.router.intercept()
......
......@@ -21,9 +21,6 @@ Page({
wx.p.router.go(url, {
orderCode: item
})
// wx.navigateTo({
// url: '/packageMine/pages/order/detail/detail?orderCode=S2112081509592138'
// })
},
state(e) {
let {
......
......@@ -15,8 +15,9 @@ Page({
* 生命周期函数--监听页面加载
*/
async onLoad(options) {
console.log('---------------- 页面初始化 ----------------')
console.log('初始化数据:', options)
systemApi.getImageVersion() //获取图片版本号
console.log(options, '===')
this.tabList = __wxConfig.tabBar.list
wx.p.wxApi.showLoading()
//scenc获取页面参数并跳转
......@@ -49,7 +50,7 @@ Page({
wx.p.storage.rm('userInfo')
wx.p.storage.rm('sessionId')
}
console.log(data, '=============')
console.log('登陆信息:', data)
if (options.url) {
return this.jumpPage(options.url)
}
......
......@@ -2,6 +2,9 @@
import {
systemApi
} from '~/api/index'
import {
IMG_URL
} from '~/config'
Component({
/**
* 组件的属性列表
......@@ -40,7 +43,7 @@ Component({
wx.getChannelsLiveInfo({
finderUserName,
success(liveInfo) {
console.log(liveInfo, '视频号直播')
console.log('视频号直播信息:', liveInfo)
if (liveInfo.status == 3) {
_this.getChannelsLiveNoticeInfo(finderUserName, auto)
liveInfo = null
......@@ -60,7 +63,7 @@ Component({
wx.getChannelsLiveNoticeInfo({
finderUserName,
success(liveNoticeInfo) {
console.log(liveNoticeInfo, '视频号预告')
console.log('视频号预告信息:', liveNoticeInfo)
let startTime = liveNoticeInfo.startTime * 1e3,
month = new Date(startTime).format('M'),
day = new Date(startTime).format('d'),
......@@ -77,7 +80,7 @@ Component({
if (!auto) _this.close()
},
fail(err) {
console.log(err)
console.log('视频号预告信息:', err)
_this.setData({
liveNoticeInfo: null
})
......@@ -119,7 +122,7 @@ Component({
animation: true
}, setTimeout(() => {
this.setBanner()
}, .5e3))
}, .8e3))
else this.setBanner()
},
async setBanner() {
......@@ -129,7 +132,7 @@ Component({
liveNoticeInfo,
finderUserName
} = this.data,
bannerImg = `https://img02.glsx.com.cn/weapp/resource/miniprogram/hmd/home/live/${liveInfo ? 'live' :'notice'}.png?v=${v}`,
bannerImg = `${IMG_URL}home/live/${liveInfo ? 'live' :'notice'}.png?v=${v}`,
thisPage = wx.p.router.getPageInstance()
let {
bannerList
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!