Commit 620e95ef by 张立顺

Merge branch 'v1.0.0' of http://192.168.3.233:8090/saas/mini-program/zhwy into v1.0.0

2 parents 5f0208e7 997515ac
Showing 43 changed files with 2567 additions and 209 deletions
...@@ -18,7 +18,6 @@ const systemInfo = wx.getSystemInfoSync() ...@@ -18,7 +18,6 @@ const systemInfo = wx.getSystemInfoSync()
const manual = true const manual = true
const release = false const release = false
// 判断小程序环境 // 判断小程序环境
// develop:开发版(正常开发工具,测试时) // develop:开发版(正常开发工具,测试时)
// trial:体验版 // trial:体验版
...@@ -113,11 +112,11 @@ const defaultMerchantId = { ...@@ -113,11 +112,11 @@ const defaultMerchantId = {
preRelease: '44209566' preRelease: '44209566'
}[target[index]] }[target[index]]
const CONFIG_ENV_MAP={ const CONFIG_ENV_MAP = {
'1':'develop', 1: 'develop',
'2':'test', 2: 'test',
'3':'production', 3: 'production',
'4':'beta' 4: 'beta'
} }
module.exports = { module.exports = {
index, index,
...@@ -125,5 +124,5 @@ module.exports = { ...@@ -125,5 +124,5 @@ module.exports = {
pathEnum, pathEnum,
secretKey, secretKey,
defaultMerchantId, defaultMerchantId,
env:CONFIG_ENV_MAP[index] env: CONFIG_ENV_MAP[index]
} }
...@@ -125,7 +125,12 @@ ...@@ -125,7 +125,12 @@
{ {
"root": "packageSaveMoney", "root": "packageSaveMoney",
"pages": [ "pages": [
"pages/allEquity/allEquity" "pages/allEquity/allEquity",
"pages/detail/detail",
"pages/chargeDetail/chargeDetail",
"pages/kaqDetail/kaqDetail",
"pages/chargeWait/chargeWait",
"pages/open/open"
] ]
}, },
{ {
......
...@@ -14,6 +14,8 @@ Component({ ...@@ -14,6 +14,8 @@ Component({
const { boxType } = this.data const { boxType } = this.data
if (boxType == 1) { if (boxType == 1) {
this.jump(e) this.jump(e)
} else if (boxType == 0) {
this.toNewPage(e)
} }
}, },
// 养车服务跳转 // 养车服务跳转
...@@ -45,5 +47,32 @@ Component({ ...@@ -45,5 +47,32 @@ Component({
} }
} }
}, },
// 省心出行
toNewPage(e) {
const { item } = e.currentTarget.dataset
let url = ''
if (item.supplier == 'GL_ROAD_RESCUE') {
url = '/packageEquity/pages/road/index/index'
} else if (item.appearance == 1) {
let para = {
supplier: item.supplier,
brandName: item.brandName,
location: true
}
const temp = JSON.stringify(para)
url = '/packageSaveMoney/pages/detail/detail?param=' + temp
} else if (item.appearance == 2) {
let para = {
supplier: item.supplier,
brandName: item.brandName,
icon: item.equityIcon
}
const temp = JSON.stringify(para)
url = '/packageSaveMoney/pages/chargeDetail/chargeDetail?param=' + temp
}
wx.navigateTo({
url
})
}
} }
}) })
\ No newline at end of file \ No newline at end of file
<view class="menu-box"> <view class="menu-box">
<view class="menu-item-box" wx:for="{{menuList}}" wx:key="index"> <view class="menu-item-box" wx:for="{{menuList}}" wx:key="index">
<view bind:tap="toJump" data-item="{{item}}" class="menu-item"> <view bind:tap="toJump" data-item="{{item}}" class="menu-item">
<glsx-image webp src="home/menu_icon/{{item.iconUrl}}.png" class="menu-item-icon"></glsx-image> <glsx-image wx:if="{{!item.icon}}" webp src="home/menu_icon/{{item.iconUrl}}.png" class="menu-item-icon"></glsx-image>
<image class="menu-item-icon" wx:if="{{item.icon}}" webp src="{{item.icon}}" />
<view class="menu-item-text"> <view class="menu-item-text">
{{item.name}} {{item.name}}
</view> </view>
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
.menu-item .ranle_sing { .menu-item .ranle_sing {
position: absolute; position: absolute;
right: -4rpx; right: -8rpx;
top: -8rpx; top: -8rpx;
padding: 2rpx 10rpx; padding: 2rpx 10rpx;
background: #F5222D; background: #F5222D;
......
// packageIndex/pages/carLife/index.js import { env } from '~/api/env/index'
import { tripMenu, goodsList } from '../constant/lifeConstant' import { goodsList } from '../constant/lifeConstant'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
tripMenu, tripMenu: [],
goodsList, goodsList,
utilList: [] utilList: []
}, },
...@@ -80,13 +80,43 @@ Page({ ...@@ -80,13 +80,43 @@ Page({
} }
wx.p.api.equityApi.getAllEquity(para).then(res => { wx.p.api.equityApi.getAllEquity(para).then(res => {
const carList = res.carServiceList const carList = res.carServiceList
console.log(carList); const equityList = res.goodsServiceList
// let tempArr = res.goodsServiceList let tripMenu = []
// tempArr.unshift({ const needShowEquity = ['高德打车','曹操出行']
// goodsCategory: '汽车权益', if (env == 'production') {
// equityGoodsGroupDescDtos: res.carServiceList equityList.forEach(el => {
// }) if (el.goodsCategory == '交通出行') {
if (el.equityGoodsGroupDescDtos) {
el.equityGoodsGroupDescDtos.forEach(item => {
if(needShowEquity.includes(item.equityName))
tripMenu.push({
name: item.equityName,
icon: item.equityIcon,
...item,
sign:item.equityName=='高德打车'?'10元券':''
})
})
}
}
})
} else if (env == 'test') {
equityList.forEach(el => {
if (el.goodsCategory == '智能出行') {
if (el.equityGoodsGroupDescDtos) {
el.equityGoodsGroupDescDtos.forEach(item => {
tripMenu.push({
name: item.equityName,
icon: item.equityIcon,
...item
})
})
}
}
})
}
this.setData({
tripMenu
})
}) })
}, },
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
</view> </view>
<menu-box boxType="{{1}}" menuList="{{utilList}}"></menu-box> <menu-box boxType="{{1}}" menuList="{{utilList}}"></menu-box>
</block> </block>
<view class="title-box"> <!-- <view class="title-box">
<main-title title="甄选车品"></main-title> <main-title title="甄选车品"></main-title>
</view> </view>
<goods-swiper goodsList="{{goodsList}}"></goods-swiper> <goods-swiper goodsList="{{goodsList}}"></goods-swiper> -->
</view> </view>
\ No newline at end of file \ No newline at end of file
// packageIndex/pages/carLife/index.js import { env } from '~/api/env/index'
import { import {
recreationMenu,
foodMenu,
classifyTitleList, classifyTitleList,
classifyGoodsList1, classifyGoodsList1,
classifyGoodsList2, classifyGoodsList2,
...@@ -12,8 +10,8 @@ Page({ ...@@ -12,8 +10,8 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
recreationMenu, recreationMenu: [],
foodMenu, foodMenu: [],
strategyList: [], strategyList: [],
classifyTitleList, classifyTitleList,
titleActive: 0, titleActive: 0,
...@@ -28,6 +26,7 @@ Page({ ...@@ -28,6 +26,7 @@ Page({
*/ */
onLoad() { onLoad() {
this.getStrategyList(); this.getStrategyList();
this.getAllMerchantList()
}, },
// 获取省钱攻略 // 获取省钱攻略
...@@ -53,38 +52,76 @@ Page({ ...@@ -53,38 +52,76 @@ Page({
}); });
}, },
/** getAllMerchantList() {
* 生命周期函数--监听页面初次渲染完成 let merchantId = wx.$merchant_id
*/ let para = {
onReady() {}, merchantId
}
/** wx.p.api.equityApi.getAllEquity(para).then(res => {
* 生命周期函数--监听页面显示 const carList = res.carServiceList
*/ const equityList = res.goodsServiceList
onShow() {}, let foodMenu = [], recreationMenu = []
const needShowEquity = ['星巴克', '瑞幸咖啡', '奈雪の茶', '麦当劳', '肯德基']
/** const needShowEquity2 = ['猫眼电影', '爱奇艺', '优酷', '网易云音乐', '喜马拉雅']
* 生命周期函数--监听页面隐藏 if (env == 'production') {
*/ let all = []
onHide() {}, equityList.forEach(el => {
if (el.equityGoodsGroupDescDtos) {
/** el.equityGoodsGroupDescDtos.forEach(item => {
* 生命周期函数--监听页面卸载 all.push(item)
*/ })
onUnload() {}, }
})
/** all.forEach(item => {
* 页面相关事件处理函数--监听用户下拉动作 if (needShowEquity.includes(item.equityName)) {
*/ if (item.equityName == '瑞幸咖啡') {
onPullDownRefresh() {}, item.sign = '9.9元起'
} else if (item.equityName == '麦当劳') {
/** item.sign = '新品'
* 页面上拉触底事件的处理函数 }
*/ foodMenu.push({
onReachBottom() {}, name: item.equityName,
icon: item.equityIcon,
/** ...item
* 用户点击右上角分享 })
*/ }
onShareAppMessage() {}, if (needShowEquity2.includes(item.equityName)) {
if (item.equityName == '猫眼电影') {
item.sign = '19元起'
}
recreationMenu.push({
name: item.equityName,
icon: item.equityIcon,
...item
})
}
})
} else if (env == 'test') {
let all = []
equityList.forEach(el => {
if (el.equityGoodsGroupDescDtos) {
el.equityGoodsGroupDescDtos.forEach(item => {
all.push(item)
})
}
})
all.forEach(item => {
foodMenu.push({
name: item.equityName,
icon: item.equityIcon,
...item
})
recreationMenu.push({
name: item.equityName,
icon: item.equityIcon,
...item
})
})
}
this.setData({
foodMenu,
recreationMenu
})
})
},
}); });
...@@ -8,11 +8,13 @@ ...@@ -8,11 +8,13 @@
<main-title title="美食推荐"></main-title> <main-title title="美食推荐"></main-title>
</view> </view>
<menu-box menuList="{{foodMenu}}"></menu-box> <menu-box menuList="{{foodMenu}}"></menu-box>
<view class="title-box classify-title-box"> <!-- <view class="title-box classify-title-box">
<view class="{{titleActive === index? 'classify-title-active':'classify-title'}}" wx:for="{{classifyTitleList}}" data-index="{{index}}" bind:tap="switchTitle"> <view class="{{titleActive === index? 'classify-title-active':'classify-title'}}" wx:for="{{classifyTitleList}}" data-index="{{index}}" bind:tap="switchTitle">
{{item}} {{item}}
</view> </view>
</view> </view>
<goods-swiper goodsList="{{goodsList.length ? goodsList : classifyGoodsList1}}"></goods-swiper> <goods-swiper goodsList="{{goodsList.length ? goodsList : classifyGoodsList1}}"></goods-swiper> -->
</view> </view>
<money-saving-tips list="{{strategyList}}"></money-saving-tips>
\ No newline at end of file \ No newline at end of file
<block wx:if="{{strategyList.length}}">
<money-saving-tips list="{{strategyList}}"></money-saving-tips>
</block>
\ No newline at end of file \ No newline at end of file
...@@ -793,7 +793,7 @@ Page({ ...@@ -793,7 +793,7 @@ Page({
if (this.timer) clearInterval(this.timer) if (this.timer) clearInterval(this.timer)
this.trackQuery.view = 5 this.trackQuery.view = 5
this.addTrack(this.trackQuery) this.addTrack(this.trackQuery)
wx.$util.customerbehavior(2) // wx.$util.customerbehavior(2)
}, },
/** /**
......
Page({ // Page({
data: { // data: {
list: [{ // list: [{
id: 1, // id: 1,
}, { // }, {
id: 2, // id: 2,
}, { // }, {
id: 3, // id: 3,
}, { // }, {
id: 4, // id: 4,
}, { // }, {
id: 5, // id: 5,
},] // },]
}, // },
onLoad(options) { // onLoad(options) {
}, // },
toJump(e) { // toJump(e) {
const { id } = e.currentTarget.dataset // const { id } = e.currentTarget.dataset
let url = '' // let url = ''
const shareCode = '5759S2m7h' // const shareCode = '5759S2m7h'
switch (id) { // switch (id) {
case 1: // case 1:
url = `plugin://collectionPlugin/sbkHome?shareCode=${shareCode}&userId=ooPYo45el_GJ55vqhdME5-tqQmaw` // url = `plugin://collectionPlugin/sbkHome?shareCode=${shareCode}&userId=ooPYo45el_GJ55vqhdME5-tqQmaw`
break; // break;
case 2: // case 2:
url = `plugin://collectionPlugin/sbkHome?shareCode=${shareCode}` // url = `plugin://collectionPlugin/sbkHome?shareCode=${shareCode}`
break; // break;
case 3: // case 3:
url = `plugin://collectionPlugin/naixueHome?shareCode=${shareCode}` // url = `plugin://collectionPlugin/naixueHome?shareCode=${shareCode}`
break; // break;
case 4: // case 4:
url = `plugin://ticketPlugin/home?shareCode=${shareCode}&reLocation=true` // url = `plugin://ticketPlugin/home?shareCode=${shareCode}&reLocation=true`
break; // break;
case 5: // case 5:
url = `plugin://express-plugin/home?shareCode=${shareCode}` // url = `plugin://express-plugin/home?shareCode=${shareCode}`
break; // break;
default: // default:
break; // break;
// }
// wx.navigateTo({
// url,
// })
// }
// })
const BRAND_ENUM = {
1: {
name: "肯德基",
link: "plugin://collectionPlugin/kfcHome"
},
2: {
name: "星巴克",
link: "plugin://collectionPlugin/sbkHome"
},
3: {
name: "电影票",
link: "plugin://ticketPlugin/home"
} }
}
Page({
/**
* 页面的初始数据
*/
data: {
BRAND_ENUM
},
/**
* 跳转插件
*/
testJump() {
wx.navigateTo({ wx.navigateTo({
url, url: 'plugin://collectionPlugin/sbkHome?shareCode=5759S2m7h',
})
},
/**
* 测试循环跳转插件
*/
testLoopJump(e) {
const {
item
} = e.currentTarget.dataset
wx.navigateTo({
url: `${item.link}?shareCode=5759S2m7h`,
}) })
} }
}) })
\ No newline at end of file \ No newline at end of file
<view class="container"> <!-- <view class="container">
<block wx:for="{{list}}" wx:key="index"> <block wx:for="{{list}}" wx:key="index">
<glsx-image bind:tap="toJump" data-id="{{item.id}}" class="cover" webp src="equity/plugin/equity_plugin_{{index}}.png"></glsx-image> <glsx-image bind:tap="toJump" data-id="{{item.id}}" class="cover" webp src="equity/plugin/equity_plugin_{{index}}.png"></glsx-image>
</block> </block>
</view> -->
<view>
<button bindtap="testJump">点击跳转插件页面</button>
-------------------------------------------------------------
<view>
<view wx:for="{{BRAND_ENUM}}">
<button bindtap="testLoopJump" data-item="{{item}}">{{item.name}}</button>
</view>
</view>
</view> </view>
<glsx-privacy appletName="车生活助手"></glsx-privacy>
\ No newline at end of file \ No newline at end of file
Page({
data: {
curIndex: 0,
checkedItem: 0,
isOpen: false,
selectedItem: null,
listData: [],
isGameUse:false,
coupons:null,
showCoupons:false,
},
// 获取当前商品绑定的优惠券并且处理价格
getCouponsItem(e){
const couponsItem = e.detail
let {selectedItem} = this.data
selectedItem.payCouponsPrice = wx.p.format.decimal(selectedItem.lineationPrice-(Number(couponsItem.denomination)), 2)
this.setData({
selectedItem,
coupons:couponsItem
})
},
toSelectCoupons(){
const isLogin = this.checkLogin()
if (!isLogin) {
return
}
if(this.data.isGH)return
this.setData({
showCoupons: true
})
},
bindInput(e) {
this.setData({
rechageNum: e.detail.value
})
},
changeMumberType(e) {
let { selectedItem, listData,coupons } = this.data
const { index } = e.currentTarget.dataset
selectedItem = listData[index].denominationList[0]
if(coupons){
selectedItem.payCouponsPrice = wx.p.format.decimal(selectedItem.lineationPrice-(Number(coupons.denomination)), 2)
}
this.setData({ curIndex: index, selectedItem, checkedItem: 0 })
},
checkedMumberType(e) {
const { item, index } = e.currentTarget.dataset
let richText = decodeURIComponent(item.buysNotes)
richText = richText.replace(/\<span/g, '<span class="rich_text"')
this.setData({ checkedItem: index, selectedItem: item, richText })
},
toCheckMember() {
if(this.data.isGameUse)return
const SID = wx.p.cache.storageApi.getSessionId()
if (!SID) {
return
}
wx.p.api.equityApi.checkOpenMember().then(res => {
let flag = false
if (res.code == 0 && res.data) {
flag = true
}
this.setData({
isOpen: flag
})
wx.p.eventbus.off('EQUITYGOODS')
})
},
getChargeDetail(query,options) {
let para = {
brandName: query.brandName,
supplier: query.supplier
}
if(this.data.isGameUse){
para.id = query.id
}
wx.p.api.equityApi.chargeData(para).then(res => {
let { selectedItem, curIndex, checkedItem, richText,isGameUse,coupons,isGH } = this.data
if (!res) {
// wx.redirectTo({
// url: '/packageShopmall/packageEquity/pages/allEquity/allEquity?showToast=1'
// })
setTimeout(()=>{
wx.p.router.back(e =>{
e.onLoad({showToast:1})
})
},500)
return
}
if (res.length) {
let brandLogo = res[0].brandLogo
query.icon = query.icon?query.icon:brandLogo
res.forEach(item => {
item.denominationList.map(el => {
if (el.noMemberPrice) {
el.diffPraice = wx.p.format.decimal(el.noMemberPrice - el.salesPrice, 2)
} else {
el.diffPraice = 0
}
return el
})
})
}
if (!query.id) {
selectedItem = res[0].denominationList[0]
} else {
for (let i = 0; i < res.length; i++) {
if (res[i].productName == query.productName) {
curIndex = i
}
for (let j = 0; j < res[i].denominationList.length; j++) {
if (res[i].denominationList[j].id == query.id) {
checkedItem = j
selectedItem = res[i].denominationList[j]
}
}
}
}
richText = decodeURIComponent(selectedItem.buysNotes)
richText = richText.replace(/\<span/g, '<span class="rich_text"')
if(isGameUse){
selectedItem.payCouponsPrice = selectedItem.lineationPrice
}
this.setData({
listData: res,
query,
selectedItem,
checkedItem,
curIndex,
richText,
showLogin: false,
isGameUse,
isGH,
showComponent:true
},()=>{
if(options.source=='GH'){
this.handleEquityOfGH(options.couponsItem)
}
})
})
},
toCoupons() {
wx.navigateTo({
// url: '/packageShopmall/packageEquity/pages/orderList/orderList'
url: '/packageMine/pages/order/index/index'
})
},
toOpenPage() {
this.modalOnCancel()
wx.navigateTo({
url: '/packageSaveMoney/pages/open/open?page=business'
})
},
toMemberPage() {
this.toOpenPage()
},
toRecharge() {
const isLogin = this.checkLogin()
if (!isLogin) {
return
}
if (!this.data.rechageNum) {
wx.$api.showToast('请输入充值账号')
return
}
if(this.data.isGameUse)return this.comfirmBuyItem()
// if(this.data.isGH)return this.toRechargeFill(this.data.rechageNum)
const { noMemberPrice, salesPrice } = this.data.selectedItem
let diffPrice = 0
if (noMemberPrice) {
diffPrice = wx.p.format.decimal(noMemberPrice - salesPrice, 2)
}
this.setData({
showModal: true,
diffPrice
})
},
modalOnCancel() {
this.setData({
showModal: false
})
},
comfirmBuyItem() {
wx.$api.showLoading()
let para = {
supplier: this.data.query.supplier
}
wx.p.api.equityApi.getOrderCode(para).then(res => {
this.getPayParam(res)
this.modalOnCancel()
})
},
// 获取支付参数
getPayParam(orderCode) {
if (!orderCode) {
return
}
const { selectedItem, rechageNum,isGameUse,coupons } = this.data
let para = {
orderCode,
goodsId: selectedItem.id,
rechargeNumber: rechageNum,
goodsQuality: 1,
// payMannerId: 19,
paySource: 3
}
if(isGameUse&&coupons){
para.usedCouponIds = [coupons.id]
}
wx.p.api.equityApi.payGoodsOrder(para).then(res => {
wx.hideLoading()
this.handlePay(res)
})
},
// 处理支付
handlePay(payData) {
const { timeStamp, nonceStr, packages, signType, paySign } = payData
let self = this
wx.requestPayment({
timeStamp: timeStamp,
nonceStr: nonceStr,
package: packages,
signType: signType,
paySign: paySign,
success() {
//跳转商品详情
// wx.$api.showToast('支付成功')
let { query, selectedItem, rechageNum } = self.data
let obj = {
...query,
...selectedItem,
rechageNum,
isGH:self.data.isGH
}
const temp = JSON.stringify(obj)
wx.navigateTo({
url: '/packageSaveMoney/pages/chargeWait/chargeWait?query=' + temp
})
},
fail() {}
})
},
// 设置标题名称
setNaviTitle(title) {
wx.setNavigationBarTitle({
title
})
},
onLoad(options) {
this.data.isGameUse = options.inType=='game'
this.data.isGH = options.source=='GH'
const query = options ? JSON.parse(decodeURIComponent(options.param)) : this.data.query
this.getChargeDetail(query,options)
this.setNaviTitle(query.brandName)
if(options.inType=='game')return
wx.p.eventbus.on('EQUITYGOODS', data => {
this.toCheckMember()
})
},
onShow() {
this.toCheckMember()
},
// 处理广汇权益明细进入的卡券
handleEquityOfGH(couponsItem){
let {selectedItem} = this.data
selectedItem.payCouponsPrice = wx.p.format.decimal(selectedItem.lineationPrice-(Number(couponsItem.denomination)), 2)
this.setData({
selectedItem,
coupons:couponsItem
})
},
// 检测是否已经登录
checkLogin() {
const sessionId = wx.p.cache.storageApi.getSessionId()
let flag = true
if (!sessionId) {
flag = false
this.setData({
showLogin: true,
showComponent:false
})
}
return flag
},
loginCallBack(data) {
if (data) {
this.toCheckMember()
}
},
// 广汇赠送权益直充
toRechargeFill(phone){
wx.$api.showLoading()
const {productId,orderCode,productName,discount} = this.data.ghOption
wx.p.api.equityApi.toRechargeByPhone({orderCode,phone,productId}).then(res=>{
if(res){
const obj = {
brandName:productName,
rechageNum:phone,
denomination:discount,
isGH:true
}
const temp = JSON.stringify(obj)
wx.navigateTo({
url: '/packageSaveMoney/pages/chargeWait/chargeWait?query=' + temp
})
}
})
}
})
{
"navigationBarTitleText": "权益中心",
"usingComponents": {
}
}
\ No newline at end of file \ No newline at end of file
<!-- pages/changeDetail/changeDetail.wxml -->
<view class="detail_container">
<view class="account_area">
<image webp src="{{query.icon}}"></image>
<view class="account_input">
<text class="title">充值账号</text>
<input placeholder-style="color:#B1B1B3;" bind:input="bindInput" placeholder="请输入要充值的账号" type="number" />
<view class="line"></view>
</view>
</view>
<!-- 充值会员选择 -->
<view class="member_area">
<text style="margin-left: 20rpx;" class="title">充值类型</text>
<scroll-view scroll-x="true" class="member_type">
<view class="member-box">
<view wx:for="{{listData}}" wx:key="index" bind:tap="changeMumberType" data-index="{{index}}" class="member_type_item {{index===curIndex ? 'activeNav' : ''}}">
<text class="type_name">{{item.productName}}</text>
</view>
</view>
</scroll-view>
<view class="sale_area">
<view wx:for="{{listData[curIndex].denominationList}}" wx:key="index" class="sale_item {{index===checkedItem ? 'selected_sale_item' : ''}}" bind:tap="checkedMumberType" data-item="{{item}}" data-index="{{index}}">
<text wx:if="{{!item.noMemberPrice&&!isGameUse}}" class="isMember">会员专属</text>
<view class="month">{{item.denomination}}</view>
<block wx:if="{{!isGameUse}}">
<text class="price"><text style="font-size: 22rpx;">¥</text>{{isOpen ||!item.noMemberPrice?item.salesPrice:item.noMemberPrice}}</text>
<text wx:if="{{!isOpen && item.noMemberPrice}}" class="discount">会员立减{{item.diffPraice}}元</text>
<view wx:else style="height:34rpx"></view>
<text class="authority_price">官方价<text style="text-decoration:line-through">¥{{item.lineationPrice}}</text></text>
</block>
<view wx:if="{{isGameUse}}" style="height:42rpx"></view>
<block wx:if="{{isGameUse}}">
<text class="price"><text style="font-size: 22rpx;">¥</text>{{item.lineationPrice}}</text>
</block>
</view>
</view>
</view>
<!-- 优惠券 -->
<view wx:if="{{isGameUse}}" class="coupons_widget" catch:tap="toSelectCoupons">
<view class="left_wrap">
<glsx-image class="logo" webp src="glsx/equity/comodity_use_logo.png"></glsx-image>
<view class="text">优惠券</view>
</view>
<view class="right_Wrap">
<view wx:if="{{coupons.denomination}}" class="price_text">¥{{coupons.denomination}}</view>
<glsx-image wx:if="{{!isGH}}" class="right_Wrap_icon" webp src="glsx/mine/arrow.png"></glsx-image>
</view>
</view>
<!-- 温馨提示 -->
<view class="tip">
<text class="title">温馨提示</text>
<view wx:if="{{richText}}" class="rich_wrapper">
<rich-text nodes="{{richText}}"></rich-text>
</view>
</view>
<!-- 购买按钮 -->
<view style="{{isGH?'padding:0 32rpx':''}}" class="buy_bar">
<view wx:if="{{!isGH}}" class="coupon" bind:tap="toCoupons">
<image webp src="{{IMGURL}}equity/card-icon.png?v={{img_version}}"></image>
<text>我的卡券</text>
</view>
<button wx:if="{{!isGameUse}}" style="width:468rpx" bind:tap="toRecharge" class="buy_btn">
立即购买(¥{{isOpen ||!selectedItem.noMemberPrice?selectedItem.salesPrice:selectedItem.noMemberPrice}})
</button>
<button wx:if="{{isGameUse}}" style="{{isGH?'width:100%;border-radius: 8rpx;':'width:468rpx'}}" bind:tap="toRecharge" class="buy_btn">
立即购买(¥{{selectedItem.payCouponsPrice}})
</button>
<!-- <button wx:if="{{isGH}}" style="width:100%;border-radius: 8rpx;" bind:tap="toRecharge" class="buy_btn">
立即充值
</button> -->
</view>
<!-- 弹框 -->
<view wx:if="{{showModal}}" class="overlay">
<view class="overlay_boxs">
<view class="box_body">
<image webp class="boxs_icon" webp src="{{IMGURL}}equity/scrm_modal_top_icon.png?v={{img_version}}" />
<view class="boxs_content" style="height:{{!isOpen?'612':'438'}}rpx">
<view class="box_title">
<text class="box_title_text">温馨提示</text>
</view>
<view class="box_container" style="height:{{!isOpen?'536':'410'}}rpx">
<view class="box_content_text">
<view>请您核对账号,确保无误</view>
<view class="info_tip">充值账号</view>
<view class="info_num">{{rechageNum}}</view>
</view>
<block wx:if="{{!isOpen}}">
<view class="info_line"></view>
<view class="info_diff">
开通会员本商品可再减
<text class="spc_text">{{diffPrice}}元</text>
</view>
<view class="info_open_btn" catchtap="toOpenPage">点我开通</view>
</block>
<!-- <view wx:if="{{!isOpen&&!curentGoodsItem.noMemberPrice}}" class="box_content_text">
卡券<text class="spc_text">【{{curentGoodsItem.productName}}】</text>为会员专属商品,您可在成为会员后发起购买
</view> -->
<view class="box_btn_groups">
<view class="btn_wrap" catchtap="modalOnCancel">取消</view>
<view wx:if="{{!isOpen&&!selectedItem.noMemberPrice}}" class="btn_wrap spc_text" catchtap="toMemberPage">
开通会员
</view>
<view wx:else class="btn_wrap spc_text" catchtap="comfirmBuyItem">
确定购买
</view>
<view class="dr_line"></view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<login show="{{showLogin}}"></login>
<block wx:if="{{showComponent&&!isGH}}">
<coupons-list goodsId="{{selectedItem.id}}" couponsId="{{query.couponsId}}" bind:getCoupons="getCouponsItem" show="{{showCoupons}}"></coupons-list>
</block>
\ No newline at end of file \ No newline at end of file
/* pages/changeDetail/changeDetail.wxss */
page{
background: white;
}
.detail_container{
padding-bottom: 100rpx;
}
.account_area {
padding: 34rpx 40rpx 20rpx;
display: flex;
align-items: center;
}
.account_area image {
width: 92rpx;
height: 92rpx;
border-radius: 50%;
box-shadow: 0 23rpx 18rpx 0 rgba(0, 0, 0, 0.2);
}
.account_area .account_input {
flex: 1;
margin-left: 20rpx;
width: 100%;
position: relative;
}
.account_input input {
margin-top: 20rpx;
font-size: 36rpx;
font-family: PingFangSC-Regular, PingFang SC;
}
.account_input .line {
position: absolute;
height: 2rpx;
width: 100%;
background-color: #DEDEDE;
top: calc(100% + 20rpx);
}
.member_area {
margin-top: 82rpx;
}
.title {
width: 112rpx;
height: 40rpx;
font-size: 28rpx;
font-weight: 500;
color: #282829;
line-height: 40rpx;
}
.member_area .member_type {
margin-top: 20rpx;
flex-wrap: nowrap;
flex-direction: row;
white-space: nowrap;
/* box-shadow: 0 -3px 3px rgba(0, 0, 0, 0.1) inset; */
box-shadow: 0px -8rpx 8rpx 0rpx rgba(0,0,0,0.04) inset;
}
.member-box{
height: 95rpx;
display: flex;
align-items: flex-end;
}
.member_type_item {
height: 80rpx;
width: 188rpx;
display: inline-flex;
align-items: center;
justify-content: center;
white-space: nowrap;
font-size: 28rpx;
color: #B1B1B3;
background-color: #F2F2F2;
}
.activeNav{
color: #FC5B32;
background-color: #fff;
height:90rpx;
box-shadow: 0px -4rpx 16rpx 0px rgba(0,0,0,0.04);
}
.type_name{
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.sale_area{
padding: 44rpx 40rpx;
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-column-gap: 20rpx;
grid-row-gap: 44rpx;
}
.sale_item{
height: 260rpx;
background: #FFFFFF;
border-radius: 8rpx;
box-shadow: 0 2rpx 12rpx 0 rgba(0, 0, 0, 0.1);
border: 2rpx solid #FFFFFF;
padding: 34rpx 0 32rpx;
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
}
.sale_item .isMember{
position: absolute;
right: -10rpx;
top: 0;
transform: translateY(-50%);
z-index: 2;
width: 88rpx;
height: 30rpx;
line-height: 30rpx;
text-align: center;
border-radius: 40rpx 40rpx 40rpx 20rpx;
background-color: #B1B1B3;
font-size: 16rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #fff;
}
.sale_item .month{
width: 186rpx;
height: 44rpx;
font-size: 32rpx;
background: #F2F2F2;
border-radius: 22rpx;
line-height: 44rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #B1B1B3;
text-align: center;
}
.sale_item .price{
font-size: 40rpx;
font-weight: 500;
color: #656566;
line-height: 56rpx;
margin: 6rpx 0 18rpx;
display: inline-block;
height: 56rpx;
}
.sale_item .discount{
height: 34rpx;
border: 1rpx solid #FC5B32;
font-size: 22rpx;
color: #FC5B32;
line-height: 34rpx;
padding: 0 8rpx;
margin-bottom: 4rpx;
}
.sale_item .authority_price{
height: 32rpx;
font-size: 22rpx;
color: #B1B1B3;
line-height: 32rpx;
white-space: nowrap;
}
.selected_sale_item{
border: 2rpx solid #FC5B32;
box-shadow: 0 4rpx 16rpx 0 rgba(252, 91, 50, 0.2);
}
.selected_sale_item .month{
background: rgba(252, 91, 50, 0.1);
color: #FC5B32;
}
.selected_sale_item .price{
color: #FC5B32;
}
.selected_sale_item .isMember{
background-color: #FC5B32;
}
/* 温馨提示 */
.tip {
padding: 0 40rpx;
}
.rich_text{
word-break: break-all;
white-space:pre-wrap;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
color: #656566;
line-height: 44rpx;
}
.rich_text a{
color: #FC5B32;
}
/* 按钮区域 */
.buy_bar{
position: fixed;
box-sizing: border-box;
background-color: #fff;
/* padding: 10rpx 30rpx; */
padding: 0 32rpx 0 90rpx;
height: 100rpx;
left: 0;
right: 0;
bottom: 0;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
}
.coupon{
height: 100%;
width: 80rpx;
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
margin-right: 20rpx;
}
.coupon image{
width: 40rpx;
height: 40rpx;
}
.coupon text{
height: 28rpx;
font-size: 20rpx;
color: #282829;
line-height: 28rpx;
}
.buy_btn{
width: 468rpx;
height: 80rpx;
background: #FC5B32;
border-radius: 200rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
font-weight: 600;
color: #FFFFFF;
}
.overlay {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .7);
z-index: 999;
}
.overlay_boxs {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.box_body {
width: 72%;
height: 612rpx;
display: flex;
flex-direction: column;
align-items: center;
}
.boxs_icon {
width: 288rpx;
height: 60rpx;
margin: 0 auto;
}
.boxs_content {
border-radius: 8rpx;
height: 438rpx;
position: relative;
width: 100%;
}
.box_title {
position: absolute;
left: 50%;
top: 0;
transform: translate(-50%, 0);
height: 56rpx;
width: 320rpx;
background-image: linear-gradient(142deg, #ffead1 0%, #e6bb8a 100%);
border-radius: 36rpx;
z-index: 1;
text-align: center;
line-height: 56rpx;
}
.box_title_text::before {
content: "";
position: absolute;
top: 50%;
left: -70%;
transform: translate(0, -50%);
width: 62rpx;
height: 2rpx;
background: #683800;
}
.box_title_text {
color: #683800;
font-size: 28rpx;
position: relative;
}
.box_title_text::after {
content: "";
position: absolute;
top: 50%;
right: -70%;
transform: translate(0, -50%);
width: 62rpx;
height: 2rpx;
background: #683800;
}
.box_container {
position: absolute;
left: 0;
right: 0;
bottom: 0;
height: 410rpx;
background: #ffffff;
width: 100%;
border-radius: 8px;
}
.box_content_text {
width: 100%;
box-sizing: border-box;
padding: 68rpx 48rpx 40rpx 48rpx;
font-size: 28rpx;
color: #606060;
/* line-height: 56rpx; */
text-align: center;
}
.info_tip{
color: #666666;
font-size: 24rpx;
margin-top: 34rpx;
}
.info_num{
color: #fc5b32;
font-size: 28rpx;
font-weight: 500;
margin-top: 4px;
}
.info_line{
width: calc(100% - 48rpx);
height: 2rpx;
background: rgba(0, 0, 0, 0.1);
margin: 0 auto;
margin-bottom: 24rpx;
}
.info_diff{
color: #333;
font-size: 28rpx;
text-align: center;
}
.info_open_btn{
color: #19c34e;
font-size: 24rpx;
text-decoration: underline;
margin-top: 6rpx;
text-align: center;
}
.box_btn_groups {
position: absolute;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 88rpx;
display: flex;
border-top: 2px solid #e5e5e5;
}
.btn_wrap {
text-align: center;
line-height: 88rpx;
color: #333333;
font-size: 28rpx;
width: 50%;
}
.dr_line {
position: absolute;
left: 50%;
top: 0;
bottom: 0;
width: 1px;
transform: translate(-50%, 0);
background: #e5e5e5;
}
.spc_text {
color: #ee6723;
}
.bottom_modal {
position: absolute;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 80%;
background: white;
display: flex;
flex-direction: column;
}
.bottom_title_wrapper {
position: absolute;
left: 0;
right: 0;
top: 0;
width: 100%;
height: 88rpx;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 0 40rpx;
background: white;
z-index: 1000;
}
.title_label {
font-size: 32rpx;
color: #282829;
}
.bottom_scoll_wrap {
width: 100%;
height: calc(100% - 196rpx);
overflow: hidden;
overflow-y: scroll;
box-sizing: border-box;
padding: 20rpx;
}
.bottem_item_width {
width: 224rpx;
}
.bottem_item_title_height {
height: 98rpx;
}
/* 优惠券 */
.coupons_widget{
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 0 40rpx;
margin-top: 16rpx;
margin-bottom: 32rpx;
}
.coupons_widget > .left_wrap{
display: flex;
align-items: center;
}
.coupons_widget > .left_wrap >.logo{
width: 40rpx;
height: 40rpx;
margin-right: 8rpx;
}
.coupons_widget > .left_wrap >.text{
font-weight: 400;
font-size: 28rpx;
color: #333333;
}
.right_Wrap{
display: flex;
align-items: center;
}
.price_text{
font-weight: 400;
font-size: 28rpx;
color: #F10016;
}
.right_Wrap_icon{
width: 14rpx;
height: 28rpx;
margin-left: 8rpx;
}
\ No newline at end of file \ No newline at end of file
// pages/chargeWait/chargeWait.js
Page({
/**
* 页面的初始数据
*/
data: {
},
onLoad: function(options) {
let query = JSON.parse(options.query)
this.setData({
query
})
},
toOrderList() {
wx.redirectTo({
// url:'/packageShopmall/packageEquity/pages/orderList/orderList'
url:'/packageShopmall/packageMine/pages/order/index/index'
})
},
toBack() {
wx.navigateBack({
delta: 1
})
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<view class="charge-wait-contaienr">
<view class="box_wrapper">
<view class="box_title">充值流程</view>
<view class="row_time_line">
<view class="row_icon"><view class="mini"></view></view>
<view class="row_text">支付成功</view>
</view>
<view class="col_line"></view>
<view class="row_time_line">
<view class="row_icon"><view class="mini"></view></view>
<view class="row_text">充值已提交,等待{{query.brandName}}处理</view>
</view>
<view class="col_line grey"></view>
<view class="row_time_line">
<view class="row_icon grey"></view>
<view class="row_text grey_color">预计10秒内到账</view>
</view>
<view class="row_pannel">
<view class="row_text grey_color">具体到账情况以运营商为准,如有疑问,请致电400-028-0503联系我们</view>
</view>
</view>
<view class="driver"></view>
<view class="box_wrapper_two">
<view class="box_title" style="margin-bottom:0;font-size: 32rpx;">{{query.brandName}}{{query.denomination}}</view>
<view class="box_tip">充值账号:{{query.rechageNum}}</view>
<view wx:if="{{!query.isGH}}" class="box_btn_wrap">
<view class="btn_item" bind:tap="toBack">继续充值</view>
<view class="btn_item leftBtn" bind:tap="toOrderList">查看订单</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
page {
background: white;
}
.box_wrapper {
box-sizing: border-box;
padding: 32rpx 60rpx 80rpx 40rpx;
}
.box_title {
font-size: 28rpx;
font-weight: 600;
color: #333333;
margin-bottom: 24rpx;
}
.row_time_line {
display: flex;
align-items: center;
}
.row_icon {
width: 32rpx;
height: 32rpx;
background: rgba(0, 143, 255, 0.2);
border-radius: 50%;
box-sizing: border-box;
padding: 6rpx;
}
.row_icon>.mini {
width: 100%;
height: 100%;
background: #008FFF;
border-radius: 50%;
}
.row_text {
font-size: 32rpx;
font-weight: 500;
color: #008FFF;
padding-left: 30rpx;
}
.col_line {
padding: 6rpx 0;
height: 60rpx;
background: #008FFF;
width: 2rpx;
margin-left: 16rpx;
}
.row_pannel {
margin-left: 32rpx;
margin-top: 22rpx;
}
.box_wrapper_two {
display: flex;
flex-direction: column;
align-items: center;
padding-top: 60rpx;
}
.box_tip {
font-size: 28rpx;
font-weight: 400;
color: #666666;
margin-top: 20rpx;
margin-bottom: 28rpx;
}
.box_btn_wrap {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.btn_item {
width: 231rpx;
height: 56rpx;
background: rgba(0, 143, 255, 0.08);
border-radius: 140rpx;
border: 2rpx solid #008FFF;
font-size: 24rpx;
font-weight: 400;
color: #008FFF;
display: flex;
align-items: center;
justify-content: center;
}
.grey {
background: #E9E9E9;
}
.grey_color {
color: #666666;
}
.driver {
width: 100%;
height: 12rpx;
background: #F4F4F4;
}
.leftBtn {
margin-left: 16rpx;
border: 2rpx solid #E9E9E9;
background: white;
color: #666666;
}
\ No newline at end of file \ No newline at end of file
import { equityApi } from '~/api/api'
// import mapApi from '~/utils/mapapi/mapapi'
import { decimal } from '~/utils/format'
const baseUrl = 'https://img02.glsx.com.cn/weapp/resource/equity-h5-new/mini/' const baseUrl = 'https://img02.glsx.com.cn/weapp/resource/equity-h5-new/mini/'
Page({ Page({
data: { data: {
...@@ -13,7 +12,7 @@ Page({ ...@@ -13,7 +12,7 @@ Page({
currentIndex: 0, currentIndex: 0,
richText: '', richText: '',
showModal: false, showModal: false,
noScroll: wx.$api.noScroll(), noScroll: wx.p.wxApi.noScroll(),
isGameUse:false, isGameUse:false,
coupons:null, coupons:null,
showCoupons:false, showCoupons:false,
...@@ -22,7 +21,7 @@ Page({ ...@@ -22,7 +21,7 @@ Page({
onShow: function () { onShow: function () {
this.toCheckMember() this.toCheckMember()
}, },
onRoute: function (options) { onLoad: function (options) {
options = JSON.stringify(options)==='{}'?this.options:options options = JSON.stringify(options)==='{}'?this.options:options
this.data.isGameUse = options.inType=='game' this.data.isGameUse = options.inType=='game'
const query = options ? JSON.parse(decodeURIComponent(options.param)) : this.data.query const query = options ? JSON.parse(decodeURIComponent(options.param)) : this.data.query
...@@ -41,7 +40,7 @@ Page({ ...@@ -41,7 +40,7 @@ Page({
// this.getLocation(query) // this.getLocation(query)
// return // return
// } // }
wx.$api.showLoading() wx.p.wxApi.showLoading()
this.toGetCommodity(query,options) this.toGetCommodity(query,options)
this.setData({ this.setData({
// unauthorized, // unauthorized,
...@@ -51,14 +50,14 @@ Page({ ...@@ -51,14 +50,14 @@ Page({
isGH:options.source=='GH' isGH:options.source=='GH'
}) })
if(options.inType=='game')return if(options.inType=='game')return
wx.$eventbus.on('EQUITYGOODS', data => { wx.p.eventbus.on('EQUITYGOODS', data => {
this.toCheckMember() this.toCheckMember()
}) })
}, },
// 处理广汇权益明细进入的卡券 // 处理广汇权益明细进入的卡券
handleEquityOfGH(couponsItem){ handleEquityOfGH(couponsItem){
let {curentGoodsItem} = this.data let {curentGoodsItem} = this.data
curentGoodsItem.payCouponsPrice = decimal(curentGoodsItem.lineationPrice-(Number(couponsItem.denomination)), 2) curentGoodsItem.payCouponsPrice = wx.p.format.decimal(curentGoodsItem.lineationPrice-(Number(couponsItem.denomination)), 2)
this.setData({ this.setData({
curentGoodsItem, curentGoodsItem,
coupons:couponsItem coupons:couponsItem
...@@ -68,7 +67,7 @@ Page({ ...@@ -68,7 +67,7 @@ Page({
getCouponsItem(e){ getCouponsItem(e){
const couponsItem = e.detail const couponsItem = e.detail
let {curentGoodsItem} = this.data let {curentGoodsItem} = this.data
curentGoodsItem.payCouponsPrice = decimal(curentGoodsItem.lineationPrice-(Number(couponsItem.denomination)), 2) curentGoodsItem.payCouponsPrice = wx.p.format.decimal(curentGoodsItem.lineationPrice-(Number(couponsItem.denomination)), 2)
this.setData({ this.setData({
curentGoodsItem, curentGoodsItem,
coupons:couponsItem coupons:couponsItem
...@@ -96,7 +95,7 @@ Page({ ...@@ -96,7 +95,7 @@ Page({
this.toGetCommodityStock(item.id) this.toGetCommodityStock(item.id)
// const {isGameUse,coupons} = this.data // const {isGameUse,coupons} = this.data
// if(isGameUse&&coupons){ // if(isGameUse&&coupons){
// item.payCouponsPrice = decimal(item.lineationPrice-coupons.goodsAmount, 2) // item.payCouponsPrice = wx.p.format.decimal(item.lineationPrice-coupons.goodsAmount, 2)
// } // }
this.setData({ this.setData({
currentIndex: index, currentIndex: index,
...@@ -109,11 +108,11 @@ Page({ ...@@ -109,11 +108,11 @@ Page({
// 查询会员开通情况 // 查询会员开通情况
toCheckMember() { toCheckMember() {
if(this.data.isGameUse)return if(this.data.isGameUse)return
const SID = wx.$util.getSessionId() const SID = wx.p.cache.storageApi.getSessionId()
if (!SID) { if (!SID) {
return return
} }
equityApi.checkOpenMember().then(res => { wx.p.api.equityApi.checkOpenMember().then(res => {
let flag = false let flag = false
if (res.code == 0 && res.data) { if (res.code == 0 && res.data) {
flag = true flag = true
...@@ -121,7 +120,7 @@ Page({ ...@@ -121,7 +120,7 @@ Page({
this.setData({ this.setData({
isOpen: flag isOpen: flag
}) })
wx.$eventbus.off('EQUITYGOODS') wx.p.eventbus.off('EQUITYGOODS')
}) })
}, },
// 获取商品信息 // 获取商品信息
...@@ -131,7 +130,7 @@ Page({ ...@@ -131,7 +130,7 @@ Page({
if(tem.id&&!isGameUse){ if(tem.id&&!isGameUse){
delete tem.id delete tem.id
} }
equityApi.commodityMsg(tem).then(res => { wx.p.api.equityApi.commodityMsg(tem).then(res => {
res.goodsDetailList = res.goodsDetailList || [] res.goodsDetailList = res.goodsDetailList || []
let tempList = res.goodsDetailList.map((item, index) => { let tempList = res.goodsDetailList.map((item, index) => {
item.warrantyDate = new Date(item.warrantyDate).format('yyyy-MM-dd hh:mm:ss') item.warrantyDate = new Date(item.warrantyDate).format('yyyy-MM-dd hh:mm:ss')
...@@ -146,7 +145,7 @@ Page({ ...@@ -146,7 +145,7 @@ Page({
} }
delete tempObj.goodsDetailList delete tempObj.goodsDetailList
if (!curentGoodsItem && query.shortlink) { if (!curentGoodsItem && query.shortlink) {
wx.$api.showToast('原商品已下架,已为您推荐其他商品') wx.p.wxApi.showToast('原商品已下架,已为您推荐其他商品')
} }
if (!query.id || !curentGoodsItem) { if (!query.id || !curentGoodsItem) {
currentIndex = 0 currentIndex = 0
...@@ -200,7 +199,7 @@ Page({ ...@@ -200,7 +199,7 @@ Page({
id id
} }
wx.hideLoading() wx.hideLoading()
equityApi.checkStock(para).then(res => { wx.p.api.equityApi.checkStock(para).then(res => {
const { code, data } = res const { code, data } = res
let flag = false let flag = false
if (code == 0 && data != 0) { if (code == 0 && data != 0) {
...@@ -232,7 +231,7 @@ Page({ ...@@ -232,7 +231,7 @@ Page({
const { noMemberPrice, salesPrice } = curentGoodsItem const { noMemberPrice, salesPrice } = curentGoodsItem
let diffPrice = 0 let diffPrice = 0
if (noMemberPrice) { if (noMemberPrice) {
diffPrice = decimal(noMemberPrice - salesPrice, 2) diffPrice = wx.p.format.decimal(noMemberPrice - salesPrice, 2)
} }
this.setData({ this.setData({
diffPrice, diffPrice,
...@@ -241,7 +240,7 @@ Page({ ...@@ -241,7 +240,7 @@ Page({
}, },
// 确定购买 // 确定购买
comfirmBuyItem() { comfirmBuyItem() {
wx.$api.showLoading() wx.p.wxApi.showLoading()
this.toGetCode() this.toGetCode()
this.modalOnCancel() this.modalOnCancel()
}, },
...@@ -250,7 +249,7 @@ Page({ ...@@ -250,7 +249,7 @@ Page({
let para = { let para = {
supplier: this.data.query.supplier supplier: this.data.query.supplier
} }
equityApi.getOrderCode(para).then(res => { wx.p.api.equityApi.getOrderCode(para).then(res => {
this.getPayParam(res) this.getPayParam(res)
}) })
}, },
...@@ -270,7 +269,7 @@ Page({ ...@@ -270,7 +269,7 @@ Page({
if(isGameUse&&coupons){ if(isGameUse&&coupons){
para.usedCouponIds = [coupons.id] para.usedCouponIds = [coupons.id]
} }
equityApi.payGoodsOrder(para).then(res => { wx.p.api.equityApi.payGoodsOrder(para).then(res => {
wx.hideLoading() wx.hideLoading()
this.handlePay(res, orderCode) this.handlePay(res, orderCode)
}) })
...@@ -288,7 +287,7 @@ Page({ ...@@ -288,7 +287,7 @@ Page({
success() { success() {
//跳转商品详情 //跳转商品详情
wx.navigateTo({ wx.navigateTo({
url: '/packageShopmall/packageEquity/pages/kaqDetail/kaqDetail?orderCode=' + orderCode url: '/packageSaveMoney/pages/kaqDetail/kaqDetail?orderCode=' + orderCode
}) })
}, },
fail() {} fail() {}
...@@ -302,7 +301,7 @@ Page({ ...@@ -302,7 +301,7 @@ Page({
toMyCoupons() { toMyCoupons() {
wx.navigateTo({ wx.navigateTo({
// url: '/packageShopmall/packageEquity/pages/orderList/orderList' // url: '/packageShopmall/packageEquity/pages/orderList/orderList'
url: '/packageShopmall/packageMine/pages/order/index/index' url: '/packageMine/pages/order/index/index'
}) })
}, },
openBottomModal() { openBottomModal() {
...@@ -372,7 +371,7 @@ Page({ ...@@ -372,7 +371,7 @@ Page({
}, },
// 检测是否已经登录 // 检测是否已经登录
checkLogin() { checkLogin() {
const sessionId = wx.$util.getSessionId() const sessionId = wx.p.cache.storageApi.getSessionId()
let flag = true let flag = true
if (!sessionId) { if (!sessionId) {
flag = false flag = false
......
{ {
"navigationBarTitleText": "权益中心", "navigationBarTitleText": "权益中心",
"usingComponents": { "usingComponents": {
"coupons-list": "../components/couponsList/index"
} }
} }
\ No newline at end of file \ No newline at end of file
import { equityApi } from '~/api/api'
Page({
data: {},
onLoad: function (options) {
this.getOrderInfo(options.orderCode)
},
getOrderInfo(orderCode) {
equityApi.orderDetailData({ orderCode }).then(res => {
let richText = res.useNotes
res.warrantyDate = res.warrantyDate ? new Date(res.warrantyDate).format('yyyy-MM-dd hh:mm:ss') : ''
if (richText) {
richText = decodeURIComponent(richText)
}
this.setData({
order: res,
richText
})
})
},
previewImage() {
wx.$api.previewImage({
current: this.data.order.qrcode,
urls: [this.data.order.qrcode]
})
},
setCopyData(e) {
wx.$api.setCopyData(e.currentTarget.dataset.item, () => {
wx.$api.showToast('复制成功')
})
}
})
{
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<view>
<view class="coupon_info">
<image webp class="logo" src="{{order.brandLogo}}"></image>
<text class="name">{{order.brandName}}{{order.productName}}</text>
<text wx:if="{{order.warrantyDate}}" class="valid_date">质保期至 {{order.warrantyDate}}</text>
<text class="order">订单编号 {{order.orderCode}}</text>
</view>
<view wx:if="{{order.cardType==0 || order.cardType==1 || order.cardType==2}}" style="text-align: center;margin: 60rpx 0 136rpx;">
<image webp bind:tap="previewImage" class="qrcode" mode="widthFix" src="{{order.qrcode}}"></image>
</view>
<view wx:if="{{order.cardType>2}}" class="card_pannel">
<view class="card_panner_conten" style="margin-top:0">
<view class="card_line">{{ order.brandName }}丨{{ order.productName }}</view>
</view>
<view wx:if="{{order.cardType==3}}" class="card_panner_conten">
<view class="card_line">URL:{{order.linkUrl}}</view>
<view class="card_btn" data-item="{{order.linkUrl}}" bind:tap="setCopyData">复制</view>
</view>
<view wx:if="{{order.cardType==4}}" class="card_panner_conten">
<view class="card_line">兑换码:{{order.cardPwd}}</view>
<view class="card_btn" data-item="{{order.cardPwd}}" bind:tap="setCopyData">复制</view>
</view>
<view wx:if="{{order.cardType==5}}" class="card_panner_conten">
<view class="card_line">账号:{{order.cardPwd}}</view>
<view class="card_btn" data-item="{{order.cardPwd}}" bind:tap="setCopyData">复制</view>
</view>
<view wx:if="{{order.cardType==5}}" class="card_panner_conten">
<view class="card_line">密码:{{order.cardPwd}}</view>
<view class="card_btn" data-item="{{order.cardPwd}}" bind:tap="setCopyData">复制</view>
</view>
</view>
<view style="padding: 0 40rpx;">
<view style="text-align: center;margin-bottom: 20rpx;">
<text class="title">使用须知</text>
</view>
<rich-text class="tip" nodes="{{richText}}"></rich-text>
</view>
<view style="height:30rpx"></view>
</view>
/* pages/couponDetail/couponDetail.wxss */
page{
background: white;
}
.coupon_info{
display: flex;
flex-direction: column;
align-items: center;
}
.logo{
height: 92rpx;
width: 92rpx;
margin: 62rpx 0 40rpx;
}
.name{
height: 44rpx;
font-size: 32rpx;
font-family: PingFang-SC-Heavy, PingFang-SC;
font-weight: 800;
color: #333333;
line-height: 44rpx;
}
.valid_date{
margin: 10rpx 0;
}
.order, .valid_date{
height: 28rpx;
font-size: 20rpx;
font-family: PingFang-SC-Medium, PingFang-SC;
font-weight: 500;
color: #999999;
line-height: 28rpx;
}
.qrcode{
width: 320rpx;
height: 320rpx;
border: 1rpx solid #999999;
}
.card_pannel{
margin: 40rpx;
background: linear-gradient(164deg, #ff9900 0%, rgba(254, 190, 0, 0.81) 100%);
height: 354rpx;
border-radius: 32rpx;
box-sizing: border-box;
padding: 46rpx;
opacity: 0.86;
margin-bottom: 80rpx;
position: relative;
}
.card_panner_conten{
display: flex;
align-items: center;
margin-top: 40rpx;
}
.card_line{
max-width: 470tpx;
font-size: 28rpx;
font-weight: 400;
color: #ffffff;
line-height: 40rpx;
text-shadow: 0px 4rpx 8rpx rgba(254, 96, 0, 0.24);
}
.card_btn{
margin-left: 20rpx;
display: inline-block;
text-align: center;
width: 72rpx;
height: 36rpx;
line-height: 36rpx;
background: #ffffff;
border-radius: 32rpx;
font-size: 20rpx;
color: #666666;
}
.title{
height: 44rpx;
font-size: 32rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #666666;
}
.tip{
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
}
\ No newline at end of file \ No newline at end of file
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-12-15 11:17:09
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-12-26 12:31:15
* @FilePath: \miniprogram\packageShopmall\packageEquity\pages\kaqDetail\orderDetail.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { equityApi } from "~/api/api";
Page({
data: {},
onLoad: function (options) {
this.getOrderInfo(options.orderCode);
},
jumpDetail(e) {
const {item} = e.currentTarget.dataset
const {productId,productName,useExplain,exchangeCode} = item
const {orderCode} = this.data.order;
wx.$router.go('/packageShopmall/packageExpandedGold/pages/activity/userDetail/index', {
productId,
productName,
useExplain,
exchangeCode,
orderCode
})
},
getOrderInfo(orderCode) {
equityApi.orderDetail({ orderCode }).then((res) => {
const exchangeCodeList = res.exchangeCodeList|| []
exchangeCodeList.forEach(element => {
if(element.discount) {
element.mark = element.discount.replace(/[\d\.]/g,'').replace(/¥/,'元')
element.price = element.discount.replace(/[^\w\.]/g,'')
}
});
const expandedGoldUserCouponDTOS = res.expandedGoldUserCouponDTOS.filter(i=>i.discountType!=8)
expandedGoldUserCouponDTOS.forEach(itm=>{
itm.receiveStartTime = new Date(itm.receiveStartTime).format('yyyy.MM.dd')
if (itm.effectiveType == 1) {
itm.receiveEndTime = new Date(itm.receiveEndTime).format('yyyy.MM.dd hh:mm:ss')
} else {
itm.receiveEndTime = new Date(itm.receiveEndTime).format('yyyy.MM.dd')
}
console.log(itm)
itm.discountIntensity = itm.discountIntensity / 100
})
const expandedGold = res.expandedGoldUserCouponDTOS.filter(i=>i.discountType==8)
this.setData({
order: res,
expandedGoldUserCouponDTOS,
expandedGold,
exchangeCodeList
});
});
},
toUseConpon(e){
const {brandName, goodsId, id, goodsLogo, appearance, goodsName,couponId} = e.currentTarget.dataset.item
let path = '/packageShopmall/packageEquity/pages/commodity/detail/detail'
let param = {
supplier: 'HW',
brandName,
id: goodsId,
couponsId:id,
couponId
}
if(appearance==2){
path = '/packageShopmall/packageEquity/pages/commodity/chargeDetail/chargeDetail'
param.productName = goodsName
param.icon = goodsLogo
}
wx.$router.go(path, {inType: 'game', param: encodeURIComponent(JSON.stringify(param))})
},
previewImage() {
wx.$api.previewImage({
current: this.data.order.qrcode,
urls: [this.data.order.qrcode],
});
},
setCopyData(e) {
wx.$api.setCopyData(e.currentTarget.dataset.item, () => {
wx.$api.showToast("复制成功");
});
},
});
{
"usingComponents": {
"coupon-item": "../../../components/CouponsItem/element"
},
"navigationBarTitleText": "订单详情"
}
\ No newline at end of file \ No newline at end of file
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-12-15 11:17:09
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-12-22 16:52:48
* @FilePath: \miniprogram\packageShopmall\packageEquity\pages\kaqDetail\orderDetail.wxml
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<view>
<view class="coupon_info">
<view class="order-info">
<view class="order-title">订单信息</view>
<view class="order-desc" style="margin-bottom: 20rpx;"><text class="order-label">订单日期:</text> <text>{{order.createdDate}}</text> </view>
<view class="order-desc"><text class="order-label">订单编号:</text><text>{{order.orderCode}}</text></view>
</view>
<view class="order-info">
<view class="order-title">{{order.merchantName}}</view>
<view class="order-coupon">
<view class="coupon-img">
<image webp wx:if="{{order.activityBigImg}}" src="{{order.activityBigImg}}"></image>
</view>
<view class="coupon-detail">
<view class="coupon-title">
{{order.activityName}}
</view>
<view class="coupon-desc">
<text>
¥ {{order.orderPrice}}
</text>
<text>
x1
</text>
</view>
</view>
</view>
<view class="order-desc coupon-total"><text>订单金额</text><text class="coupon-price">¥ <text>{{order.orderPrice}}</text></text></view>
</view>
<view class="order-info" wx:if="{{expandedGoldUserCouponDTOS.length}}">
<view class="order-title">订单明细</view>
<block wx:for="{{expandedGoldUserCouponDTOS}}" wx:key="id">
<coupon-item btnStatus="{{item.userStatus==1?0:1}}" coupons="{{item}}" useMemberType="{{0}}"></coupon-item>
</block>
<block wx:if="{{expandedGold.length}}">
<view class="online_conpon_ctnr" wx:for="{{expandedGold}}" wx:for-item="i" wx:key="id">
<view class="online_conpon">
<view class="price_wrap">
<view>
<text class="num">{{i.denomination || 0}}</text>
<text class="unit">元</text>
</view>
<view class="tip">无门槛</view>
</view>
<view class="info_wrap">
<view class="name">{{i.brandName ? i.brandName + '·' : ''}}{{i.appearance == 2 ? i.goodsName + i.rechargeDenomination : i.goodsName}}</view>
<!-- <view class="remark">无门槛</view> -->
<view class="date">数量:{{i.amount}}</view>
<view class="date">剩余有效期:{{i.residueEffectiveDays || 0}}天</view>
<view class="use_btn" bindtap="toUseConpon" data-item="{{i}}">去使用</view>
</view>
</view>
</view>
</block>
<block wx:if="{{exchangeCodeList.length}}">
<view class="coupon-info">
<view class="coupon-item" wx:for="{{exchangeCodeList}}" wx:key="id">
<view class="coupon-item-price"><text>{{item.price}}</text>{{item.mark}}</view>
<view class="coupon-item-desc">
<view class="coupon-item-title">{{item.productName}}</view>
<view class="coupon-item-time">请在一个月内获取兑换码</view>
</view>
<view class="coupon-item-btn" bindtap="jumpDetail" data-item="{{item}}">查看</view>
</view>
</view>
</block>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
/* packageShopmall/packageEquity/pages/kaqDetail/orderDetail.wxss */
.coupon_info {
background: #F7F7F7;
min-height: 100vh;
padding-top: 20rpx;
box-sizing: border-box;
}
.order-info {
width: 710rpx;
margin: 0rpx auto 20rpx;
background-image: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 100%);
border-radius: 16rpx;
padding: 28rpx 32rpx;
box-sizing: border-box;
}
.order-title {
font-weight: 600;
font-size: 32rpx;
color: #0A0D14;
line-height: 44rpx;
margin-bottom: 32rpx;
}
.order-desc {
display: flex;
justify-content: space-between;
color: #23272F;
font-size: 24rpx;
}
.order-label {
color: #858A94;
}
.order-coupon {
display: flex;
}
.coupon-img {
width: 160rpx;
height: 160rpx;
}
.coupon-detail {
flex: 1;
margin-left: 20rpx;
}
.coupon-title {
font-weight: 600;
font-size: 30rpx;
color: #333333;
width: 366rpx;
line-height: 40rpx;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
}
.coupon-desc {
display: flex;
justify-content: space-between;
font-size: 28rpx;
color: #858A94;
line-height: 40rpx;
}
.coupon-desc text:first-child {
font-weight: 600;
color: #23272F;
}
.coupon-total {
margin-top: 30rpx;
padding-top: 20rpx;
border-top: 1.2rpx solid #E3E3E6;
}
.coupon-price {
font-size: 24rpx;
font-weight: 600;
line-height: 44rpx;
color: rgba(252, 91, 50, 1);
}
.coupon-price text {
font-size: 34rpx;
}
.price-m {
font-size: 20rpx!important;
margin-left: 4rpx;
}
.coupon-item {
margin-top: 16rpx;
width: 100%;
height: 112rpx;
box-sizing: border-box;
background: #FEFAF6;
border-radius: 8rpx;
padding: 20rpx 24rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.coupon-item-price {
font-weight: 600;
font-size: 20rpx;
color: #FC5B32;
width: 150rpx;
}
.coupon-item-price text {
font-size: 32rpx;
width: 60rpx;
display: inline-block;
margin-right: 20rpx;
text-align: center;
}
.coupon-item-desc {
width: 360rpx;
position: relative;
}
.coupon-item-desc::before {
content: '';
position: absolute;
top: 0px;
left: -20rpx;
width: 2rpx;
height: 72rpx;
background-color: #FFE0D2;
}
.coupon-item-title {
font-weight: 600;
font-size: 24rpx;
color: #FC5B32;
line-height: 40rpx;
}
.coupon-item-time {
font-size: 20rpx;
color: #D83C14;
}
.coupon-item-btn {
width: 99.06rpx;
height: 45rpx;
line-height: 45rpx;
background-image: linear-gradient(270deg, #EE7E44 12%, #ED6A42 94%);
box-shadow: inset 0 2rpx 6rpx 0 #ffffff;
border-radius: 22.5rpx;
font-size: 20rpx;
color: #FFFFFF;
text-align: center;
}
.online_conpon_ctnr{
margin-top: 32rpx;
}
.online_conpon{
height: 156rpx;
background: #FFF5F3;
border-radius: 8rpx;
padding: 8rpx;
display: flex;
}
.online_conpon .price_wrap{
padding-left: 16rpx;
display: flex;
flex-direction: column;
justify-content: center;
width: 154rpx;
flex-shrink: 0;
color: #FC5B32;
}
.price_wrap .num{
height: 84rpx;
font-weight: 600;
font-size: 42rpx;
color: #FC5B32;
}
.price_wrap .unit{
height: 28rpx;
font-weight: 500;
font-size: 20rpx;
color: #FC5B32;
vertical-align: text-top;
margin-left: 4rpx;
}
.price_wrap .tip{
height: 34rpx;
font-weight: 400;
font-size: 24rpx;
color: #D83C14;
}
.online_conpon .info_wrap{
flex: 1;
background-color: #fff;
padding: 16rpx 12rpx 16rpx 24rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
position: relative;
}
.info_wrap .name{
height: 80rpx;
font-weight: 600;
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
}
.info_wrap .remark,.info_wrap .date{
height: 28rpx;
line-height: 20rpx;
font-weight: 400;
font-size: 20rpx;
color: #D83C14;
}
.info_wrap .use_btn{
position: absolute;
width: 136rpx;
height: 48rpx;
line-height: 48rpx;
background-image: linear-gradient(90deg, #FC5B32 2%, #FF1A33 96%);
border-radius: 23rpx;
color: #fff;
text-align: center;
right: 12rpx;
bottom: 16rpx;
}
\ No newline at end of file \ No newline at end of file
import { equityApi } from '~/api/api'
import { defaultMerchantId } from '~/utils/request/environment'
Page({
/**
* 页面的初始数据
*/
data: {
isOpen: false,
openingStatus: false
},
// 获取门店会员卡信息
getMemberCardData() {
const merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
let newMerchantId = merchantId || defaultMerchantId
let para = {
merchantId: newMerchantId
}
equityApi.memberCard(para).then(res => {
this.setData({
memberInfo: res
})
wx.$Track.setTrack(
{
memberInfo: res
},
6
)
})
},
// 获取用户会员信息
toCheckMember() {
equityApi.checkOpenMember().then(res => {
if (res.code == 0 && res.data.cardNo) {
wx.$storage.set('isVIP', true)
this.setData({
openingStatus: false
})
if (this.data.pageForm) {
if (this.data.pageForm == 'oil') {
wx.$storage.set('refresh_oil_oage', true)
}
wx.navigateBack({
delta: 1
})
return
}
wx.$router.reLaunch('/pages/tab/shopMall/index?tabIndex=1')
}
})
},
// 去购买会员
async openMemberFn() {
let sid = wx.$util.getSessionId()
if (!sid) {
this.setData({
showLogin: true
})
return
}
const { memberInfo } = this.data
wx.$api.showLoading()
let para = {
equityClassId: memberInfo.equityClassId,
orderCode: memberInfo.orderCode,
orderSource: 3
}
wx.$Track.setTrack(
{
...para,
type: '购买权益卡'
},
7
)
equityApi.buyMemberCard(para).then(res => {
wx.hideLoading()
this.handlePay(res)
})
},
// 处理购买参数拉起支付
handlePay(payData) {
const { timeStamp, nonceStr, packages, signType, paySign } = payData
let self = this
wx.requestPayment({
timeStamp: timeStamp,
nonceStr: nonceStr,
package: packages,
signType: signType,
paySign: paySign,
success() {
setTimeout(() => {
self.toCheckMember()
}, 1500)
this.setData({
openingStatus: true
})
},
fail() {}
})
},
onLoad: function (options) {
this.getMemberCardData()
this.data.pageForm = options.page
},
toLook() {
wx.navigateTo({
url: '/packageShopmall/packageEquity/pages/agreement/index'
})
},
toActive() {
wx.navigateTo({
url: '/packageShopmall/packageEquity/pages/active/active'
})
}
})
{
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<view class="open-container-page">
<view class="top_widget">
<image webp mode="widthFix" class="top_icon_bg" webp src="{{IMGURL}}equity/scrm_index_bg.png?v={{img_version}}" />
<view class="mini_title">{{ isOpen ? "已开通" : "未开通" }}</view>
<view class="card_title">{{memberInfo.equityName}}</view>
<view class="card_title_1">尊享100+专属权益</view>
</view>
<view class="mid_desc_bg">
<image webp mode="widthFix" webp class="desc_icon" src="{{IMGURL}}equity/scrm_opening.png?v={{img_version}}" />
</view>
<image webp class="device_icon" bind:tap="toActive" mode="widthFix" webp src="{{IMGURL}}equity/scrm_device_bg_new.png?v={{img_version}}" />
<view style="height:220rpx"></view>
<view class="fixed_wrapper">
<view class="btn_wrap">
<view wx:if="{{!isOpen&&memberInfo.goodPrice}}" class="btn_element btn_element_active" catchtap="openMemberFn">¥{{memberInfo.goodPrice}} 立即开通</view>
<view wx:else class="btn_element">{{ isOpen ? "已开通" : "暂不支持付费购买" }}</view>
</view>
<view class="card_desc">
<view class="desc_tip"> 开通权益代表接受</view>
<view class="desc_tip_a" catchtap="toLook"> 《权益服务协议》</view>
</view>
</view>
<view wx:if="{{openingStatus}}" class="overlay">
<view class="loading_wrapper">
<view class="new_open_loading">
<image webp class="loading_icon" src="{{IMGURL}}equity/scrm_opening_loading.png?v={{img_version}}" />
<view class="loading_title">支付成功</view>
<view class="loading_title_max">正在开卡中...</view>
<view class="loading_icon_status">
<image webp class="loading_icon_gif" webp src="{{IMGURL}}equity/loading_icon.gif?v={{img_version}}" />
</view>
</view>
</view>
</view>
</view>
<login show="{{showLogin}}"></login>
\ No newline at end of file \ No newline at end of file
.open-container-page {
box-sizing: border-box;
padding: 33rpx 0;
position: relative;
}
.top_widget {
box-sizing: border-box;
margin: 0 32rpx;
height: 250rpx;
position: relative;
}
.top_icon_bg {
height: 250rpx !important;
}
.mini_title {
position: absolute;
right: 40rpx;
top: 40rpx;
font-size: 24rpx;
color: #8b470f;
text-shadow: 0 4rpx 8rpx rgba(254, 96, 0, 0.24);
}
.card_title {
position: absolute;
left: 40rpx;
top: 36rpx;
font-size: 36rpx;
color: #8e5310;
text-shadow: 0 4rpx 8rpx rgba(254, 96, 0, 0.24);
}
.card_title_1 {
position: absolute;
left: 40rpx;
top: 102rpx;
font-size: 24rpx;
color: #8e5310;
text-shadow: 0 4rpx 8rpx rgba(254, 96, 0, 0.24);
}
.mid_bg_wrap {
height: 100%;
}
.mid_desc_bg {
box-sizing: border-box;
margin: 0 32rpx;
margin-top: 32rpx;
}
.device_icon {
margin: 60rpx 32rpx;
width: 296rpx;
height: 180rpx;
}
.fixed_wrapper {
position: fixed;
left: 0;
right: 0;
bottom: 0;
background: #ffffff;
padding-bottom: 33rpx;
}
.btn_wrap {
margin-top: 60rpx;
display: flex;
justify-content: center;
}
.btn_element {
width: calc(100% - 64rpx);
height: 70rpx;
background: #aaaaaa;
border-radius: 8rpx;
font-size: 32rpx;
color: #ffffff;
text-align: center;
line-height: 70rpx;
}
.btn_element_active {
background: #f37844;
}
.card_desc {
margin-top: 18rpx;
margin-bottom: 33rx;
display: flex;
align-items: center;
justify-content: center;
}
.desc_tip {
font-size: 28rpx;
color: #333;
}
.desc_tip_a {
font-size: 28rpx;
color: #333;
text-decoration: underline;
}
.overlay {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, .7);
z-index: 999;
}
.loading_wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.new_open_loading {
width: 444rpx;
height: 470rpx;
position: relative;
}
.loading_icon {
width: 444rpx;
height: 406rpx;
}
.loading_title {
position: absolute;
left: 50%;
top: 112rpx;
transform: translate(-50%, 0);
font-size: 28rpx;
color: #ffffff;
}
.loading_title_max {
position: absolute;
left: 50%;
top: 154rpx;
transform: translate(-50%, 0);
font-size: 36rpx;
color: #ffffff;
}
.loading_icon_status {
position: absolute;
left: 50%;
top: 226rpx;
transform: translate(-50%, 0);
width: 160rpx;
height: 160rpx;
display: flex;
align-items: center;
justify-content: center;
}
.loading_icon_gif {
width: 80rpx;
height: 80rpx;
}
\ No newline at end of file \ No newline at end of file
import USERAPI from '~/api/usersApi/index' import USERAPI from "~/api/usersApi/index";
import Util from "~/utils/util";
Page({ Page({
data: { data: {
strategyDetailObj: {}, strategyDetailObj: {},
}, },
onLoad(options) { onLoad(options) {
this.data.enter_time =new Date().format('yyyy-MM-dd hh:mm:ss')
this.firstEnter = true
this.getStrategyDetail(options.id); this.getStrategyDetail(options.id);
// 触发埋点 // 触发埋点
this.heartbeatFn({ this.heartbeatFn({
...@@ -13,12 +16,27 @@ Page({ ...@@ -13,12 +16,27 @@ Page({
view: 1 view: 1
}) })
}, },
onRoute: function (options) {
console.log(options, "000000");
this.data.enter_time =new Date().format('yyyy-MM-dd hh:mm:ss')
this.firstEnter = true
this.getStrategyDetail(options.id);
// 触发埋点
this.heartbeatFn({
id: options.id,
item_type: 6,
view: 1,
});
},
getStrategyDetail(id) { getStrategyDetail(id) {
wx.p.api.strategyApi wx.p.api.strategyApi
.getStrategyDetail({ .getStrategyDetail({
id, id,
}) })
.then((res) => { .then((res) => {
Util.setNavigationBarTitle(res.strategyName);
this.setData({ this.setData({
strategyDetailObj: res, strategyDetailObj: res,
}); });
...@@ -32,86 +50,73 @@ Page({ ...@@ -32,86 +50,73 @@ Page({
* view 动作类型 1浏览 4分享 5离开页面 6心跳 * view 动作类型 1浏览 4分享 5离开页面 6心跳
* */ * */
async addTrack(query) { async addTrack(query) {
const { const { id, item_type, view } = query;
id,
item_type,
view
} = query
const userInfo = wx.p.cache.userInfo.getUserInfo() || {}, const userInfo = wx.p.cache.userInfo.getUserInfo() || {},
{ { openId } = await USERAPI.getWXUserInfo();
openId console.log(wx.$merchant_id, "=======");
} = await USERAPI.getWXUserInfo()
let data = { let data = {
open_id: openId || null, open_id: openId || null,
create_time: this.firstEnter ? this.data.enter_time : new Date().format('yyyy-MM-dd hh:mm:ss'), // 离开时间 create_time: this.firstEnter
? this.data.enter_time
: new Date().format("yyyy-MM-dd hh:mm:ss"), // 离开时间
enter_time: this.data.enter_time, // 进入时间 enter_time: this.data.enter_time, // 进入时间
item_type, item_type,
customer_phone: userInfo.phone || null, customer_phone: userInfo.phone || null,
action_type: view, action_type: view,
staff_uuid: wx.p.storage.get('scrm_shopmall_staff_uuid'),
item_id: id, item_id: id,
business_type: 1, business_type: 1,
add_way: 104, add_way: 104,
merchant_id: wx.p.storage.get('srcm_shopmall_merchant_id'), merchant_id: wx.$merchant_id,
guest_no: wx.p.$Track.getGuestNo(), //游客ID, guest_no: wx.p.$Track.getGuestNo(), //游客ID,
user_open_id:this.shareOpenId || '' user_open_id: this.shareOpenId || "",
} };
this.firstEnter = false this.firstEnter = false;
const jsonList = [JSON.stringify(data)] const jsonList = [JSON.stringify(data)];
const res = await wx.p.api.shopmallApi.trackHttp({ const res = await wx.p.api.shopmallApi.trackHttp({
jsonList jsonList,
}) });
}, },
heartbeatFn(query) { heartbeatFn(query) {
this.trackQuery = query this.trackQuery = query;
this.addTrack(query) this.addTrack(query);
this.timer = setInterval(() => { this.timer = setInterval(() => {
this.trackQuery.view = 6 this.trackQuery.view = 6;
this.addTrack(this.trackQuery) this.addTrack(this.trackQuery);
}, 60 * 1e3) }, 60 * 1e3);
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload: function () { onUnload: function () {
if (this.timer) clearInterval(this.timer) if (this.timer) clearInterval(this.timer);
this.trackQuery.view = 5 this.trackQuery.view = 5;
this.addTrack(this.trackQuery) this.addTrack(this.trackQuery);
wx.$util.customerbehavior(2) // wx.$util.customerbehavior(2);
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () { onShareAppMessage: function () {
const merchantId = wx.p.storage.get('srcm_shopmall_merchant_id') const merchantId = wx.$merchant_id;
const userInfo = wx.p.cache.userInfo.getUserInfo() const userInfo = wx.p.cache.userInfo.getUserInfo();
let { let { strategyDetailObj } = this.data,
isActivity, open_id = "";
isLive, console.log(strategyDetailObj, '9999999999');
goodsInfo this.trackQuery.view = 4;
} = this.data,open_id = '' this.addTrack(this.trackQuery);
this.trackQuery.view = 4 if (userInfo) open_id = userInfo.openId;
this.addTrack(this.trackQuery) let title = strategyDetailObj.strategyName;
if(userInfo)open_id = userInfo.openId let path = `${this.route}?id=${strategyDetailObj.id}&openId=${open_id}`;
let title = goodsInfo.goodsName let imageUrl = strategyDetailObj.strategyImg;
let path = `${this.route}?id=${goodsInfo.id}&openId=${open_id}` if (merchantId) path = `${path}&merchantId=${merchantId}`;
let imageUrl = '' console.log(path);
goodsInfo.goodsDetailImageList.map(e => { console.log(imageUrl, title);
if (e.resType == 1 && !imageUrl) imageUrl = e.content
})
if (isActivity) {
title = goodsInfo.activityName
path = `${path}&isActivity=true`
}
if (isLive) path = `${path}&isLive=true`
if (merchantId) path = `${path}&merchantId=${merchantId}&isUpgrade=${this.isUpgrade || false}&isCarOwner=${this.isCarOwner || false}`
return { return {
imageUrl, imageUrl,
title, title,
path path,
} };
}, },
}); });
...@@ -6,5 +6,32 @@ Component({ ...@@ -6,5 +6,32 @@ Component({
value: [] value: []
} }
}, },
methods: {} methods: {
toNewPage(e) {
const { item } = e.currentTarget.dataset
let url = ''
if (item.supplier == 'GL_ROAD_RESCUE') {
url = '/packageEquity/pages/road/index/index'
} else if (item.appearance == 1) {
let para = {
supplier: item.supplier,
brandName: item.brandName,
location: true
}
const temp = JSON.stringify(para)
url = '/packageSaveMoney/pages/detail/detail?param=' + temp
} else if (item.appearance == 2) {
let para = {
supplier: item.supplier,
brandName: item.brandName,
icon: item.equityIcon
}
const temp = JSON.stringify(para)
url = '/packageSaveMoney/pages/chargeDetail/chargeDetail?param=' + temp
}
wx.navigateTo({
url
})
}
}
}) })
\ No newline at end of file \ No newline at end of file
<view class="menu-box"> <view class="menu-box">
<view class="menu-item-box" wx:for="{{menuList}}" wx:key="index"> <view class="menu-item-box" wx:for="{{menuList}}" wx:key="index">
<view class="menu-item"> <view bind:tap="toNewPage" data-item="{{item}}" class="menu-item">
<glsx-image webp src="home/menu_icon/{{item.iconUrl}}" class="menu-item-icon"></glsx-image> <glsx-image webp src="{{item.icon}}" class="menu-item-icon"></glsx-image>
<view class="menu-item-text"> <view class="menu-item-text">{{item.name}}</view>
{{item.name}} <view wx:if="{{item.sign}}" class="ranle_sing">{{item.sign}}</view>
</view>
</view> </view>
</view> </view>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -5,29 +5,49 @@ ...@@ -5,29 +5,49 @@
flex-wrap: wrap; flex-wrap: wrap;
/* justify-content: space-around; */ /* justify-content: space-around; */
padding: 30rpx 16rpx; padding: 30rpx 16rpx;
} }
.menu-item-box { .menu-item-box {
width: 128rpx; width: 128rpx;
height: 116rpx; height: 116rpx;
text-align: center; text-align: center;
margin-right: 4rpx; margin-right: 4rpx;
} }
.menu-item-box:nth-child(4n) { .menu-item-box:nth-child(5n) {
margin-right: 0; margin-right: 0;
} }
.menu-item-icon { .menu-item-box:nth-child(n + 6) {
margin-top: 32rpx;
}
.menu-item-icon {
width: 72rpx; width: 72rpx;
height: 72rpx; height: 72rpx;
} }
.menu-item-text { .menu-item-text {
font-weight: 400; font-weight: 400;
font-size: 24rpx; font-size: 24rpx;
color: #282829; color: #282829;
text-align: center; text-align: center;
margin-top: 12rpx; margin-top: 12rpx;
} }
.menu-item {
position: relative;
}
.menu-item .ranle_sing {
position: absolute;
left: 58rpx;
top: -8rpx;
display: inline-block;
white-space: nowrap;
padding: 2rpx 10rpx;
background: #f5222d;
border-radius: 16rpx;
font-weight: 400;
font-size: 20rpx;
color: #f9fafb;
}
import {
foodMenuList, import { env } from '~/api/env/index'
funMenuList,
carMenuList
} from './constant/constant'
Page({ Page({
data: { data: {
foodMenuList, foodMenuList: [],
funMenuList, funMenuList: [],
carMenuList, carMenuList: [],
commodityList: [], commodityList: [],
pageParam: { pageParam: {
appearance: 1, appearance: 1,
...@@ -26,7 +23,7 @@ Page({ ...@@ -26,7 +23,7 @@ Page({
onLoad() { onLoad() {
this.getAllMerchantList()
}, },
onShow() { onShow() {
...@@ -135,4 +132,98 @@ Page({ ...@@ -135,4 +132,98 @@ Page({
} }
) )
}, },
getAllMerchantList() {
let merchantId = wx.$merchant_id
let para = {
merchantId
}
wx.p.api.equityApi.getAllEquity(para).then(res => {
const carList = res.carServiceList
const equityList = res.goodsServiceList
let foodMenuList = [], funMenuList = [], carMenuList = []
const needShowEquity = ['星巴克', '瑞幸咖啡', '奈雪の茶', '麦当劳', '肯德基']
const needShowEquity2 = ['猫眼电影', '爱奇艺', '优酷', '网易云音乐', '喜马拉雅']
const needShowEquity3 = ['高德打车', '曹操出行']
if (env == 'production') {
let all = []
equityList.forEach(el => {
if (el.equityGoodsGroupDescDtos) {
el.equityGoodsGroupDescDtos.forEach(item => {
all.push(item)
})
}
})
all.forEach(item => {
if (needShowEquity.includes(item.equityName)) {
if (item.equityName == '瑞幸咖啡') {
item.sign = '9.9元起'
} else if (item.equityName == '麦当劳') {
item.sign = '新品'
}
foodMenuList.push({
name: item.equityName,
icon: item.equityIcon,
...item
})
}
if (needShowEquity2.includes(item.equityName)) {
if (item.equityName == '猫眼电影') {
item.sign = '19元起'
}
funMenuList.push({
name: item.equityName,
icon: item.equityIcon,
...item
})
}
if (needShowEquity3.includes(item.equityName)) {
if (item.equityName == '高德打车') {
item.sign = '10元券'
}
carMenuList.push({
name: item.equityName,
icon: item.equityIcon,
...item
})
}
})
} else if (env == 'test') {
let all = []
equityList.forEach(el => {
if (el.equityGoodsGroupDescDtos) {
el.equityGoodsGroupDescDtos.forEach(item => {
all.push(item)
})
}
})
all.forEach(item => {
foodMenuList.push({
name: item.equityName,
icon: item.equityIcon,
...item
})
funMenuList.push({
name: item.equityName,
icon: item.equityIcon,
...item
})
carMenuList.push({
name: item.equityName,
icon: item.equityIcon,
...item
})
})
}
this.setData({
foodMenuList,
funMenuList,
carMenuList
})
})
},
toPluginPage() {
wx.p.router.go('/packagePlugin/pages/index/index', { notIntercept: true })
}
}) })
\ No newline at end of file \ No newline at end of file
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<glsx-image webp src="home/homelife_bg.png" class="save-money-img"></glsx-image> <glsx-image webp src="home/homelife_bg.png" class="save-money-img"></glsx-image>
<view class="save-money-order-box"> <view class="save-money-order-box">
<glsx-image webp src="savemoney/save_order.png" class="save-money-order-img"></glsx-image> <glsx-image webp src="savemoney/save_order.png" class="save-money-order-img"></glsx-image>
<view class="save-money-order-text-box">去下单</view> <view bind:tap="toPluginPage" class="save-money-order-text-box">去下单</view>
</view> </view>
<view class="title-box flex"> <view class="title-box flex">
<main-title title="吃喝省"></main-title> <main-title title="吃喝省"></main-title>
......
...@@ -51,7 +51,6 @@ class Storage { ...@@ -51,7 +51,6 @@ class Storage {
* @param {*} syncFlag | 同步状态,默认 false (异步),true 为同步 * @param {*} syncFlag | 同步状态,默认 false (异步),true 为同步
*/ */
get = (key, syncFlag = true) => { get = (key, syncFlag = true) => {
// console.log(key, '====');
// 有值默认取key值 // 有值默认取key值
if (key) { if (key) {
// 判断值是否是指定的对象值 // 判断值是否是指定的对象值
......
...@@ -107,12 +107,39 @@ const promise = callBack => { ...@@ -107,12 +107,39 @@ const promise = callBack => {
}) })
} }
//设置标题
const setNavigationBarTitle = (title) =>{
wx.getSystemInfo({
success: (res) => {
let width = res.safeArea.width / res.fontSizeSetting;
let space = '';
width = width-(title.length)/2
for (let i = 0; i < width; i++) {
space = space + ' ';
}
if (res.system.includes('iOS') === false) {
wx.setNavigationBarTitle({
title: space + title
});
} else {
wx.setNavigationBarTitle({
title: title
});
}
}
});
}
const Util = { const Util = {
onReachBottom, onReachBottom,
clearObjNull, clearObjNull,
throttle, throttle,
isEmptyObj, isEmptyObj,
parseString, parseString,
promise promise,
setNavigationBarTitle
} }
export default Util export default Util
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!