Commit 77abbaa2 by 李伟康

提交

1 parent 32bd316e
import { preReleaseAppId } from '~/config' import { preReleaseAppId } from '~/config'
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease'] const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
let index = 2 let index = 3
/** /**
* *
......
...@@ -15,29 +15,27 @@ Component({ ...@@ -15,29 +15,27 @@ Component({
methods: { methods: {
toDetail(){ toDetail(){
let {chargeInfo} = this.data let {chargeInfo} = this.data
let query = { let param = {
brandName:chargeInfo.brandName, brandName:chargeInfo.brandName,
supplier:chargeInfo.supplier, supplier:chargeInfo.supplier,
icon:chargeInfo.icon icon:chargeInfo.icon
} }
const temp = JSON.stringify(query) wx.p.router.go('/packageEquity/pages/commodity/chargeDetail/chargeDetail',{
wx.navigateTo({ param
url: '/packageEquity/pages/commodity/chargeDetail/chargeDetail?param='+temp
}) })
}, },
toDetailPage(e){ toDetailPage(e){
let {item} = e.currentTarget.dataset let {item} = e.currentTarget.dataset
let {chargeInfo} = this.data let {chargeInfo} = this.data
let query = { let param = {
brandName:chargeInfo.brandName, brandName:chargeInfo.brandName,
supplier:chargeInfo.supplier, supplier:chargeInfo.supplier,
id:item.id, id:item.id,
productName:item.productName, productName:item.productName,
icon:chargeInfo.icon icon:chargeInfo.icon
} }
const temp = JSON.stringify(query) wx.p.router.go('/packageEquity/pages/commodity/chargeDetail/chargeDetail',{
wx.navigateTo({ param
url: '/packageEquity/pages/commodity/chargeDetail/chargeDetail?param='+temp
}) })
} }
} }
......
...@@ -108,16 +108,14 @@ Page({ ...@@ -108,16 +108,14 @@ Page({
param param
}) })
} else if (item.appearance == 2) { } else if (item.appearance == 2) {
let para = { let param = {
supplier: item.supplier, supplier: item.supplier,
brandName: item.brandName, brandName: item.brandName,
icon: item.equityIcon icon: item.equityIcon
} }
const temp = JSON.stringify(para) wx.p.router.go('/packageEquity/pages/commodity/chargeDetail/chargeDetail',{
url = '/packageEquity/pages/commodity/chargeDetail/chargeDetail?param=' + temp param
}
wx.navigateTo({
url
}) })
} }
}
}) })
...@@ -9,16 +9,13 @@ Page({ ...@@ -9,16 +9,13 @@ Page({
}, },
onLoad: function (options) { onLoad: function (options) {
console.log(wx.p); let query = options.query
let query = JSON.parse(options.query)
this.setData({ this.setData({
query query
}) })
}, },
toOrderList() { toOrderList() {
wx.redirectTo({ wx.p.router.redirectTo('/packageMine/pages/order/index/index')
url: '/packageMine/pages/order/index/index'
})
}, },
toBack() { toBack() {
wx.p.router.back() wx.p.router.back()
......
import { decimal } from '~/utils/format' import {
decimal
} from '~/utils/format'
Page({ Page({
data: { data: {
curIndex: 0, curIndex: 0,
...@@ -6,26 +8,28 @@ Page({ ...@@ -6,26 +8,28 @@ Page({
isOpen: false, isOpen: false,
selectedItem: null, selectedItem: null,
listData: [], listData: [],
isGameUse:false, isGameUse: false,
coupons:null, coupons: null,
showCoupons:false, showCoupons: false,
}, },
// 获取当前商品绑定的优惠券并且处理价格 // 获取当前商品绑定的优惠券并且处理价格
getCouponsItem(e){ getCouponsItem(e) {
const couponsItem = e.detail const couponsItem = e.detail
let {selectedItem} = this.data let {
selectedItem.payCouponsPrice = decimal(selectedItem.lineationPrice-(Number(couponsItem.denomination)), 2) selectedItem
} = this.data
selectedItem.payCouponsPrice = decimal(selectedItem.lineationPrice - (Number(couponsItem.denomination)), 2)
this.setData({ this.setData({
selectedItem, selectedItem,
coupons:couponsItem coupons: couponsItem
}) })
}, },
toSelectCoupons(){ toSelectCoupons() {
const isLogin = this.checkLogin() const isLogin = this.checkLogin()
if (!isLogin) { if (!isLogin) {
return return
} }
if(this.data.isGH)return if (this.data.isGH) return
this.setData({ this.setData({
showCoupons: true showCoupons: true
}) })
...@@ -36,22 +40,39 @@ Page({ ...@@ -36,22 +40,39 @@ Page({
}) })
}, },
changeMumberType(e) { changeMumberType(e) {
let { selectedItem, listData,coupons } = this.data let {
const { index } = e.currentTarget.dataset selectedItem,
listData,
coupons
} = this.data
const {
index
} = e.currentTarget.dataset
selectedItem = listData[index].denominationList[0] selectedItem = listData[index].denominationList[0]
if(coupons){ if (coupons) {
selectedItem.payCouponsPrice = decimal(selectedItem.lineationPrice-(Number(coupons.denomination)), 2) selectedItem.payCouponsPrice = decimal(selectedItem.lineationPrice - (Number(coupons.denomination)), 2)
} }
this.setData({ curIndex: index, selectedItem, checkedItem: 0 }) this.setData({
curIndex: index,
selectedItem,
checkedItem: 0
})
}, },
checkedMumberType(e) { checkedMumberType(e) {
const { item, index } = e.currentTarget.dataset const {
item,
index
} = e.currentTarget.dataset
let richText = decodeURIComponent(item.buysNotes) let richText = decodeURIComponent(item.buysNotes)
richText = richText.replace(/\<span/g, '<span class="rich_text"') richText = richText.replace(/\<span/g, '<span class="rich_text"')
this.setData({ checkedItem: index, selectedItem: item, richText }) this.setData({
checkedItem: index,
selectedItem: item,
richText
})
}, },
toCheckMember() { toCheckMember() {
if(this.data.isGameUse)return if (this.data.isGameUse) return
const SID = wx.p.storage.get('sessionId') const SID = wx.p.storage.get('sessionId')
if (!SID) { if (!SID) {
return return
...@@ -67,27 +88,32 @@ Page({ ...@@ -67,27 +88,32 @@ Page({
wx.p.eventbus.off('EQUITYGOODS') wx.p.eventbus.off('EQUITYGOODS')
}) })
}, },
getChargeDetail(query,options) { getChargeDetail(query, options) {
let para = { let para = {
brandName: query.brandName, brandName: query.brandName,
supplier: query.supplier supplier: query.supplier
} }
if(this.data.isGameUse){ if (this.data.isGameUse) {
para.id = query.id para.id = query.id
} }
wx.p.api.equityApi.chargeData(para).then(res => { wx.p.api.equityApi.chargeData(para).then(res => {
let { selectedItem, curIndex, checkedItem, richText,isGameUse,coupons } = this.data let {
selectedItem,
curIndex,
checkedItem,
richText,
isGameUse,
coupons
} = this.data
if (!res) { if (!res) {
setTimeout(()=>{ setTimeout(() => {
wx.navigateBack({ wx.p.router.back()
delta: 1 }, 1500)
});
},1500)
return return
} }
if (res.length) { if (res.length) {
let brandLogo = res[0].brandLogo let brandLogo = res[0].brandLogo
query.icon = query.icon?query.icon:brandLogo query.icon = query.icon ? query.icon : brandLogo
res.forEach(item => { res.forEach(item => {
item.denominationList.map(el => { item.denominationList.map(el => {
if (el.noMemberPrice) { if (el.noMemberPrice) {
...@@ -116,7 +142,7 @@ Page({ ...@@ -116,7 +142,7 @@ Page({
} }
richText = decodeURIComponent(selectedItem.buysNotes) richText = decodeURIComponent(selectedItem.buysNotes)
richText = richText.replace(/\<span/g, '<span class="rich_text"') richText = richText.replace(/\<span/g, '<span class="rich_text"')
if(isGameUse){ if (isGameUse) {
selectedItem.payCouponsPrice = selectedItem.lineationPrice selectedItem.payCouponsPrice = selectedItem.lineationPrice
} }
this.setData({ this.setData({
...@@ -128,24 +154,20 @@ Page({ ...@@ -128,24 +154,20 @@ Page({
richText, richText,
showLogin: false, showLogin: false,
isGameUse, isGameUse,
showComponent:true showComponent: true
},()=>{ }, () => {
if(options.source=='GH'){ if (options.source == 'GH') {
this.handleEquityOfGH(options.couponsItem) this.handleEquityOfGH(options.couponsItem)
} }
}) })
}) })
}, },
toCoupons() { toCoupons() {
wx.navigateTo({ wx.p.router.go('/packageMine/pages/order/index/index')
url: '/packageMine/pages/order/index/index'
})
}, },
toOpenPage() { toOpenPage() {
this.modalOnCancel() this.modalOnCancel()
wx.navigateTo({ wx.p.router.go('/packageEquity/pages/open/open?page=business')
url: '/packageEquity/pages/open/open?page=business'
})
}, },
toMemberPage() { toMemberPage() {
this.toOpenPage() this.toOpenPage()
...@@ -159,8 +181,11 @@ Page({ ...@@ -159,8 +181,11 @@ Page({
wx.p.wxApi.showToast('请输入充值账号') wx.p.wxApi.showToast('请输入充值账号')
return return
} }
if(this.data.isGameUse)return this.comfirmBuyItem() if (this.data.isGameUse) return this.comfirmBuyItem()
const { noMemberPrice, salesPrice } = this.data.selectedItem const {
noMemberPrice,
salesPrice
} = this.data.selectedItem
let diffPrice = 0 let diffPrice = 0
if (noMemberPrice) { if (noMemberPrice) {
diffPrice = decimal(noMemberPrice - salesPrice, 2) diffPrice = decimal(noMemberPrice - salesPrice, 2)
...@@ -190,7 +215,12 @@ Page({ ...@@ -190,7 +215,12 @@ Page({
if (!orderCode) { if (!orderCode) {
return return
} }
const { selectedItem, rechageNum,isGameUse,coupons } = this.data const {
selectedItem,
rechageNum,
isGameUse,
coupons
} = this.data
let para = { let para = {
orderCode, orderCode,
goodsId: selectedItem.id, goodsId: selectedItem.id,
...@@ -199,7 +229,7 @@ Page({ ...@@ -199,7 +229,7 @@ Page({
// payMannerId: 19, // payMannerId: 19,
paySource: 3 paySource: 3
} }
if(isGameUse&&coupons){ if (isGameUse && coupons) {
para.usedCouponIds = [coupons.id] para.usedCouponIds = [coupons.id]
} }
wx.p.api.equityApi.payGoodsOrder(para).then(res => { wx.p.api.equityApi.payGoodsOrder(para).then(res => {
...@@ -209,7 +239,13 @@ Page({ ...@@ -209,7 +239,13 @@ Page({
}, },
// 处理支付 // 处理支付
handlePay(payData) { handlePay(payData) {
const { timeStamp, nonceStr, packages, signType, paySign } = payData const {
timeStamp,
nonceStr,
packages,
signType,
paySign
} = payData
let self = this let self = this
wx.requestPayment({ wx.requestPayment({
timeStamp: timeStamp, timeStamp: timeStamp,
...@@ -219,15 +255,17 @@ Page({ ...@@ -219,15 +255,17 @@ Page({
paySign: paySign, paySign: paySign,
success() { success() {
//跳转商品详情 //跳转商品详情
let { query, selectedItem, rechageNum } = self.data let {
let obj = { query,
selectedItem,
rechageNum
} = self.data
wx.p.router.go('/packageEquity/pages/chargeWait/chargeWait', {
query: {
...query, ...query,
...selectedItem, ...selectedItem,
rechageNum, rechageNum,
} }
const temp = JSON.stringify(obj)
wx.navigateTo({
url: '/packageEquity/pages/chargeWait/chargeWait?query=' + temp
}) })
}, },
fail() {} fail() {}
...@@ -240,8 +278,9 @@ Page({ ...@@ -240,8 +278,9 @@ Page({
}) })
}, },
onLoad(options) { onLoad(options) {
const query = options ? JSON.parse(decodeURIComponent(options.param)) : this.data.query // const query = options ? JSON.parse(decodeURIComponent(options.param)) : this.data.query
this.getChargeDetail(query,options) const query = options.param
this.getChargeDetail(query, options)
this.setNaviTitle(query.brandName) this.setNaviTitle(query.brandName)
wx.p.eventbus.on('EQUITYGOODS', data => { wx.p.eventbus.on('EQUITYGOODS', data => {
this.toCheckMember() this.toCheckMember()
...@@ -251,12 +290,14 @@ Page({ ...@@ -251,12 +290,14 @@ Page({
this.toCheckMember() this.toCheckMember()
}, },
// 处理广汇权益明细进入的卡券 // 处理广汇权益明细进入的卡券
handleEquityOfGH(couponsItem){ handleEquityOfGH(couponsItem) {
let {selectedItem} = this.data let {
selectedItem.payCouponsPrice = decimal(selectedItem.lineationPrice-(Number(couponsItem.denomination)), 2) selectedItem
} = this.data
selectedItem.payCouponsPrice = decimal(selectedItem.lineationPrice - (Number(couponsItem.denomination)), 2)
this.setData({ this.setData({
selectedItem, selectedItem,
coupons:couponsItem coupons: couponsItem
}) })
}, },
// 检测是否已经登录 // 检测是否已经登录
...@@ -267,7 +308,7 @@ Page({ ...@@ -267,7 +308,7 @@ Page({
flag = false flag = false
this.setData({ this.setData({
showLogin: true, showLogin: true,
showComponent:false showComponent: false
}) })
} }
return flag return flag
......
...@@ -185,9 +185,7 @@ Page({ ...@@ -185,9 +185,7 @@ Page({
if (!tempList.length) { if (!tempList.length) {
wx.p.wxApi.showToast('原商品已下架,已为您推荐其他商品') wx.p.wxApi.showToast('原商品已下架,已为您推荐其他商品')
setTimeout(() => { setTimeout(() => {
wx.navigateBack({ wx.p.router.back()
delta: 1
});
}, 1500) }, 1500)
return return
} }
...@@ -217,9 +215,7 @@ Page({ ...@@ -217,9 +215,7 @@ Page({
}) })
}, },
toMemberPage() { toMemberPage() {
wx.navigateTo({ wx.p.router.go('/packageEquity/pages/open/open?page=business')
url: '/packageEquity/pages/open/open?page=business'
})
}, },
// 去购买 // 去购买
toBuyItem() { toBuyItem() {
...@@ -307,9 +303,7 @@ Page({ ...@@ -307,9 +303,7 @@ Page({
paySign: paySign, paySign: paySign,
success() { success() {
//跳转商品详情 //跳转商品详情
wx.navigateTo({ wx.p.router.go(`/packageEquity/pages/kaqDetail/kaqDetail?orderCode=${orderCode}`)
url: '/packageEquity/pages/kaqDetail/kaqDetail?orderCode=' + orderCode
})
}, },
fail() {} fail() {}
}) })
...@@ -320,9 +314,7 @@ Page({ ...@@ -320,9 +314,7 @@ Page({
}) })
}, },
toMyCoupons() { toMyCoupons() {
wx.navigateTo({ wx.p.router.go('/packageMine/pages/order/index/index')
url: '/packageMine/pages/order/index/index'
})
}, },
openBottomModal() { openBottomModal() {
this.setData({ this.setData({
...@@ -423,10 +415,8 @@ Page({ ...@@ -423,10 +415,8 @@ Page({
toClickRich() { toClickRich() {
let str = this.getALabel(this.data.richText) let str = this.getALabel(this.data.richText)
if (!str) return if (!str) return
const url = encodeURIComponent(str) wx.p.router.jumpH5(str)
wx.navigateTo({
url: '/pages/webView/webView?url=' + url
})
}, },
loginCallBack(data) { loginCallBack(data) {
if (data) { if (data) {
......
...@@ -490,9 +490,9 @@ page { ...@@ -490,9 +490,9 @@ page {
} }
.bottom_title_wrapper { .bottom_title_wrapper {
position: sticky; // position: sticky;
left: 0; // left: 0;
top: 0; // top: 0;
width: 100%; width: 100%;
height: 88rpx; height: 88rpx;
display: flex; display: flex;
...@@ -511,15 +511,17 @@ page { ...@@ -511,15 +511,17 @@ page {
.bottom_scoll_wrap { .bottom_scoll_wrap {
width: 100%; width: 100%;
height: calc(100% - 19rpx); max-height: calc(100% - 88rpx);
overflow: hidden; overflow: hidden;
overflow-y: scroll; overflow-y: scroll;
box-sizing: border-box; box-sizing: border-box;
padding: 20rpx 0 20rpx 10rpx; padding: 20rpx;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 10rpx; gap:20rpx 10rpx;
justify-content: space-between; .scroll_element{
margin: 0;
}
} }
.bottem_item_width { .bottem_item_width {
......
...@@ -125,9 +125,7 @@ Page({ ...@@ -125,9 +125,7 @@ Page({
}) })
}, },
toMineCoupons() { toMineCoupons() {
wx.navigateTo({ wx.p.router.go('/packageMine/pages/coupon/index/index')
url: '/packageMine/pages/coupon/index/index'
})
}, },
// 去使用 // 去使用
toUseGifts(e) { toUseGifts(e) {
......
...@@ -33,9 +33,7 @@ Page({ ...@@ -33,9 +33,7 @@ Page({
} }
let temp = encodeURIComponent(JSON.stringify(bindInfo)) let temp = encodeURIComponent(JSON.stringify(bindInfo))
wx.p.storage.set('bindInfo', temp) wx.p.storage.set('bindInfo', temp)
wx.reLaunch({ wx.p.router.reLaunch('/pages/tab/equity/index');
url: '/pages/tab/equity/index',
});
}) })
}, },
toGetFreeCardDay(merchantId) { toGetFreeCardDay(merchantId) {
......
...@@ -44,15 +44,10 @@ Page({ ...@@ -44,15 +44,10 @@ Page({
if (this.data.pageForm == 'oil') { if (this.data.pageForm == 'oil') {
wx.p.storage.set('refresh_oil_oage', true) wx.p.storage.set('refresh_oil_oage', true)
} }
wx.navigateBack({ wx.p.router.back()
delta: 1
})
return return
} }
// wx.$router.reLaunch('/pages/tab/shopMall/index?tabIndex=1') wx.p.router.switchTab('/pages/tab/equity/index')
wx.switchTab({
url: '/pages/tab/equity/index',
});
} }
}) })
}, },
...@@ -116,8 +111,7 @@ Page({ ...@@ -116,8 +111,7 @@ Page({
this.data.pageForm = options.page this.data.pageForm = options.page
}, },
toLook() { toLook() {
wx.navigateTo({ wx.p.router.go('/packageEquity/pages/agreement/index')
url: '/packageEquity/pages/agreement/index'
})
}, },
}) })
\ No newline at end of file \ No newline at end of file
...@@ -41,9 +41,13 @@ Page({ ...@@ -41,9 +41,13 @@ Page({
}, },
async onShow() { async onShow() {
this.getPackageDetail(this.packageId) this.getPackageDetail(this.packageId)
this.setData({ showAuthBtn: false }) this.setData({
showAuthBtn: false
})
const loginStatus = await wx.p.router.intercept(false) const loginStatus = await wx.p.router.intercept(false)
if (loginStatus) return this.setData({ showAuthBtn: true }) if (loginStatus) return this.setData({
showAuthBtn: true
})
}, },
// 登录 // 登录
// login() { // login() {
...@@ -65,7 +69,9 @@ Page({ ...@@ -65,7 +69,9 @@ Page({
// }, // },
// 设置标题名称 // 设置标题名称
setNaviTitle(tile) { setNaviTitle(tile) {
const { merchantName } = wx.p.storage.get('merchant_info') const {
merchantName
} = wx.p.storage.get('merchant_info')
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: merchantName title: merchantName
}) })
...@@ -87,7 +93,9 @@ Page({ ...@@ -87,7 +93,9 @@ Page({
// }, // },
// 获取套餐详情 // 获取套餐详情
getPackageDetail(id) { getPackageDetail(id) {
const { merchantId } = wx.p.storage.get('merchant_info') const {
merchantId
} = wx.p.storage.get('merchant_info')
wx.p.api.couponsApi wx.p.api.couponsApi
.packageInfo({ .packageInfo({
id, id,
...@@ -124,7 +132,12 @@ Page({ ...@@ -124,7 +132,12 @@ Page({
}, },
// 创建订单 // 创建订单
createStoreOrder(orderCode) { createStoreOrder(orderCode) {
let { packageId, sessionId, packageInfo, shareStaff } = this.data let {
packageId,
sessionId,
packageInfo,
shareStaff
} = this.data
let para = { let para = {
packageId, packageId,
paySource: 3, paySource: 3,
...@@ -142,7 +155,13 @@ Page({ ...@@ -142,7 +155,13 @@ Page({
wx.p.api.couponsApi.createOrder(para).then(res => { wx.p.api.couponsApi.createOrder(para).then(res => {
wx.hideLoading() wx.hideLoading()
if (res) { if (res) {
const { timeStamp, nonceStr, packages, signType, paySign } = res const {
timeStamp,
nonceStr,
packages,
signType,
paySign
} = res
wx.requestPayment({ wx.requestPayment({
timeStamp: timeStamp, timeStamp: timeStamp,
nonceStr: nonceStr, nonceStr: nonceStr,
...@@ -150,9 +169,8 @@ Page({ ...@@ -150,9 +169,8 @@ Page({
signType: signType, signType: signType,
paySign: paySign, paySign: paySign,
success() { success() {
let temp = JSON.stringify(jumpParam) wx.p.router.go('/packageEquity/pages/success/success',{
wx.navigateTo({ order: jumpParam
url: '/packageEquity/pages/success/success?order=' + temp
}) })
// if (_this.data.options) { // if (_this.data.options) {
// wx.p.cache.storageApi.reportData(_this.data.options, false, true) // wx.p.cache.storageApi.reportData(_this.data.options, false, true)
......
...@@ -78,7 +78,12 @@ Page({ ...@@ -78,7 +78,12 @@ Page({
wx.p.wxApi.showToast('请上传图片') wx.p.wxApi.showToast('请上传图片')
return return
} }
const { query, desc, upImageURL, isPackage } = this.data const {
query,
desc,
upImageURL,
isPackage
} = this.data
wx.p.wxApi.showLoading() wx.p.wxApi.showLoading()
let para = { let para = {
orderCode: query.orderCode, orderCode: query.orderCode,
...@@ -92,12 +97,12 @@ Page({ ...@@ -92,12 +97,12 @@ Page({
}) })
setTimeout(() => { setTimeout(() => {
if (isPackage) { if (isPackage) {
wx.redirectTo({ wx.p.router.redirectTo('/packageEquity/pages/packageDetail/packageDetail', {
url: '/packageEquity/pages/packageDetail/packageDetail?orderCode=' + query.orderCode orderCode: query.orderCode
}) })
} else { } else {
wx.redirectTo({ wx.p.router.redirectTo('/packageEquity/pages/saleDetail/saleDetail', {
url: '/packageEquity/pages/saleDetail/saleDetail?orderCode=' + query.orderCode orderCode: query.orderCode
}) })
} }
}, 3000) }, 3000)
...@@ -105,7 +110,10 @@ Page({ ...@@ -105,7 +110,10 @@ Page({
}, },
// 套餐提交申请售后 // 套餐提交申请售后
packageSumbit() { packageSumbit() {
const { query, desc } = this.data const {
query,
desc
} = this.data
let para = { let para = {
orderCode: query.orderCode, orderCode: query.orderCode,
reason: desc reason: desc
...@@ -116,8 +124,8 @@ Page({ ...@@ -116,8 +124,8 @@ Page({
showWaiting: true showWaiting: true
}) })
setTimeout(() => { setTimeout(() => {
wx.redirectTo({ wx.p.router.redirectTo('/packageEquity/pages/packageDetail/packageDetail', {
url: '/packageEquity/pages/packageDetail/packageDetail?orderCode=' + query.orderCode orderCode: query.orderCode
}) })
}, 3000) }, 3000)
}) })
......
...@@ -18,35 +18,12 @@ Page({ ...@@ -18,35 +18,12 @@ Page({
}) })
}, },
toMyCoupons() { toMyCoupons() {
wx.redirectTo({ wx.p.router.redirectTo('/packageMine/pages/coupon/index/index')
url: '/packageMine/pages/coupon/index/index'
})
// wx.$router.redirectTo('packageMine.coupon.index', {
// success: true
// })
}, },
toHtmlOrder() { toHtmlOrder() {
const { orderCode, name } = this.data.order const { orderCode, name } = this.data.order
// const sessionId = wx.$util.getSessionId() wx.p.router.redirectTo('/packageEquity/pages/packageDetail/packageDetail',{
// let merchantId = wx.p.storage.get('srcm_shopmall_merchant_id') orderCode
// merchantId = merchantId || defaultMerchantId
// let para = {
// sessionId,
// merchantId,
// appId: equityAppId,
// orderCode,
// name,
// refresh: true
// }
// let urlParam = JSON.stringify(para)
// // 需要的参数,订单号,套餐名字
// let url = `${domain}/scrm-equity-h5/#/commodity/packageDetail?urlParam=${urlParam}`
// wx.$router.jumpH5(url)
// wx.redirectTo({
// url: `/pages/webView/webView?url=${encodeURIComponent(url)}`
// })
wx.redirectTo({
url: '/packageEquity/pages/packageDetail/packageDetail?orderCode=' + orderCode
}) })
}, },
......
...@@ -157,8 +157,5 @@ Page({ ...@@ -157,8 +157,5 @@ Page({
wx.p.router.go('/packageMine/pages/coupon/detail/detail', { wx.p.router.go('/packageMine/pages/coupon/detail/detail', {
item item
}) })
wx.navigateTo({
url: '/?item=' + temp
})
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -17,8 +17,7 @@ Page({ ...@@ -17,8 +17,7 @@ Page({
IMGURKBASE: 'equity/version/1_0_0/', IMGURKBASE: 'equity/version/1_0_0/',
userInfo: {}, userInfo: {},
isOpen: true, isOpen: true,
menuList: [ menuList: [{
{
title: '惠享生活', title: '惠享生活',
desc: '5折起', desc: '5折起',
icon: 'share_icon', icon: 'share_icon',
...@@ -100,14 +99,18 @@ Page({ ...@@ -100,14 +99,18 @@ Page({
onPullDownRefresh() { onPullDownRefresh() {
this.getShopPackage() this.getShopPackage()
this.toCheckMember() this.toCheckMember()
this.setData( this.setData({
{
'pageParam.pageSize': 0, 'pageParam.pageSize': 0,
loadingMore: false loadingMore: false
}, },
() => { () => {
let { currentAddress } = this.data let {
const { lat, lng } = currentAddress.location currentAddress
} = this.data
const {
lat,
lng
} = currentAddress.location
this.toGetCommodity(lat, lng) this.toGetCommodity(lat, lng)
} }
) )
...@@ -119,44 +122,50 @@ Page({ ...@@ -119,44 +122,50 @@ Page({
if (!this.data.commodityList.length) { if (!this.data.commodityList.length) {
return return
} }
let { pageParam } = this.data let {
pageParam
} = this.data
pageParam.pageSize++ pageParam.pageSize++
this.setData( this.setData({
{
pageParam, pageParam,
loadingMore: true loadingMore: true
}, },
() => { () => {
let { currentAddress } = this.data let {
const { lat, lng } = currentAddress.location currentAddress
} = this.data
const {
lat,
lng
} = currentAddress.location
this.toGetCommodity(lat, lng) this.toGetCommodity(lat, lng)
} }
) )
}, },
// 新版 // 新版
openMorePack(e) { openMorePack(e) {
const { show } = e.currentTarget.dataset const {
show
} = e.currentTarget.dataset
this.setData({ this.setData({
showMorePack: !show showMorePack: !show
}) })
}, },
// 页面跳转 // 页面跳转
// toAllEquityPage() { // toAllEquityPage() {
// wx.navigateTo({ // wx.p.router.go('/packageEquity/pages/allEquity/allEquity')
// url: '/packageEquity/pages/allEquity/allEquity'
// })
// }, // },
toBuyMember() { toBuyMember() {
wx.navigateTo({ wx.p.router.go('/packageEquity/pages/open/open')
url: '/packageEquity/pages/open/open'
})
}, },
toNewPage(e) { toNewPage(e) {
const { index, item } = e.currentTarget.dataset const {
wx.navigateTo({ index,
url: item.url item
}) } = e.currentTarget.dataset
wx.p.router.go(item.url)
}, },
// 定位 // 定位
...@@ -176,7 +185,12 @@ Page({ ...@@ -176,7 +185,12 @@ Page({
// 获取附近优惠数据 // 获取附近优惠数据
toGetCommodity(lat, lng, page) { toGetCommodity(lat, lng, page) {
let { pageParam, loadingMore, commodityList, loadOver } = this.data let {
pageParam,
loadingMore,
commodityList,
loadOver
} = this.data
let para = { let para = {
lat, lat,
lng, lng,
...@@ -233,7 +247,9 @@ Page({ ...@@ -233,7 +247,9 @@ Page({
}, },
// 获取门店套餐 // 获取门店套餐
getShopPackage() { getShopPackage() {
const { merchantId } = wx.p.storage.get('merchant_info') const {
merchantId
} = wx.p.storage.get('merchant_info')
let para = { let para = {
merchantId merchantId
} }
...@@ -246,9 +262,11 @@ Page({ ...@@ -246,9 +262,11 @@ Page({
// 去套餐详情页 // 去套餐详情页
toPackageDetail(e) { toPackageDetail(e) {
const { id } = e.currentTarget.dataset const {
wx.navigateTo({ id
url: '/packageEquity/pages/package/package?id=' + id } = e.currentTarget.dataset
wx.p.router.go('/packageEquity/pages/package/package',{
id
}) })
}, },
...@@ -264,7 +282,8 @@ Page({ ...@@ -264,7 +282,8 @@ Page({
return return
} }
wx.p.api.equityApi.checkOpenMember().then(res => { wx.p.api.equityApi.checkOpenMember().then(res => {
let flag = false, identity = 0 // 普通会员3 银卡2 金卡1 非会员 0 let flag = false,
identity = 0 // 普通会员3 银卡2 金卡1 非会员 0
if (res.data && res.data.validitDate) { if (res.data && res.data.validitDate) {
res.data.time = new Date(res.data.validitDate).format('yyyy.MM.dd') res.data.time = new Date(res.data.validitDate).format('yyyy.MM.dd')
} }
...@@ -291,7 +310,9 @@ Page({ ...@@ -291,7 +310,9 @@ Page({
// 获取门店会员卡信息 // 获取门店会员卡信息
getMemberCardData() { getMemberCardData() {
const { merchantId } = wx.p.storage.get('merchant_info') const {
merchantId
} = wx.p.storage.get('merchant_info')
let para = { let para = {
merchantId merchantId
} }
...@@ -305,7 +326,11 @@ Page({ ...@@ -305,7 +326,11 @@ Page({
// 处理免费领取权益页面带来的参数---弹框显示 // 处理免费领取权益页面带来的参数---弹框显示
handleFreeCard(bindInfo) { handleFreeCard(bindInfo) {
wx.p.storage.rm('bindInfo') wx.p.storage.rm('bindInfo')
const { code, errId, message } = bindInfo const {
code,
errId,
message
} = bindInfo
if (code == 0) { if (code == 0) {
wx.showModal({ wx.showModal({
title: '提示', title: '提示',
...@@ -350,7 +375,10 @@ Page({ ...@@ -350,7 +375,10 @@ Page({
else else
wx.getLocation({ wx.getLocation({
type: 'gcj02' type: 'gcj02'
}).then(({ latitude, longitude }) => { }).then(({
latitude,
longitude
}) => {
mapApi.detailedAdrress([latitude, longitude]).then(detail => { mapApi.detailedAdrress([latitude, longitude]).then(detail => {
let info = { let info = {
...detail, ...detail,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!