Commit 7bd32fc2 by 前端

Merge branch 'scrm-v3.15.0' into 'master'

合并Scrm v3.15.0

See merge request !2
2 parents 85fd6264 e54bc7f8
Showing 95 changed files with 1375 additions and 1304 deletions
...@@ -180,4 +180,19 @@ module.exports = { ...@@ -180,4 +180,19 @@ module.exports = {
...data ...data
}) })
}, },
/** 获取活动分享链接 */
getActivitylink(id) {
return api.post({
method: 'scrm.api.shopmall.activity.get.shared',
id
})
},
/** 获取商品分享链接 */
getGoodslink(id) {
return api.post({
method: 'scrm.api.shopmall.goods.get.shared',
id
})
},
} }
\ No newline at end of file \ No newline at end of file
...@@ -58,7 +58,7 @@ class Request { ...@@ -58,7 +58,7 @@ class Request {
merchantId merchantId
} = wx.p.storage.get('merchant_info') } = wx.p.storage.get('merchant_info')
header.merchantId = wx.$merchant_id || merchantId || defaultMerchantId header.merchantId = wx.$merchant_id || merchantId || defaultMerchantId
let projectName = this.getRopProject(params.method) let projectName = params.projectName
if (!projectName) projectName = this.getRopProject(params.method) if (!projectName) projectName = this.getRopProject(params.method)
const path = pathEnum[projectName] const path = pathEnum[projectName]
params = this.getData(params) params = this.getData(params)
......
...@@ -22,8 +22,7 @@ ...@@ -22,8 +22,7 @@
"selectedColor": "#8A303A", "selectedColor": "#8A303A",
"backgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF",
"borderStyle": "white", "borderStyle": "white",
"list": [ "list": [{
{
"pagePath": "pages/tab/index/index", "pagePath": "pages/tab/index/index",
"text": "首页", "text": "首页",
"iconPath": "assets/images/home.png", "iconPath": "assets/images/home.png",
...@@ -49,11 +48,9 @@ ...@@ -49,11 +48,9 @@
} }
] ]
}, },
"subpackages": [ "subpackages": [{
{
"root": "packageIndex", "root": "packageIndex",
"pages": [ "pages": [
"pages/index/index",
"pages/bannerJumpPage/bannerJumpPage", "pages/bannerJumpPage/bannerJumpPage",
"pages/common/contact/contact", "pages/common/contact/contact",
"pages/serviceCode/serviceCode" "pages/serviceCode/serviceCode"
...@@ -62,7 +59,6 @@ ...@@ -62,7 +59,6 @@
{ {
"root": "packageEquity", "root": "packageEquity",
"pages": [ "pages": [
"pages/index/index",
"pages/package/package", "pages/package/package",
"pages/directional/directional", "pages/directional/directional",
"pages/open/open", "pages/open/open",
...@@ -84,7 +80,6 @@ ...@@ -84,7 +80,6 @@
{ {
"root": "packageMall", "root": "packageMall",
"pages": [ "pages": [
"pages/index/index",
"pages/shoppingCart/shoppingCart", "pages/shoppingCart/shoppingCart",
"pages/pay/pay", "pages/pay/pay",
"pages/detail/detail", "pages/detail/detail",
...@@ -95,7 +90,6 @@ ...@@ -95,7 +90,6 @@
{ {
"root": "packageMine", "root": "packageMine",
"pages": [ "pages": [
"pages/index/index",
"pages/setting/index", "pages/setting/index",
"pages/address/index/index", "pages/address/index/index",
"pages/address/detail/detail", "pages/address/detail/detail",
...@@ -132,5 +126,10 @@ ...@@ -132,5 +126,10 @@
"desc": "你的位置信息将用于小程序位置接口的效果展示" "desc": "你的位置信息将用于小程序位置接口的效果展示"
} }
}, },
"plugins": {} "plugins": {
"authorization-plugin": {
"version": "1.0.2",
"provider": "wxe10067a63c1856ac"
}
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -122,3 +122,20 @@ ...@@ -122,3 +122,20 @@
opacity: 1; opacity: 1;
} }
} }
@keyframes show-box-inset{
0% {
opacity: 0;
transform: scale(.1);
}
100% {
opacity: 1;
transform: scale(1);
}
}
.safe-area {
display: block;
width: 100%;
height: 0;
opacity: 0;
}
\ No newline at end of file \ No newline at end of file
/* components/Tab/Tab.wxss */ /* components/Tab/Tab.wxss */
@import "../../assets/style/common.wxss"; @import "/assets/style/common.wxss";
.tab-box { .tab-box {
display: flex; display: flex;
......
...@@ -13,31 +13,37 @@ Component({ ...@@ -13,31 +13,37 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
toDetail(){ toDetail() {
let {chargeInfo} = this.data let {
let query = { chargeInfo
brandName:chargeInfo.brandName, } = this.data
supplier:chargeInfo.supplier, let param = {
icon:chargeInfo.icon brandName: chargeInfo.brandName,
supplier: chargeInfo.supplier,
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 notIntercept: true
}) })
}, },
toDetailPage(e){ toDetailPage(e) {
let {item} = e.currentTarget.dataset let {
let {chargeInfo} = this.data item
let query = { } = e.currentTarget.dataset
brandName:chargeInfo.brandName, let {
supplier:chargeInfo.supplier, chargeInfo
id:item.id, } = this.data
productName:item.productName, let param = {
icon:chargeInfo.icon brandName: chargeInfo.brandName,
supplier: chargeInfo.supplier,
id: item.id,
productName: item.productName,
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 notIntercept: true
}) })
} }
} }
......
...@@ -6,7 +6,7 @@ Component({ ...@@ -6,7 +6,7 @@ Component({
data: { data: {
curErrorIndex:-1, curErrorIndex: -1,
}, },
/** /**
...@@ -14,37 +14,47 @@ Component({ ...@@ -14,37 +14,47 @@ Component({
*/ */
methods: { methods: {
toDetail() { toDetail() {
const { businessInfo, address } = this.data const {
let query = { businessInfo,
address
} = this.data
let param = {
supplier: businessInfo.supplier, supplier: businessInfo.supplier,
brandName: businessInfo.brandName, brandName: businessInfo.brandName,
lat: address.location.lat, lat: address.location.lat,
lng: address.location.lng, lng: address.location.lng,
} }
const temp = JSON.stringify(query) wx.p.router.go('/packageEquity/pages/commodity/detail/detail', {
wx.navigateTo({ param,
url: '/packageEquity/pages/commodity/detail/detail?param=' + temp notIntercept: true
}) })
}, },
toDetailPage(e) { toDetailPage(e) {
const { item } = e.currentTarget.dataset const {
const { businessInfo, address } = this.data item
let query = { } = e.currentTarget.dataset
const {
businessInfo,
address
} = this.data
let param = {
supplier: businessInfo.supplier, supplier: businessInfo.supplier,
brandName: businessInfo.brandName, brandName: businessInfo.brandName,
lat: address.location.lat, lat: address.location.lat,
lng: address.location.lng, lng: address.location.lng,
id: item.id id: item.id
} }
const temp = JSON.stringify(query) wx.p.router.go('/packageEquity/pages/commodity/detail/detail', {
wx.navigateTo({ param,
url: '/packageEquity/pages/commodity/detail/detail?param=' + temp notIntercept: true
}) })
}, },
// 打开地图 // 打开地图
openMap() { openMap() {
const { businessInfo } = this.data const {
businessInfo
} = this.data
wx.openLocation({ wx.openLocation({
latitude: parseFloat(businessInfo.lat), latitude: parseFloat(businessInfo.lat),
longitude: parseFloat(businessInfo.lng), longitude: parseFloat(businessInfo.lng),
......
...@@ -16,13 +16,14 @@ Component({ ...@@ -16,13 +16,14 @@ Component({
value: '', value: '',
observer: async function (url, o) { observer: async function (url, o) {
if (url) { if (url) {
let isWebp = url.includes('webp') let isWebp = url.includes('webp'),
let checkList = ['https://', 'http://'] checkList = ['https://', 'http://'],
let isFullAdd = checkList.map(item => url.includes(item)).some(item => item) isFullAdd = checkList.map(item => url.includes(item)).some(item => item),
let isBASE64 = url.includes('data:image') isBASE64 = url.includes('data:image'),
v = await systemApi.getImageVersion()
this.setData({ this.setData({
isWebp, isWebp,
imagePath: `${isFullAdd || isBASE64 ? '' : IMG_URL}${url}` + (isBASE64 ? '' : `?v=${await systemApi.getImageVersion()}`) imagePath: `${isFullAdd || isBASE64 ? '' : IMG_URL}${url}` + (isBASE64 ? '' : `?v=${v}`)
}) })
} }
} }
......
import { iosTimeFormat } from "~/utils/format";
module.exports = Behavior({
methods: {
countDown({
timer,
hideDay,
targetObject
}) {
const {
name,
key
} = targetObject
let activityStatus = this.data[name][key] // activityStatus 1:未开始,2进行中,3已结束
const addZero = i => i < 10 ? `0${i}` : `${i}`,
[activityStartTime, activityEndTime] = timer,
start = iosTimeFormat(activityStartTime),
end = iosTimeFormat(activityEndTime)
if ((new Date().getTime() > new Date(end).getTime()) || activityStatus == 3) {
this.setData({
timeFlag: true,
finished: '活动已结束',
[`${name}.${key}`]: 3
})
return
}
if (new Date().getTime() >= new Date(start).getTime() && activityStatus != 2) {
this.setData({
[`${name}.${key}`]: 2
})
activityStatus = 2
}
let starTime = new Date(),
endTime = new Date(activityStatus == 2 ? end : start),
lefttime = parseInt((endTime.getTime() - starTime.getTime()) / 1e3),
d = parseInt(lefttime / (24 * 60 * 60)),
h = addZero(parseInt(hideDay ? lefttime / (60 * 60) : lefttime / (60 * 60) % 24)),
m = addZero(parseInt(lefttime / 60 % 60)),
s = addZero(parseInt(lefttime % 60)),
type = {
1: '距开始',
2: '距结束'
} [activityStatus]
if (this.time) {
clearTimeout(this.time)
this.time = null
}
let activityTime = {
dayList: [h, m, s],
type
}
if (d > 0) activityTime.day = `${d}天`
this.setData({
activityTime,
timeFlag: true
})
this.time = setTimeout(() => {
this.countDown({
timer,
hideDay,
targetObject
})
}, 1e3)
}
}
})
\ No newline at end of file \ No newline at end of file
import kfMixin from './kfMixin' import kfMixin from './kfMixin'
import orderMixin from './orderMixin' import orderMixin from './orderMixin'
import afterSaleMixin from './afterSaleMixin' import afterSaleMixin from './afterSaleMixin'
import countdownMixin from './countdownMixin'
module.exports = { module.exports = {
kfMixin, kfMixin,
orderMixin, orderMixin,
afterSaleMixin, afterSaleMixin,
countdownMixin
} }
...@@ -99,24 +99,25 @@ Page({ ...@@ -99,24 +99,25 @@ Page({
const { item } = e.currentTarget.dataset const { item } = e.currentTarget.dataset
let url = '' let url = ''
if (item.appearance == 1) { if (item.appearance == 1) {
let para = { let param = {
supplier: item.supplier, supplier: item.supplier,
brandName: item.brandName, brandName: item.brandName,
location: true location: true
} }
const temp = JSON.stringify(para) wx.p.router.go('/packageEquity/pages/commodity/detail/detail',{
url = '/packageEquity/pages/commodity/detail/detail?param=' + temp param,
notIntercept: true
})
} 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,
} notIntercept: true
wx.navigateTo({
url
}) })
} }
}
}) })
{ {
"usingComponents": {} "usingComponents": {},
"navigationBarTitleText": "全部服务"
} }
\ No newline at end of file \ No newline at end of file
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
</view> </view>
</view> </view>
</block> </block>
<view class="safe-area isFullSucreen"></view>
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
\ No newline at end of file \ No newline at end of file
...@@ -8,21 +8,16 @@ Page({ ...@@ -8,21 +8,16 @@ 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.navigateBack({ wx.p.router.back()
delta: 1
})
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -22,17 +22,19 @@ Page({ ...@@ -22,17 +22,19 @@ Page({
if (loadOver) { if (loadOver) {
return return
} }
wx.p.wxApi.showLoading()
wx.p.api.equityApi.lasteCommodity(pageParam).then(res => { wx.p.api.equityApi.lasteCommodity(pageParam).then(res => {
if (!res) { if (!res) {
this.setData({ this.setData({
loadOver: true loadOver: true
}) })
wx.hideLoading()
return return
} }
let tempArr = [] let tempArr = []
res.map(item => { res.map(item => {
let newArr = [] let newArr = []
if (item.chargeGoddsList) { if (item && item.chargeGoddsList) {
item.chargeGoddsList.forEach(ele => { item.chargeGoddsList.forEach(ele => {
ele.denominationList.forEach(info => { ele.denominationList.forEach(info => {
let tempObj = { let tempObj = {
...@@ -58,6 +60,7 @@ Page({ ...@@ -58,6 +60,7 @@ Page({
loadingMore: false, loadingMore: false,
loadOver: false loadOver: false
}) })
wx.hideLoading()
}) })
}, },
......
<view class="charge-container-page"> <view class="charge-container-page isFullSucreen">
<block wx:for="{{commodityList}}" wx:key="index"> <block wx:for="{{commodityList}}" wx:key="index">
<commodityItem chargeInfo="{{item}}"/> <commodityItem chargeInfo="{{item}}"/>
</block> </block>
......
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,39 +154,36 @@ Page({ ...@@ -128,39 +154,36 @@ 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()
}, },
toRecharge() { async toRecharge() {
const isLogin = this.checkLogin() const loginStatus = await wx.p.router.intercept()
if (!isLogin) { if (loginStatus) return
return
}
if (!this.data.rechageNum) { if (!this.data.rechageNum) {
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 +213,12 @@ Page({ ...@@ -190,7 +213,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 +227,7 @@ Page({ ...@@ -199,7 +227,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 +237,13 @@ Page({ ...@@ -209,7 +237,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 +253,17 @@ Page({ ...@@ -219,15 +253,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 +276,8 @@ Page({ ...@@ -240,8 +276,8 @@ Page({
}) })
}, },
onLoad(options) { onLoad(options) {
const query = options ? JSON.parse(decodeURIComponent(options.param)) : this.data.query const query = options.param
this.getChargeDetail(query,options) 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 +287,14 @@ Page({ ...@@ -251,12 +287,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 +305,7 @@ Page({ ...@@ -267,7 +305,7 @@ Page({
flag = false flag = false
this.setData({ this.setData({
showLogin: true, showLogin: true,
showComponent:false showComponent: false
}) })
} }
return flag return flag
......
...@@ -4,7 +4,8 @@ page{ ...@@ -4,7 +4,8 @@ page{
background: white; background: white;
} }
.detail_container{ .detail_container{
padding-bottom: 100rpx; padding-bottom: calc(120rpx + var(--constantSafeAreaInsetBottom));
padding-bottom: calc(120rpx + var(--envSafeAreaInsetBottom));
} }
.account_area { .account_area {
...@@ -71,7 +72,7 @@ page{ ...@@ -71,7 +72,7 @@ page{
.member_type_item { .member_type_item {
height: 80rpx; height: 80rpx;
width: 188rpx; min-width: 188rpx;
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
...@@ -79,6 +80,7 @@ page{ ...@@ -79,6 +80,7 @@ page{
font-size: 28rpx; font-size: 28rpx;
color: #B1B1B3; color: #B1B1B3;
background-color: #F2F2F2; background-color: #F2F2F2;
padding: 0 20rpx;
} }
.activeNav{ .activeNav{
...@@ -219,8 +221,8 @@ page{ ...@@ -219,8 +221,8 @@ page{
box-sizing: border-box; box-sizing: border-box;
background-color: #fff; background-color: #fff;
/* padding: 10rpx 30rpx; */ /* padding: 10rpx 30rpx; */
padding: 0 32rpx 0 90rpx; padding: 20rpx 32rpx 20rpx 90rpx;
height: 100rpx; min-height: 100rpx;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
......
import { decimal } from '~/utils/format' import {
decimal
} from '~/utils/format'
import mapApi from '../../../../utils/mapapi/mapapi' import mapApi from '../../../../utils/mapapi/mapapi'
Page({ Page({
data: { data: {
...@@ -10,18 +12,17 @@ Page({ ...@@ -10,18 +12,17 @@ Page({
currentIndex: 0, currentIndex: 0,
richText: '', richText: '',
showModal: false, showModal: false,
noScroll: wx.p.wxApi.noScroll(), isGameUse: false,
isGameUse:false, coupons: null,
coupons:null, showCoupons: false,
showCoupons:false, showComponent: false
showComponent:false
}, },
noScroll() {},
onShow: function () { onShow: function () {
this.toCheckMember() this.toCheckMember()
}, },
onLoad: function (options) { onLoad: function (options) {
options = JSON.stringify(options)==='{}'?this.options:options const query = options.param
const query = options ? JSON.parse(decodeURIComponent(options.param)) : this.data.query
this.setNaviTitle(query.brandName) this.setNaviTitle(query.brandName)
if (!query.lat) { if (!query.lat) {
const tem = wx.p.storage.get('address_info') const tem = wx.p.storage.get('address_info')
...@@ -38,7 +39,7 @@ Page({ ...@@ -38,7 +39,7 @@ Page({
// return // return
// } // }
wx.p.wxApi.showLoading() wx.p.wxApi.showLoading()
this.toGetCommodity(query,options) this.toGetCommodity(query, options)
this.setData({ this.setData({
// unauthorized, // unauthorized,
showLogin: false, showLogin: false,
...@@ -49,22 +50,26 @@ Page({ ...@@ -49,22 +50,26 @@ Page({
}) })
}, },
// 处理广汇权益明细进入的卡券 // 处理广汇权益明细进入的卡券
handleEquityOfGH(couponsItem){ handleEquityOfGH(couponsItem) {
let {curentGoodsItem} = this.data let {
curentGoodsItem.payCouponsPrice = decimal(curentGoodsItem.lineationPrice-(Number(couponsItem.denomination)), 2) curentGoodsItem
} = this.data
curentGoodsItem.payCouponsPrice = decimal(curentGoodsItem.lineationPrice - (Number(couponsItem.denomination)), 2)
this.setData({ this.setData({
curentGoodsItem, curentGoodsItem,
coupons:couponsItem coupons: couponsItem
}) })
}, },
// 获取当前商品绑定的优惠券并且处理价格 // 获取当前商品绑定的优惠券并且处理价格
getCouponsItem(e){ getCouponsItem(e) {
const couponsItem = e.detail const couponsItem = e.detail
let {curentGoodsItem} = this.data let {
curentGoodsItem.payCouponsPrice = decimal(curentGoodsItem.lineationPrice-(Number(couponsItem.denomination)), 2) curentGoodsItem
} = this.data
curentGoodsItem.payCouponsPrice = decimal(curentGoodsItem.lineationPrice - (Number(couponsItem.denomination)), 2)
this.setData({ this.setData({
curentGoodsItem, curentGoodsItem,
coupons:couponsItem coupons: couponsItem
}) })
}, },
// 选择优惠券 // 选择优惠券
...@@ -80,7 +85,10 @@ Page({ ...@@ -80,7 +85,10 @@ Page({
// }, // },
// 选择商品 // 选择商品
selectGoodsItem(e) { selectGoodsItem(e) {
const { index, item } = e.currentTarget.dataset const {
index,
item
} = e.currentTarget.dataset
let richText = '' let richText = ''
if (item.buysNotes) { if (item.buysNotes) {
richText = decodeURIComponent(item.buysNotes) richText = decodeURIComponent(item.buysNotes)
...@@ -97,7 +105,7 @@ Page({ ...@@ -97,7 +105,7 @@ Page({
}, },
// 查询会员开通情况 // 查询会员开通情况
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
...@@ -114,10 +122,17 @@ Page({ ...@@ -114,10 +122,17 @@ Page({
}) })
}, },
// 获取商品信息 // 获取商品信息
toGetCommodity(query,options) { toGetCommodity(query, options) {
let { curentGoodsItem, currentIndex,isGameUse,coupons } = this.data let {
let tem = {...query} curentGoodsItem,
if(tem.id&&!isGameUse){ currentIndex,
isGameUse,
coupons
} = this.data
let tem = {
...query
}
if (tem.id && !isGameUse) {
delete tem.id delete tem.id
} }
wx.p.api.equityApi.commodityMsg(tem).then(res => { wx.p.api.equityApi.commodityMsg(tem).then(res => {
...@@ -147,11 +162,11 @@ Page({ ...@@ -147,11 +162,11 @@ Page({
richText = richText.replace(/\<span/g, '<span class="rich_text"') richText = richText.replace(/\<span/g, '<span class="rich_text"')
richText = richText.replace(/\<a/g, '<a class="rich_text_a"') richText = richText.replace(/\<a/g, '<a class="rich_text_a"')
} }
if(isGameUse){ if (isGameUse) {
curentGoodsItem.payCouponsPrice = curentGoodsItem.lineationPrice curentGoodsItem.payCouponsPrice = curentGoodsItem.lineationPrice
} }
if(this.data.isGameUse){ if (this.data.isGameUse) {
tempList = tempList.filter(item=>item.id===query.id) tempList = tempList.filter(item => item.id === query.id)
currentIndex = 0 currentIndex = 0
} }
this.setData({ this.setData({
...@@ -162,16 +177,14 @@ Page({ ...@@ -162,16 +177,14 @@ Page({
query, query,
currentIndex, currentIndex,
to: `to-${currentIndex}`, to: `to-${currentIndex}`,
showComponent:true, showComponent: true,
showLogin: false showLogin: false
}) })
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
} }
this.toGetCommodityStock(query.id || tempList[0].id) this.toGetCommodityStock(query.id || tempList[0].id)
...@@ -184,7 +197,10 @@ Page({ ...@@ -184,7 +197,10 @@ Page({
} }
wx.hideLoading() wx.hideLoading()
wx.p.api.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) {
flag = true flag = true
...@@ -197,22 +213,25 @@ Page({ ...@@ -197,22 +213,25 @@ Page({
}) })
}, },
toMemberPage() { toMemberPage() {
wx.navigateTo({ wx.p.router.go('/packageEquity/pages/open/open?page=business')
url: '/packageEquity/pages/open/open?page=business'
})
}, },
// 去购买 // 去购买
toBuyItem() { async toBuyItem() {
const isLogin = this.checkLogin() const loginStatus = await wx.p.router.intercept()
if (!isLogin) { if (loginStatus) return
return const {
} curentGoodsItem,
const { curentGoodsItem, isHaveInventory,isGameUse } = this.data isHaveInventory,
isGameUse
} = this.data
if (!isHaveInventory) { if (!isHaveInventory) {
return return
} }
if(isGameUse)return this.comfirmBuyItem() if (isGameUse) return this.comfirmBuyItem()
const { noMemberPrice, salesPrice } = curentGoodsItem const {
noMemberPrice,
salesPrice
} = curentGoodsItem
let diffPrice = 0 let diffPrice = 0
if (noMemberPrice) { if (noMemberPrice) {
diffPrice = decimal(noMemberPrice - salesPrice, 2) diffPrice = decimal(noMemberPrice - salesPrice, 2)
...@@ -223,7 +242,7 @@ Page({ ...@@ -223,7 +242,7 @@ Page({
}) })
}, },
// 确定购买 // 确定购买
comfirmBuyItem() { async comfirmBuyItem() {
wx.p.wxApi.showLoading() wx.p.wxApi.showLoading()
this.toGetCode() this.toGetCode()
this.modalOnCancel() this.modalOnCancel()
...@@ -242,7 +261,11 @@ Page({ ...@@ -242,7 +261,11 @@ Page({
if (!orderCode) { if (!orderCode) {
return return
} }
const { curentGoodsItem,coupons,isGameUse } = this.data const {
curentGoodsItem,
coupons,
isGameUse
} = this.data
let para = { let para = {
orderCode, orderCode,
goodsId: curentGoodsItem.id, goodsId: curentGoodsItem.id,
...@@ -250,7 +273,7 @@ Page({ ...@@ -250,7 +273,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 => {
...@@ -260,7 +283,13 @@ Page({ ...@@ -260,7 +283,13 @@ Page({
}, },
// 处理支付 // 处理支付
handlePay(payData, orderCode) { handlePay(payData, orderCode) {
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,
...@@ -270,9 +299,7 @@ Page({ ...@@ -270,9 +299,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() {}
}) })
...@@ -283,9 +310,7 @@ Page({ ...@@ -283,9 +310,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({
...@@ -299,7 +324,9 @@ Page({ ...@@ -299,7 +324,9 @@ Page({
}, },
// /**获取当前位置 */ // /**获取当前位置 */
getLocation(query) { getLocation(query) {
this.getAddressInfo().then(({ location }) => { this.getAddressInfo().then(({
location
}) => {
query.lat = location.lat query.lat = location.lat
query.lng = location.lng query.lng = location.lng
this.toGetCommodity(query) this.toGetCommodity(query)
...@@ -310,7 +337,9 @@ Page({ ...@@ -310,7 +337,9 @@ Page({
}, },
// 重新收起获取定位 // 重新收起获取定位
relocation() { relocation() {
const { query } = this.data const {
query
} = this.data
const tem = wx.p.storage.get('address_info') const tem = wx.p.storage.get('address_info')
query.lat = tem ? tem.location.lat : '' query.lat = tem ? tem.location.lat : ''
query.lng = tem ? tem.location.lng : '' query.lng = tem ? tem.location.lng : ''
...@@ -321,7 +350,9 @@ Page({ ...@@ -321,7 +350,9 @@ Page({
return return
} }
this.toGetCommodity(query) this.toGetCommodity(query)
this.setData({ query }) this.setData({
query
})
}, },
/**授权失败 */ /**授权失败 */
authFail() { authFail() {
...@@ -335,7 +366,9 @@ Page({ ...@@ -335,7 +366,9 @@ Page({
}, },
// 打开地图 // 打开地图
openMap() { openMap() {
const { addressInfo } = this.data const {
addressInfo
} = this.data
if (!addressInfo || !addressInfo.latitude) { if (!addressInfo || !addressInfo.latitude) {
this.relocation() this.relocation()
return return
...@@ -352,19 +385,6 @@ Page({ ...@@ -352,19 +385,6 @@ Page({
title title
}) })
}, },
// 检测是否已经登录
checkLogin() {
const sessionId = wx.p.storage.get('sessionId')
let flag = true
if (!sessionId) {
flag = false
this.setData({
showLogin: true,
showComponent:false
})
}
return flag
},
// 获取a标签链接 // 获取a标签链接
getALabel(str) { getALabel(str) {
let reg = /(http:\/\/|https:\/\/)((\w|=|\?|\.|\/|&|-)+)/g let reg = /(http:\/\/|https:\/\/)((\w|=|\?|\.|\/|&|-)+)/g
...@@ -378,10 +398,8 @@ Page({ ...@@ -378,10 +398,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) {
...@@ -395,7 +413,10 @@ Page({ ...@@ -395,7 +413,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,
......
page { page {
background: white; background: white;
} }
.commodity-detail-container{
.goods_scroll_wrapper { padding-bottom: calc(120rpx + var(--constantSafeAreaInsetBottom));
padding-bottom: calc(120rpx + var(--envSafeAreaInsetBottom));
}
.goods_scroll_wrapper {
padding: 46rpx 0 40rpx 40rpx; padding: 46rpx 0 40rpx 40rpx;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
} }
.scroll_element { .scroll_element {
width: 288rpx; width: 288rpx;
height: 380rpx; height: 380rpx;
border-radius: 16rpx; border-radius: 16rpx;
...@@ -19,27 +22,27 @@ page { ...@@ -19,27 +22,27 @@ page {
display: inline-block; display: inline-block;
position: relative; position: relative;
vertical-align: top; vertical-align: top;
} }
.image_icon_wrapper { .image_icon_wrapper {
position: relative; position: relative;
} }
.image_icon { .image_icon {
width: 288rpx; width: 288rpx;
height: 178rpx; height: 178rpx;
border-radius: 16rpx 16rpx 0 0; border-radius: 16rpx 16rpx 0 0;
} }
.image_vip { .image_vip {
position: absolute; position: absolute;
right: 0rpx; right: 0rpx;
top: 0rpx; top: 0rpx;
width: 120rpx; width: 120rpx;
height: 28rpx; height: 28rpx;
} }
.vip_text { .vip_text {
position: absolute; position: absolute;
right: 16rpx; right: 16rpx;
top: 0rpx; top: 0rpx;
...@@ -47,9 +50,9 @@ page { ...@@ -47,9 +50,9 @@ page {
font-size: 20rpx; font-size: 20rpx;
font-weight: 500; font-weight: 500;
color: #FFFFFF; color: #FFFFFF;
} }
.element_title { .element_title {
box-sizing: border-box; box-sizing: border-box;
padding: 18rpx 14rpx 0 18rpx; padding: 18rpx 14rpx 0 18rpx;
min-height: 88rpx; min-height: 88rpx;
...@@ -65,9 +68,9 @@ page { ...@@ -65,9 +68,9 @@ page {
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
line-clamp: 2; line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.element_sale_price { .element_sale_price {
box-sizing: border-box; box-sizing: border-box;
padding: 10rpx 0 0 18rpx; padding: 10rpx 0 0 18rpx;
display: flex; display: flex;
...@@ -76,16 +79,16 @@ page { ...@@ -76,16 +79,16 @@ page {
color: #999999; color: #999999;
line-height: 56rpx; line-height: 56rpx;
/* align-items: flex-end; */ /* align-items: flex-end; */
} }
.price_min_icon { .price_min_icon {
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
line-height: 60rpx; line-height: 60rpx;
margin-right: 6rpx; margin-right: 6rpx;
} }
.element_o_price { .element_o_price {
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
line-height: 34rpx; line-height: 34rpx;
...@@ -96,29 +99,29 @@ page { ...@@ -96,29 +99,29 @@ page {
position: absolute; position: absolute;
left: 18rpx; left: 18rpx;
bottom: 4rpx; bottom: 4rpx;
} }
.scroll_element_active { .scroll_element_active {
box-shadow: 0px 4rpx 8rpx 0px #ffebe6; box-shadow: 0px 4rpx 8rpx 0px #ffebe6;
border: 2rpx solid #8A303A; border: 2rpx solid #8A303A;
} }
.selected { .selected {
color: #8A303A; color: #8A303A;
} }
.selected1 { .selected1 {
color: #282829; color: #282829;
font-size: 500; font-size: 500;
} }
.flex_cc { .flex_cc {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.more_btn { .more_btn {
width: 80rpx; width: 80rpx;
height: 348rpx; height: 348rpx;
background: rgba(228, 228, 228, 0.95); background: rgba(228, 228, 228, 0.95);
...@@ -131,45 +134,46 @@ page { ...@@ -131,45 +134,46 @@ page {
color: #666666; color: #666666;
line-height: 40rpx; line-height: 40rpx;
flex-direction: column; flex-direction: column;
} }
.roate { .roate {
width: 0; width: 0;
height: 0; height: 0;
border-right: 10rpx solid transparent; border-right: 10rpx solid transparent;
border-left: 10rpx solid transparent; border-left: 10rpx solid transparent;
border-top: 10rpx solid #666666; border-top: 10rpx solid #666666;
margin-top: 20rpx; margin-top: 20rpx;
} }
.goods_desc_wrapper { .goods_desc_wrapper {
box-sizing: border-box; box-sizing: border-box;
padding: 0 40rpx; padding: 0 40rpx;
} }
.line_wrapper { .line_wrapper {
border-bottom: 2rpx solid #DEDEDE; border-bottom: 2rpx solid #DEDEDE;
padding: 28rpx 0; padding: 28rpx 0;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
.line_label { .line_label {
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; font-weight: 500;
color: #282829; color: #282829;
line-height: 40rpx; line-height: 40rpx;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.line_label > .logo{
.line_label>.logo {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
margin-right: 8rpx; margin-right: 8rpx;
} }
.line_tip { .line_tip {
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
color: #717171; color: #717171;
...@@ -178,94 +182,97 @@ page { ...@@ -178,94 +182,97 @@ page {
text-overflow: ellipsis; text-overflow: ellipsis;
margin-left: 16rpx; margin-left: 16rpx;
width: 350rpx; width: 350rpx;
} }
.line_con { .line_con {
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
color: #656566; color: #656566;
} }
.line_con > .logo {
.line_con>.logo {
width: 16rpx; width: 16rpx;
height: 24rpx; height: 24rpx;
margin-left: 8rpx; margin-left: 8rpx;
} }
.line_icon { .line_icon {
width: 40rpx; width: 40rpx;
height: 40rpx; height: 40rpx;
margin-left: 10rpx; margin-left: 10rpx;
} }
.class1 { .class1 {
font-size: 28rpx; font-size: 28rpx;
font-weight: 400; font-weight: 400;
color: #666666; color: #666666;
} }
.class2 { .class2 {
font-size: 28rpx; font-size: 28rpx;
font-weight: 400; font-weight: 400;
color: #8A303A; color: #8A303A;
} }
.class3 { .class3 {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 28rpx; font-size: 28rpx;
font-weight: 400; font-weight: 400;
color: #666666; color: #666666;
} }
.class4 { .class4 {
color: #8A303A; color: #8A303A;
font-weight: 500; font-weight: 500;
} }
.class5{
.class5 {
font-weight: 400; font-weight: 400;
color: #8A303A; color: #8A303A;
} }
.class6{
.class6 {
font-weight: 600; font-weight: 600;
font-size: 40rpx; font-size: 40rpx;
color: #8A303A; color: #8A303A;
} }
.rich_title { .rich_title {
margin-top: 30rpx; margin-top: 30rpx;
padding-left: 40rpx; padding-left: 40rpx;
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 18rpx; margin-bottom: 18rpx;
} }
.title_icon { .title_icon {
width: 6rpx; width: 6rpx;
height: 32rpx; height: 32rpx;
background: #8A303A; background: #8A303A;
} }
.title_text { .title_text {
font-size: 32rpx; font-size: 32rpx;
font-weight: 600; font-weight: 600;
color: #282829; color: #282829;
margin-left: 16rpx; margin-left: 16rpx;
} }
.rich_wrapper { .rich_wrapper {
padding: 0 40rpx; padding: 0 40rpx;
} }
.rich_text { .rich_text {
font-size: 28rpx; font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400; font-weight: 400;
color: #282829 !important; color: #282829 !important;
line-height: 44rpx; line-height: 44rpx;
background: white !important; background: white !important;
} }
.fixed_btn { .fixed_btn {
position: fixed; position: fixed;
left: 0; left: 0;
right: 0; right: 0;
...@@ -276,10 +283,10 @@ page { ...@@ -276,10 +283,10 @@ page {
justify-content: space-between; justify-content: space-between;
background: white; background: white;
box-sizing: border-box; box-sizing: border-box;
padding: 0 32rpx 0 90rpx; padding: 20rpx 32rpx 20rpx 90rpx;
} }
.buy_btn { .buy_btn {
width: 468rpx; width: 468rpx;
height: 80rpx; height: 80rpx;
background: #8A303A; background: #8A303A;
...@@ -287,40 +294,40 @@ page { ...@@ -287,40 +294,40 @@ page {
font-size: 28rpx; font-size: 28rpx;
font-weight: 600; font-weight: 600;
color: #FFFFFF; color: #FFFFFF;
} }
.icon_text { .icon_text {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.card_icon { .card_icon {
width: 52rpx; width: 52rpx;
height: 52rpx; height: 52rpx;
} }
.card_text { .card_text {
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
color: #666666; color: #666666;
line-height: 34rpx; line-height: 34rpx;
} }
.disableBtn { .disableBtn {
background-color: #999 !important; background-color: #999 !important;
} }
.noStorck { .noStorck {
padding: 28rpx 0; padding: 28rpx 0;
font-size: 32rpx; font-size: 32rpx;
font-weight: 600; font-weight: 600;
color: #8A303A; color: #8A303A;
background: rgba(252, 91, 50, 0.2); background: rgba(252, 91, 50, 0.2);
} }
.overlay { .overlay {
position: fixed; position: fixed;
left: 0; left: 0;
right: 0; right: 0;
...@@ -330,37 +337,37 @@ page { ...@@ -330,37 +337,37 @@ page {
height: 100%; height: 100%;
background-color: rgba(0, 0, 0, .7); background-color: rgba(0, 0, 0, .7);
z-index: 999; z-index: 999;
} }
.overlay_boxs { .overlay_boxs {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
height: 100%; height: 100%;
} }
.box_body { .box_body {
width: 72%; width: 72%;
height: 612rpx; height: 612rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
} }
.boxs_icon { .boxs_icon {
width: 288rpx; width: 288rpx;
height: 60rpx; height: 60rpx;
margin: 0 auto; margin: 0 auto;
} }
.boxs_content { .boxs_content {
border-radius: 8rpx; border-radius: 8rpx;
height: 438rpx; height: 438rpx;
position: relative; position: relative;
width: 100%; width: 100%;
} }
.box_title { .box_title {
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 0; top: 0;
...@@ -372,9 +379,9 @@ page { ...@@ -372,9 +379,9 @@ page {
z-index: 1; z-index: 1;
text-align: center; text-align: center;
line-height: 56rpx; line-height: 56rpx;
} }
.box_title_text::before { .box_title_text::before {
content: ""; content: "";
position: absolute; position: absolute;
top: 50%; top: 50%;
...@@ -383,15 +390,15 @@ page { ...@@ -383,15 +390,15 @@ page {
width: 62rpx; width: 62rpx;
height: 2rpx; height: 2rpx;
background: #683800; background: #683800;
} }
.box_title_text { .box_title_text {
color: #683800; color: #683800;
font-size: 28rpx; font-size: 28rpx;
position: relative; position: relative;
} }
.box_title_text::after { .box_title_text::after {
content: ""; content: "";
position: absolute; position: absolute;
top: 50%; top: 50%;
...@@ -400,9 +407,9 @@ page { ...@@ -400,9 +407,9 @@ page {
width: 62rpx; width: 62rpx;
height: 2rpx; height: 2rpx;
background: #683800; background: #683800;
} }
.box_container { .box_container {
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
...@@ -411,30 +418,33 @@ page { ...@@ -411,30 +418,33 @@ page {
background: #ffffff; background: #ffffff;
width: 100%; width: 100%;
border-radius: 8px; border-radius: 8px;
} }
.box_content_text { .box_content_text {
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
padding: 68rpx 48rpx 40rpx 48rpx; padding: 68rpx 48rpx 40rpx 48rpx;
font-size: 28rpx; font-size: 28rpx;
color: #606060; color: #606060;
line-height: 56rpx; line-height: 56rpx;
} }
.info_diff{
.info_diff {
color: #333; color: #333;
font-size: 28rpx; font-size: 28rpx;
text-align: center; text-align: center;
text-align: center; text-align: center;
} }
.info_open_btn{
.info_open_btn {
color: #19c34e; color: #19c34e;
font-size: 24rpx; font-size: 24rpx;
text-decoration: underline; text-decoration: underline;
margin-top: 6rpx; margin-top: 6rpx;
text-align: center; text-align: center;
} }
.box_btn_groups {
.box_btn_groups {
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
...@@ -443,17 +453,17 @@ page { ...@@ -443,17 +453,17 @@ page {
height: 88rpx; height: 88rpx;
display: flex; display: flex;
border-top: 2px solid #e5e5e5; border-top: 2px solid #e5e5e5;
} }
.btn_wrap { .btn_wrap {
text-align: center; text-align: center;
line-height: 88rpx; line-height: 88rpx;
color: #333333; color: #333333;
font-size: 28rpx; font-size: 28rpx;
width: 50%; width: 50%;
} }
.dr_line { .dr_line {
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 0; top: 0;
...@@ -461,13 +471,13 @@ page { ...@@ -461,13 +471,13 @@ page {
width: 1px; width: 1px;
transform: translate(-50%, 0); transform: translate(-50%, 0);
background: #e5e5e5; background: #e5e5e5;
} }
.spc_text { .spc_text {
color: #8A303A; color: #8A303A;
} }
.bottom_modal { .bottom_modal {
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
...@@ -477,13 +487,12 @@ page { ...@@ -477,13 +487,12 @@ page {
background: white; background: white;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.bottom_title_wrapper { .bottom_title_wrapper {
position: absolute; // position: sticky;
left: 0; // left: 0;
right: 0; // top: 0;
top: 0;
width: 100%; width: 100%;
height: 88rpx; height: 88rpx;
display: flex; display: flex;
...@@ -493,40 +502,46 @@ page { ...@@ -493,40 +502,46 @@ page {
padding: 0 40rpx; padding: 0 40rpx;
background: white; background: white;
z-index: 1000; z-index: 1000;
} }
.title_label { .title_label {
font-size: 32rpx; font-size: 32rpx;
color: #282829; color: #282829;
} }
.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; padding: 20rpx;
display: flex;
flex-wrap: wrap;
gap:20rpx 10rpx;
.scroll_element{
margin: 0;
} }
}
.bottem_item_width { .bottem_item_width {
width: 224rpx; width: 224rpx;
} }
.bottem_item_title_height { .bottem_item_title_height {
height: 98rpx; height: 98rpx;
} }
.check_icon_sty { .check_icon_sty {
width: 36rpx; width: 36rpx;
height: 36rpx; height: 36rpx;
position: absolute; position: absolute;
right: 20rpx; right: 20rpx;
bottom: 20rpx; bottom: 20rpx;
} }
.check_icon_sty_max { .check_icon_sty_max {
position: absolute; position: absolute;
right: 20rpx; right: 20rpx;
bottom: 45rpx; bottom: 45rpx;
}
\ No newline at end of file \ No newline at end of file
}
\ No newline at end of file \ No newline at end of file
...@@ -82,7 +82,6 @@ ...@@ -82,7 +82,6 @@
<rich-text nodes="{{richText}}" bind:tap="toClickRich"></rich-text> <rich-text nodes="{{richText}}" bind:tap="toClickRich"></rich-text>
</view> </view>
</view> </view>
<view style="height:254rpx"></view>
<view class="fixed_btn isFullSucreen"> <view class="fixed_btn isFullSucreen">
<view class="icon_text" bind:tap="toMyCoupons"> <view class="icon_text" bind:tap="toMyCoupons">
<glsx-image webp class="card_icon" webp src="equity/card-icon.png" /> <glsx-image webp class="card_icon" webp src="equity/card-icon.png" />
...@@ -90,7 +89,7 @@ ...@@ -90,7 +89,7 @@
</view> </view>
<view class="buy_btn flex_cc {{isHaveInventory?'':'disableBtn'}}" bind:tap="toBuyItem">{{isHaveInventory?'立即购买':'该商品已售罄'}}<text wx:if="{{isHaveInventory}}">(¥{{isOpen || !curentGoodsItem.noMemberPrice?curentGoodsItem.salesPrice:curentGoodsItem.noMemberPrice}})</text></view> <view class="buy_btn flex_cc {{isHaveInventory?'':'disableBtn'}}" bind:tap="toBuyItem">{{isHaveInventory?'立即购买':'该商品已售罄'}}<text wx:if="{{isHaveInventory}}">(¥{{isOpen || !curentGoodsItem.noMemberPrice?curentGoodsItem.salesPrice:curentGoodsItem.noMemberPrice}})</text></view>
</view> </view>
<view wx:if="{{showModal}}" class="overlay"> <view wx:if="{{showModal}}" class="overlay" catchtouchmove="noScroll">
<view class="overlay_boxs"> <view class="overlay_boxs">
<view class="box_body" style="height:{{!isOpen?'700':'612'}}rpx"> <view class="box_body" style="height:{{!isOpen?'700':'612'}}rpx">
<glsx-image webp class="boxs_icon" webp src="equity/scrm_modal_top_icon.png" /> <glsx-image webp class="boxs_icon" webp src="equity/scrm_modal_top_icon.png" />
...@@ -127,10 +126,9 @@ ...@@ -127,10 +126,9 @@
<view class="title_label">更多商品</view> <view class="title_label">更多商品</view>
<view class="title_close title_label" bind:tap="closeBottomModal">X</view> <view class="title_close title_label" bind:tap="closeBottomModal">X</view>
</view> </view>
<view style="height:88rpx"></view> <view class="bottom_scoll_wrap isFullSucreen">
<view class="bottom_scoll_wrap">
<block wx:for="{{goodsList}}"> <block wx:for="{{goodsList}}">
<view style="margin-bottom:20rpx" class="scroll_element bottem_item_width {{currentIndex==index?'scroll_element_active':''}}" bind:tap="selectGoodsItem" data-index="{{index}}" data-item="{{item}}"> <view class="scroll_element bottem_item_width {{currentIndex==index?'scroll_element_active':''}}" bind:tap="selectGoodsItem" data-index="{{index}}" data-item="{{item}}">
<view class="image_icon_wrapper"> <view class="image_icon_wrapper">
<image webp mode="widthFix" class="image_icon bottem_item_width" src="{{item.goodsImage}}" /> <image webp mode="widthFix" class="image_icon bottem_item_width" src="{{item.goodsImage}}" />
<glsx-image wx:if="{{!item.noMemberPrice}}" mode="widthFix" class="image_vip" webp src="equity/vip_icon_spc.png" /> <glsx-image wx:if="{{!item.noMemberPrice}}" mode="widthFix" class="image_vip" webp src="equity/vip_icon_spc.png" />
...@@ -150,9 +148,8 @@ ...@@ -150,9 +148,8 @@
</view> </view>
</view> </view>
<block wx:if="{{showAuth}}"> <block wx:if="{{showAuth}}">
<authorize scopeType="userLocation" buttonType="openSetting" bindfail="authFail" bindsuccess="authSuccess" <authorize scopeType="userLocation" buttonType="openSetting" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize>
show="{{showAuth}}"></authorize>
</block> </block>
<!-- <block wx:if="{{showComponent&&!isGH}}"> <!-- <block wx:if="{{showComponent&&!isGH}}">
<coupons-list bind:getCoupons="getCouponsItem" couponsId="{{query.couponId}}" show="{{showCoupons}}" goodsId="{{curentGoodsItem.id}}"></coupons-list> <coupons-list bind:getCoupons="getCouponsItem" couponsId="{{query.couponId}}" show="{{showCoupons}}" goodsId="{{curentGoodsItem.id}}"></coupons-list>
</block> --> </block> -->
\ No newline at end of file \ No newline at end of file
...@@ -44,11 +44,13 @@ Page({ ...@@ -44,11 +44,13 @@ Page({
if (loadOver) { if (loadOver) {
return return
} }
wx.p.wxApi.showLoading()
wx.p.api.equityApi.lasteCommodity(para).then(res => { wx.p.api.equityApi.lasteCommodity(para).then(res => {
if (!res) { if (!res) {
this.setData({ this.setData({
loadOver: true loadOver: true
}) })
wx.hideLoading()
return return
} }
let tempArr = [] let tempArr = []
...@@ -65,6 +67,7 @@ Page({ ...@@ -65,6 +67,7 @@ Page({
loadingMore: false, loadingMore: false,
loadOver: false loadOver: false
}) })
wx.hideLoading()
}) })
}, },
// 重新收起获取定位 // 重新收起获取定位
......
<view class="commodity-list-container"> <view class="commodity-list-container isFullSucreen">
<view wx:if="{{unauthorized}}" class="reLocation_wrap flex_cc"> <view wx:if="{{unauthorized}}" class="reLocation_wrap flex_cc">
<image webp class="loca_icon" webp src="{{IMGURL}}equity/location_icon.png?v={{img_version}}" /> <glsx-image webp class="loca_icon" webp src="equity/location_icon.png" />
<view bind:tap="relocation" class="loca_text">定位一下,发现附近优惠</view> <view bind:tap="relocation" class="loca_text">定位一下,发现附近优惠</view>
</view> </view>
<block wx:for="{{commodityList}}" wx:key="index"> <block wx:for="{{commodityList}}" wx:key="index">
......
...@@ -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) {
......
...@@ -32,19 +32,8 @@ Page({ ...@@ -32,19 +32,8 @@ Page({
} }
} }
let temp = encodeURIComponent(JSON.stringify(bindInfo)) let temp = encodeURIComponent(JSON.stringify(bindInfo))
// //埋点
// let trackobj = {
// ...this.data.tempOptions,
// phone: para.phone
// }
// if (this.data.tempOptions) {
// wx.p.cache.storageApi.reportData(trackobj, false, true)
// }
wx.p.storage.set('bindInfo', temp) wx.p.storage.set('bindInfo', temp)
// wx.p.router.reLaunch('/pages/tab/shopMall/index?tabIndex=1', { notIntercept: true }) wx.p.router.reLaunch('/pages/tab/equity/index');
wx.reLaunch({
url: '/pages/tab/equity/index',
});
}) })
}, },
toGetFreeCardDay(merchantId) { toGetFreeCardDay(merchantId) {
...@@ -67,9 +56,6 @@ Page({ ...@@ -67,9 +56,6 @@ Page({
const userInfo = wx.p.storage.get('userInfo') const userInfo = wx.p.storage.get('userInfo')
let { merchantId, phone } = userInfo let { merchantId, phone } = userInfo
if (!phone) {
return
}
wx.p.wxApi.showLoading() wx.p.wxApi.showLoading()
this.toPostFreeCard(merchantId, phone, userInfo) this.toPostFreeCard(merchantId, phone, userInfo)
}, },
...@@ -77,85 +63,12 @@ Page({ ...@@ -77,85 +63,12 @@ Page({
onLoad(options) { onLoad(options) {
let system = wx.getSystemInfoSync() let system = wx.getSystemInfoSync()
const { merchantId } = wx.p.storage.get('merchant_info') const { merchantId } = wx.p.storage.get('merchant_info')
// if (options && options.scene) {
// this.getLiveActivityId(decodeURIComponent(options.scene))
// } else {
// this.toGetFreeCardDay(merchantId)
// }
this.toGetFreeCardDay(merchantId) this.toGetFreeCardDay(merchantId)
this.setData({ this.setData({
paddingH: system.windowHeight * 0.11, paddingH: system.windowHeight * 0.11,
textpadding: system.windowHeight * 0.31 textpadding: system.windowHeight * 0.31
}) })
// 埋点---定保
// if (options.activity_id) {
// this.data.tempOptions = options
// wx.p.cache.storageApi.reportData(options, true, false)
// }
},
// 获取scene
getLiveActivityId(str) {
wx.p.api.shopmallApi
.getLiveActivityId({
id: str.split('=')[1]
})
.then(({ code, data }) => {
if (code == 0) {
let op = {}
data.scene.split('&').map(item => {
const [key, val] = item.split('=')
op[key] = val
})
if (op.merchantId) wx.p.storage.set('srcm_shopmall_merchant_id', op.merchantId)
if (op.openId) {
wx.setStorageSync('showServicesMerchantId', op.merchantId);
wx.p.eventbus.emit('SERVICES', true)
this.phone = op.phone
this.merchantId = op.merchantId
this.setData({
showAuthBtn: false,
})
this.op = op
} else {
this.login()
}
this.toGetFreeCardDay(op.merchantId)
}
})
}, },
// 客户id
// handlerCustomerId() {
// let customerId = wx.p.storage.get('srcm_shopmall_customer_id')
// if (customerId) wx.p.api.userApi.updataCustomerPhone()
// },
// freeLogin() {
// let op = this.op
// // wx.clearStorageSync();
// ssoApi.loginByOpenId({
// openId: op.openId
// }).then(({
// code,
// data,
// message
// }) => {
// wx.p.authStatus = code != 0
// if (code == '0') {
// wx.p.cache.storageApi.setUserInfo(data)
// wx.p.cache.storageApi.setSessionId(data.sessionId)
// wx.p.authStatus = false
// this.sessionId = data.sessionId
// this.toPostFreeCard(op.merchantId, op.phone, data)
// // wx.p.storage.set('srcm_shopmall_merchant_id', op.merchantId)
// // wx.setStorageSync('showServicesMerchantId', op.merchantId);
// // wx.p.eventbus.emit('SERVICES', true)
// // wx.p.storage.set('bindInfo', temp)
// // wx.p.router.reLaunch('/pages/tab/shopMall/index?tabIndex=1', { notIntercept: true })
// } else {
// wx.p.wxApi.showToast(message || '系统异常')
// }
// })
// },
onUnload: function () { onUnload: function () {
//wx.p.cache.storageApi.customerbehavior(2)
} }
}) })
<view class="freecard_container" style="padding-bottom:{{paddingH}}rpx;box-sizing: border-box;"> <view class="freecard_container" style="padding-bottom:{{paddingH}}rpx;box-sizing: border-box;">
<glsx-image webp class="bgIcon"src="equity/freecard_bg_icon.png" /> <glsx-image webp class="bgIcon" src="equity/freecard_bg_icon.png" />
<view class="wrapper2" style="top:{{textpadding}}rpx"> <view class="wrapper2" style="top:{{textpadding}}rpx">
<view class="dayText"> <view class="dayText">
{{freeDay}} {{freeDay}}
...@@ -9,9 +9,6 @@ ...@@ -9,9 +9,6 @@
</view> </view>
<view class="wrapper1"> <view class="wrapper1">
<!-- <view class="btnText" bind:tap="tofreeReceive">免费领取</view> --> <!-- <view class="btnText" bind:tap="tofreeReceive">免费领取</view> -->
<!-- <block wx:if="{{showAuthBtn}}">
<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="auth-button"></button>
</block> -->
<glsx-image webp bind:tap="tofreeReceive" webp class="bottomIcon animaiton" mode="widthFix" src="equity/freecard_btn_icon_new.png" /> <glsx-image webp bind:tap="tofreeReceive" webp class="bottomIcon animaiton" mode="widthFix" src="equity/freecard_btn_icon_new.png" />
</view> </view>
<view style="height:22rpx"></view> <view style="height:22rpx"></view>
...@@ -19,4 +16,4 @@ ...@@ -19,4 +16,4 @@
<glsx-image webp class="bottomIcon" webp mode="widthFix" src="equity/new_freecard_icon.png" /> <glsx-image webp class="bottomIcon" webp mode="widthFix" src="equity/new_freecard_icon.png" />
</view> </view>
</view> </view>
<services/>
\ No newline at end of file \ No newline at end of file
<services />
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/index/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{}
\ No newline at end of file \ No newline at end of file
<!--packageEquity/pages/index/index.wxml-->
<text>packageEquity/pages/index/index.wxml</text>
...@@ -7,7 +7,9 @@ Page({ ...@@ -7,7 +7,9 @@ Page({
}, },
getOrderInfo(orderCode) { getOrderInfo(orderCode) {
wx.p.wxApi.showLoading() wx.p.wxApi.showLoading()
wx.p.api.equityApi.orderDetailData({ orderCode }).then(res => { wx.p.api.equityApi.orderDetailData({
orderCode
}).then(res => {
wx.hideLoading(); wx.hideLoading();
let richText = res.useNotes let richText = res.useNotes
res.warrantyDate = res.warrantyDate ? new Date(res.warrantyDate).format('yyyy-MM-dd hh:mm:ss') : '' res.warrantyDate = res.warrantyDate ? new Date(res.warrantyDate).format('yyyy-MM-dd hh:mm:ss') : ''
......
...@@ -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,13 +111,7 @@ Page({ ...@@ -116,13 +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'
})
}, },
// toActive() {
// wx.navigateTo({
// url: '/packageShopmall/packageEquity/pages/active/active'
// })
// }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -5,6 +5,8 @@ page{ ...@@ -5,6 +5,8 @@ page{
box-sizing: border-box; box-sizing: border-box;
padding: 33rpx 0; padding: 33rpx 0;
position: relative; position: relative;
padding-bottom: calc(162rpx + var(--constantSafeAreaInsetBottom));
padding-bottom: calc(162rpx + var(--envSafeAreaInsetBottom));
} }
.top_widget { .top_widget {
......
...@@ -11,8 +11,7 @@ ...@@ -11,8 +11,7 @@
<glsx-image webp mode="widthFix" webp class="desc_icon" src="{{IMGURKBASE}}scrm_opening_vip.png" /> <glsx-image webp mode="widthFix" webp class="desc_icon" src="{{IMGURKBASE}}scrm_opening_vip.png" />
</view> </view>
<!-- <glsx-image webp class="device_icon" bind:tap="toActive" mode="widthFix" webp src="equity/scrm_device_bg_new.png" /> --> <!-- <glsx-image webp class="device_icon" bind:tap="toActive" mode="widthFix" webp src="equity/scrm_device_bg_new.png" /> -->
<view style="height:220rpx"></view> <view class="fixed_wrapper isFullSucreen">
<view class="fixed_wrapper">
<view class="btn_wrap"> <view class="btn_wrap">
<view wx:if="{{!isOpen&&memberInfo.goodPrice}}" class="btn_element btn_element_active" catchtap="openMemberFn">¥{{memberInfo.goodPrice}} 立即开通</view> <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 wx:else class="btn_element">{{ isOpen ? "已开通" : "暂不支持付费购买" }}</view>
......
...@@ -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)
......
...@@ -4,9 +4,11 @@ ...@@ -4,9 +4,11 @@
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
padding: 0 32rpx; padding: 0 32rpx;
} padding-bottom: calc(128rpx + var(--constantSafeAreaInsetBottom));
padding-bottom: calc(128rpx + var(--envSafeAreaInsetBottom));
}
.top_wrapper { .top_wrapper {
width: 100%; width: 100%;
height: 160rpx; height: 160rpx;
background-image: url("https://img02.glsx.com.cn/weapp/resource/miniprogram/glsx/equity/scrm_package_bg.png"); background-image: url("https://img02.glsx.com.cn/weapp/resource/miniprogram/glsx/equity/scrm_package_bg.png");
...@@ -17,37 +19,37 @@ ...@@ -17,37 +19,37 @@
align-items: center; align-items: center;
font-size: 36rpx; font-size: 36rpx;
color: #fff; color: #fff;
} }
.title_widget { .title_widget {
width: 100%; width: 100%;
color: #282829; color: #282829;
font-size: 36rpx; font-size: 36rpx;
margin: 32rpx 0 24rpx 0; margin: 32rpx 0 24rpx 0;
text-align: center; text-align: center;
font-weight: 500; font-weight: 500;
} }
.title_num { .title_num {
color: #C57463; color: #C57463;
margin: 0 10rpx; margin: 0 10rpx;
} }
.package_content_wrapper { .package_content_wrapper {
box-sizing: border-box; box-sizing: border-box;
background: #fff; background: #fff;
border-radius: 8rpx; border-radius: 8rpx;
width: 100%; width: 100%;
padding: 24rpx; padding: 24rpx;
} }
.package_element { .package_element {
position: relative; position: relative;
height: 82rpx; height: 82rpx;
margin-bottom: 48rpx; margin-bottom: 48rpx;
} }
.ele_top { .ele_top {
width: 70%; width: 70%;
color: #282829; color: #282829;
font-size: 28rpx; font-size: 28rpx;
...@@ -55,42 +57,42 @@ ...@@ -55,42 +57,42 @@
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.ele_right { .ele_right {
color: #282829; color: #282829;
font-size: 24rpx; font-size: 24rpx;
position: absolute; position: absolute;
right: 0; right: 0;
top: 4rpx; top: 4rpx;
font-weight: 500; font-weight: 500;
} }
.ele_left { .ele_left {
color: #b1b1b3; color: #b1b1b3;
font-size: 24rpx; font-size: 24rpx;
position: absolute; position: absolute;
left: 40rpx; left: 40rpx;
bottom: 0; bottom: 0;
} }
.ele_bottom { .ele_bottom {
color: #b1b1b3; color: #b1b1b3;
font-size: 24rpx; font-size: 24rpx;
position: absolute; position: absolute;
right: 0; right: 0;
bottom: 0; bottom: 0;
} }
.content_tip { .content_tip {
color: #656566; color: #656566;
font-size: 22rpx; font-size: 22rpx;
box-sizing: border-box; box-sizing: border-box;
padding-left: 24rpx; padding-left: 24rpx;
word-wrap: break-word; word-wrap: break-word;
} }
.fixed-button-wrap { .fixed-button-wrap {
position: fixed; position: fixed;
left: 0; left: 0;
right: 0; right: 0;
...@@ -100,9 +102,9 @@ ...@@ -100,9 +102,9 @@
padding: 0 32rpx; padding: 0 32rpx;
padding-bottom: 40rpx; padding-bottom: 40rpx;
padding-top: 20rpx; padding-top: 20rpx;
} }
.button-item { .button-item {
width: 100%; width: 100%;
height: 88rpx; height: 88rpx;
background: #892F3B; background: #892F3B;
...@@ -113,12 +115,13 @@ ...@@ -113,12 +115,13 @@
font-weight: 500; font-weight: 500;
font-size: 28rpx; font-size: 28rpx;
color: #FFFFFF; color: #FFFFFF;
} }
.grey-btn{
.grey-btn {
background: #ccc; background: #ccc;
} }
.auth-button { .auth-button {
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
...@@ -126,30 +129,30 @@ ...@@ -126,30 +129,30 @@
top: 0; top: 0;
opacity: 0; opacity: 0;
z-index: 102; z-index: 102;
} }
.price_total_title { .price_total_title {
font-size: 36rpx; font-size: 36rpx;
font-weight: 500; font-weight: 500;
color: #282829; color: #282829;
margin: 32rpx 0 24rpx 0; margin: 32rpx 0 24rpx 0;
text-align: center; text-align: center;
} }
.statistical_wrapper { .statistical_wrapper {
/* margin: 0 32rpx; */ /* margin: 0 32rpx; */
box-sizing: border-box; box-sizing: border-box;
padding: 32rpx 24rpx; padding: 32rpx 24rpx;
background: #FFFFFF; background: #FFFFFF;
border-radius: 16rpx; border-radius: 16rpx;
} }
.price_line_item { .price_line_item {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.line_label { .line_label {
font-size: 24rpx; font-size: 24rpx;
font-weight: 500; font-weight: 500;
color: #282829; color: #282829;
...@@ -158,18 +161,18 @@ ...@@ -158,18 +161,18 @@
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.line_num { .line_num {
width: 20%; width: 20%;
font-size: 24rpx; font-size: 24rpx;
font-weight: 500; font-weight: 500;
color: #656566; color: #656566;
line-height: 34rpx; line-height: 34rpx;
text-align: center; text-align: center;
} }
.line_price { .line_price {
width: 40%; width: 40%;
font-size: 24rpx; font-size: 24rpx;
font-weight: 500; font-weight: 500;
...@@ -179,21 +182,21 @@ ...@@ -179,21 +182,21 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-end; justify-content: flex-end;
} }
.total_desc { .total_desc {
font-size: 28rpx; font-size: 28rpx;
font-weight: 500; font-weight: 500;
color: #282829; color: #282829;
line-height: 40rpx; line-height: 40rpx;
text-align: center; text-align: center;
margin-bottom: 22rpx; margin-bottom: 22rpx;
} }
.price_text { .price_text {
font-size: 32rpx; font-size: 32rpx;
font-weight: 500; font-weight: 500;
color: #FC5B32; color: #FC5B32;
line-height: 44rpx; line-height: 44rpx;
margin: 0 10rpx; margin: 0 10rpx;
}
\ No newline at end of file \ No newline at end of file
}
\ No newline at end of file \ No newline at end of file
...@@ -52,5 +52,4 @@ ...@@ -52,5 +52,4 @@
</view> </view>
<view wx:if="{{!packageInfo.isPayFlag&&!showAuthBtn}}" class="button-item grey-btn">非指定用户不可购买</view> <view wx:if="{{!packageInfo.isPayFlag&&!showAuthBtn}}" class="button-item grey-btn">非指定用户不可购买</view>
</view> </view>
<view style="height: 164rpx"></view>
</view> </view>
\ No newline at end of file \ No newline at end of file
<view class="package-detail-container"> <view class="package-detail-container">
<view wx:if="{{orderStatus>3}}" class="afterSale_wrapper"> <view wx:if="{{orderStatus>3}}" class="afterSale_wrapper">
<view wx:if="{{orderStatus==4}}" class="after_title flex_cc"> <view wx:if="{{orderStatus==4}}" class="after_title flex_cc">
<image webp class="sale_icon" src="{{IMGURL}}equity/return_icon.png?v={{img_version}}" /> <glsx-image webp class="sale_icon" src="equity/return_icon.png" />
<view class="sale_text">退款中</view> <view class="sale_text">退款中</view>
</view> </view>
<view wx:if="{{orderStatus==5}}" class="after_title flex_cc"> <view wx:if="{{orderStatus==5}}" class="after_title flex_cc">
<image webp class="sale_icon" src="{{IMGURL}}equity/return_fail.png?v={{img_version}}" /> <glsx-image webp class="sale_icon" src="equity/return_fail.png" />
<view class="sale_text">退款失败</view> <view class="sale_text">退款失败</view>
</view> </view>
<view wx:if="{{orderStatus==6}}" class="after_title flex_cc"> <view wx:if="{{orderStatus==6}}" class="after_title flex_cc">
<image webp class="sale_icon" src="{{IMGURL}}equity/return_success.png?v={{img_version}}" /> <glsx-image webp class="sale_icon" src="equity/return_success.png" />
<view class="sale_text">已退款</view> <view class="sale_text">已退款</view>
</view> </view>
<view wx:if="{{orderStatus==4}}" class="return_message"> <view wx:if="{{orderStatus==4}}" class="return_message">
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<view style="height:32rpx"></view> <view style="height:32rpx"></view>
<view class="wrapper"> <view class="wrapper">
<!-- <view class="image_icon_text" bind:tap="openMap"> <!-- <view class="image_icon_text" bind:tap="openMap">
<image webp class="image_icon" src="{{IMGURL}}equity/scrm_location_icon.png?v={{img_version}}" /> <glsx-image webp class="image_icon" src="equity/scrm_location_icon.png" />
<view class="image_text">导航</view> <view class="image_text">导航</view>
</view> --> </view> -->
<view class="row_wrap flex_sc"> <view class="row_wrap flex_sc">
......
...@@ -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,12 +124,9 @@ Page({ ...@@ -116,12 +124,9 @@ 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
}) })
// wx.navigateBack({
// delta: 1
// })
}, 3000) }, 3000)
}) })
} }
......
...@@ -10,43 +10,17 @@ Page({ ...@@ -10,43 +10,17 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log(options) console.log(options)
// let aaa = '{"orderCode":"GL467176510294597632","name":"全车精品套餐","price":"0.01"}'
let temp = JSON.parse(options.order)
// let temp = JSON.parse(aaa)
this.setData({ this.setData({
order: temp order: options.order
}) })
}, },
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
}) })
}, },
......
// packageIndex/pages/index/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(options)
this.setData(options)
setTimeout(() => {
console.log(this.options, 'this.options')
}, 2e3)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{}
\ No newline at end of file \ No newline at end of file
<view>
{{a}}
<view>{{b}}</view>
<view>{{c}}</view>
<view>{{d}}</view>
</view>
\ No newline at end of file \ No newline at end of file
/* components/Sku/Sku.wxss */ /* components/Sku/Sku.wxss */
@import '/style/common.wxss'; @import '/assets/style/common.wxss';
.sku { .sku {
position: fixed; position: fixed;
......
...@@ -48,9 +48,9 @@ Page({ ...@@ -48,9 +48,9 @@ Page({
}) })
.then(data => { .then(data => {
console.log(data) console.log(data)
let lists = this.unique([...list, ...data.list]) // let lists = this.unique([...list, ...data.list])
this.setData({ this.setData({
list: lists, list: data.list,
total total
}) })
wx.hideLoading() wx.hideLoading()
...@@ -124,17 +124,18 @@ Page({ ...@@ -124,17 +124,18 @@ Page({
useMemberType, useMemberType,
detailInfo detailInfo
} = options } = options
console.log(userCouponId)
wx.p.wxApi.showLoading('加载中...') wx.p.wxApi.showLoading('加载中...')
if (userCouponId) {
console.log(userCouponId)
this.setData({ this.setData({
useMemberType, useMemberType,
detailInfo detailInfo
}) })
wx.p.api.couponsApi
.getWWCoupon({ wx.p.api.couponsApi.getWWCoupon({
userCouponId userCouponId
}) }).then(res => {
.then(res => {
wx.hideLoading() wx.hideLoading()
wx.nextTick(() => { wx.nextTick(() => {
this.setCouponData(res) this.setCouponData(res)
...@@ -145,6 +146,7 @@ Page({ ...@@ -145,6 +146,7 @@ Page({
verificationCode: code verificationCode: code
}) })
}) })
}
if (options && options.couponId) { if (options && options.couponId) {
console.log(options) console.log(options)
wx.p.wxApi.showLoading('加载中...') wx.p.wxApi.showLoading('加载中...')
...@@ -171,7 +173,6 @@ Page({ ...@@ -171,7 +173,6 @@ Page({
this.setData({ this.setData({
detailInfo: couponInfo detailInfo: couponInfo
}) })
// wx.hideLoading()
wx.p.api.couponsApi.getCouponInfo(options).then(res => { wx.p.api.couponsApi.getCouponInfo(options).then(res => {
this.setCouponData(res) this.setCouponData(res)
this.setData({ this.setData({
...@@ -188,9 +189,9 @@ Page({ ...@@ -188,9 +189,9 @@ Page({
} else { } else {
if (callBack) callBack(couponInfo) if (callBack) callBack(couponInfo)
} }
wx.hideLoading()
}) })
}) })
wx.hideLoading()
}, },
setCouponData(res) { setCouponData(res) {
if (res.receiveStartTime) res.receiveStartTime = new Date(res.receiveStartTime).format('yyyy.MM.dd hh:mm:ss') if (res.receiveStartTime) res.receiveStartTime = new Date(res.receiveStartTime).format('yyyy.MM.dd hh:mm:ss')
...@@ -248,12 +249,12 @@ Page({ ...@@ -248,12 +249,12 @@ Page({
message message
}) => { }) => {
if (code == '0') { if (code == '0') {
wx.$Track.setTrack({ // wx.$Track.setTrack({
data, // data,
type: '领取优惠券' // type: '领取优惠券'
}, // },
7 // 7
) // )
console.log(data) console.log(data)
if (data.discountType == 3) { if (data.discountType == 3) {
this.jump() this.jump()
......
// packageMall/pages/detail/detail.js // packageMall/pages/detail/detail.js
import { import {
centsToyuan, centsToyuan
iosTimeFormat
} from '~/utils/format' } from '~/utils/format'
const navStyle = 'background-color: transparent;' const navStyle = 'background-color: transparent;'
let navBarHeight = 38 let navBarHeight = 38
import NP from 'number-precision' import NP from 'number-precision'
import {
countdownMixin
} from '~/mixins/index'
Page({ Page({
behaviors: [countdownMixin],
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
...@@ -111,11 +115,6 @@ Page({ ...@@ -111,11 +115,6 @@ Page({
navStyle: e.scrollTop >= navBarHeight ? '' : navStyle navStyle: e.scrollTop >= navBarHeight ? '' : navStyle
}) })
}, },
goodsActionReady(e) {
this.setData({
padding_bottom: e.detail
})
},
showSkuFun() { showSkuFun() {
this.setData({ this.setData({
showSku: true showSku: true
...@@ -127,8 +126,8 @@ Page({ ...@@ -127,8 +126,8 @@ Page({
}) })
}, },
goodsActionClick(e) { goodsActionClick(e) {
let type = e.detail let type = e.detail,
let { {
activeSku, activeSku,
isActivity, isActivity,
goodsInfo: { goodsInfo: {
...@@ -137,20 +136,16 @@ Page({ ...@@ -137,20 +136,16 @@ Page({
buyFlag buyFlag
} }
} = this.data } = this.data
if (activeSku) { if (activeSku) return this.showSkuFun()
this.showSkuFun()
return
}
if (isActivity && activityStatus != 2) return if (isActivity && activityStatus != 2) return
if (goodsStock == 0) return if (goodsStock == 0) return
if (buyFlag == 2) return if (buyFlag == 2) return
if (type == 'pay') { if (type == 'pay') this.pay()
this.pay() else this.join()
} else {
this.join()
}
}, },
pay(e) { async pay(e) {
const loginStatus = await wx.p.router.intercept()
if (loginStatus) return
let { let {
isActivity, isActivity,
isLive, isLive,
...@@ -160,12 +155,6 @@ Page({ ...@@ -160,12 +155,6 @@ Page({
isDefault isDefault
} = this.data } = this.data
let stock let stock
if (wx.$authStatus) {
wx.navigateTo({
url: '/pages/Login/Login'
})
return
}
let params = { let params = {
orderSource: 1 orderSource: 1
} }
...@@ -387,7 +376,14 @@ Page({ ...@@ -387,7 +376,14 @@ Page({
activeSku activeSku
}) })
if (isActivity) this.countDown([data.startTime, data.endTime]) if (isActivity) this.countDown({
timer: [data.startTime, data.endTime],
targetObject: {
name: 'goodsInfo',
key: 'activityStatus'
}
})
this.getUserAddressDefault()
wx.hideLoading() wx.hideLoading()
} else { } else {
wx.hideLoading() wx.hideLoading()
...@@ -397,7 +393,9 @@ Page({ ...@@ -397,7 +393,9 @@ Page({
} }
}) })
}, },
getGoodscouponList(id) { async getGoodscouponList(id) {
const res = await wx.p.router.intercept(false)
if (res) return
id = id ? id : this.data.id id = id ? id : this.data.id
wx.p.api.shopmallApi wx.p.api.shopmallApi
.getGoodscouponList({ .getGoodscouponList({
...@@ -484,6 +482,41 @@ Page({ ...@@ -484,6 +482,41 @@ Page({
}) })
}) })
}, },
//分享海报
sharePoster(e) {
const {
isActivity,
posterUrl,
id
} = this.data, target = isActivity ? 'getActivitylink' : 'getGoodslink'
if (!posterUrl) {
wx.p.wxApi.showLoading('加载中...')
wx.p.api.shopmallApi[target](id).then(data => {
if (data) {
this.setData({
posterUrl: data.posterUrl
})
}
wx.hideLoading()
})
}
this.setData({
showPoster: true
})
},
hidden() {
this.setData({
showPoster: false
})
},
/**
* 生命周期函数--监听登录成功后回调
*/
onLoginSuccess() {
this.getUserAddressDefault()
this.getGoodscouponList()
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
...@@ -494,7 +527,6 @@ Page({ ...@@ -494,7 +527,6 @@ Page({
*/ */
onShow: function () { onShow: function () {
this.getUserAddressList() this.getUserAddressList()
this.getUserAddressDefault()
}, },
/** /**
...@@ -522,56 +554,5 @@ Page({ ...@@ -522,56 +554,5 @@ Page({
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage: function () {}, onShareAppMessage: function () {},
countDown(params) { noScroll() {}
let {
activityStatus
} = this.data.goodsInfo
// activityStatus 1:未开始,2进行中,3已结束
const addZero = i => (i < 10 ? `0${i}` : `${i}`)
let [activityStartTime, activityEndTime] = params
const start = iosTimeFormat(activityStartTime)
const end = iosTimeFormat(activityEndTime)
if (new Date().getTime() > new Date(end).getTime() || activityStatus == 3) {
clearTimeout(this.time)
this.setData({
timeFlag: true,
finished: '活动已结束'
})
return
}
if (new Date().getTime() >= new Date(start).getTime() && activityStatus != 2) {
this.setData({
'goodsInfo.activityStatus': 2
})
activityStatus = 2
}
let starTime = new Date()
let endTime = new Date(activityStatus == 2 ? end : start)
let lefttime = parseInt((endTime.getTime() - starTime.getTime()) / 1000)
let d = parseInt(lefttime / (24 * 60 * 60))
let h = parseInt((lefttime / (60 * 60)) % 24)
let m = parseInt((lefttime / 60) % 60)
let s = parseInt(lefttime % 60)
h = addZero(h)
m = addZero(m)
s = addZero(s)
let type = {
1: '距开始',
2: '距结束'
} [activityStatus]
if (this.time) clearTimeout(this.time)
this.time = setTimeout(() => {
let dayList = [h, m, s]
let activityTime = {
dayList,
type
}
if (d > 0) activityTime.day = `${d}天`
this.setData({
activityTime,
timeFlag: true
})
this.countDown(params)
}, 1 * 1000)
}
}) })
\ No newline at end of file \ No newline at end of file
...@@ -4,7 +4,11 @@ ...@@ -4,7 +4,11 @@
align-items: center; align-items: center;
position: relative; position: relative;
} }
.layout{
padding-bottom: calc(140rpx + var(--constantSafeAreaInsetBottom));
padding-bottom: calc(140rpx + var(--envSafeAreaInsetBottom));
animation: show-box-opacity .5s forwards;
}
.navigation-bar { .navigation-bar {
position: fixed; position: fixed;
top: 0; top: 0;
...@@ -40,10 +44,10 @@ ...@@ -40,10 +44,10 @@
.navigation .back { .navigation .back {
width: 64rpx; width: 64rpx;
height: 64rpx; height: 64rpx;
background: rgba(255, 255, 255, 0.5); background: #F9F7F7;
border-radius: var(--margin); border-radius: var(--margin);
position: absolute; position: absolute;
left: 20rpx; left: 10rpx;
} }
.navigation .back .icon { .navigation .back .icon {
...@@ -408,8 +412,8 @@ ...@@ -408,8 +412,8 @@
color: #282829; color: #282829;
line-height: 40rpx; line-height: 40rpx;
padding: 0 0 20rpx 0; padding: 0 0 20rpx 0;
white-space:normal; white-space: normal;
word-break:break-all; word-break: break-all;
} }
...@@ -447,7 +451,8 @@ ...@@ -447,7 +451,8 @@
background-color: #333333; background-color: #333333;
border-radius: 50%; border-radius: 50%;
} }
.user-portrait image{
.user-portrait image {
border-radius: 50%; border-radius: 50%;
} }
...@@ -481,104 +486,82 @@ ...@@ -481,104 +486,82 @@
background-color: #e7e7e7; background-color: #e7e7e7;
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
.goods-comment .comment-images .icon image { .goods-comment .comment-images .icon image {
border-radius: 8rpx; border-radius: 8rpx;
} }
.share { .share {
width: 108rpx; width: 108rpx;
height: 34rpx; height: 44rpx;
background: rgba(252, 91, 50, 0.1); background: #EFDEE0;
border-radius: 4rpx; border-radius: 22rpx;
font-size: 24rpx; font-size: 24rpx;
color: var(--btnColor); color: var(--btnColor);
line-height: 34rpx;
display: flex; display: flex;
align-items: center; align-items: center;
position: absolute; position: absolute;
right: 0; right: 0;
padding-left: 12rpx; padding-left: 16rpx;
box-sizing: border-box; box-sizing: border-box;
&-icon {
width: 20rpx;
height: 22rpx;
margin-left: 8rpx;
}
} }
.share text { .share text {
flex-shrink: 0; flex-shrink: 0;
} }
.icon-goods-share {
transform: scale(0.54);
}
.model { .model {
position: fixed; position: fixed;
left: 0;
right: 0;
top: 0; top: 0;
right: 0; right: 0;
background: rgba(0, 0, 0, 0.5); bottom: 0;
width: 100%; left: 0;
height: 100%;
z-index: 999999; z-index: 999999;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
&-bg{
position: absolute;
left: 0;
top: 0;
z-index: -1;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
}
} }
.poster { .poster {
width: 540rpx; width: 540rpx;
height: 860rpx; height: 924rpx;
border-radius: 8rpx; animation: show-box-inset .5s forwards;
} }
.hidden{
height:100%;
overflow: hidden;
}
.shop {
height: 62rpx;
background-color: white;
padding: 30rpx;
display: flex;
align-items: center;
border-bottom: 2rpx solid #F7F8FA;
}
.shop .right {
width: 24rpx;
height: 18rpx;
margin: 0 14rpx 0 26rpx;
}
.shop .processBox {
display: flex;
}
.shop .processBox .describe {
margin-left: 8rpx;
}
.shop .processBox .describe .describeTop {
font-size: 24rpx;
color: #333333;
}
.shop .processBox .describe .describeBottom {
font-size: 20rpx;
color: #999999;
}
.shop .processBox image {
width: 60rpx;
height: 60rpx;
}
.goods-param .items { .goods-param .items {
min-height: 34rpx; min-height: 34rpx;
display: flex; display: flex;
font-size: 24rpx; font-size: 24rpx;
padding: 32rpx 0; padding: 32rpx 0;
} }
.goods-param .items .labels { .goods-param .items .labels {
width: 136rpx; width: 136rpx;
color: #656566; color: #656566;
} }
.goods-param .items .values { .goods-param .items .values {
width: 490rpx; width: 490rpx;
color: #3B3B3D; color: #3B3B3D;
} }
.tab-widget{
.tab-widget {
width: 100%; width: 100%;
height: 88rpx; height: 88rpx;
background: white; background: white;
...@@ -588,22 +571,26 @@ ...@@ -588,22 +571,26 @@
right: 0; right: 0;
z-index: 999; z-index: 999;
} }
.tab-widget .tab-item{
.tab-widget .tab-item {
width: 50%; width: 50%;
height: 100%; height: 100%;
position: relative; position: relative;
} }
.tab-widget .tab-item .text{
.tab-widget .tab-item .text {
font-size: 28rpx; font-size: 28rpx;
color: #656566; color: #656566;
line-height: 40rpx; line-height: 40rpx;
} }
.tab-widget .tab-item .text-ative{
.tab-widget .tab-item .text-ative {
font-weight: 500; font-weight: 500;
font-size: 28rpx; font-size: 28rpx;
color: #2C2C2C; color: #2C2C2C;
} }
.tab-widget .tab-item .line{
.tab-widget .tab-item .line {
position: absolute; position: absolute;
left: 50%; left: 50%;
bottom: 0; bottom: 0;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
活动重新配置中,请稍后重试 活动重新配置中,请稍后重试
</view> </view>
<block wx:if="{{goodsFlag}}"> <block wx:if="{{goodsFlag}}">
<view class="{{posterUrl==''?'layout':'layout hidden'}} " style="padding-bottom:{{padding_bottom + 20}}px;"> <view class="layout">
<view class="banner-box"> <view class="banner-box">
<swiper class="banner" bindchange="changeBanner"> <swiper class="banner" bindchange="changeBanner">
<block wx:for="{{goodsInfo.goodsDetailImageList}}" wx:key="index"> <block wx:for="{{goodsInfo.goodsDetailImageList}}" wx:key="index">
...@@ -99,6 +99,12 @@ ...@@ -99,6 +99,12 @@
<view class="flex"> <view class="flex">
<view class="name"> {{isActivity?goodsInfo.activityName:goodsInfo.goodsName}} <view class="name"> {{isActivity?goodsInfo.activityName:goodsInfo.goodsName}}
</view> </view>
<view class="share" bindtap="sharePoster">
<text>分享</text>
<view class="share-icon">
<glsx-image src="mall/share.png"></glsx-image>
</view>
</view>
</view> </view>
<block wx:if="{{!isActivity}}"> <block wx:if="{{!isActivity}}">
<view class="count"> <view class="count">
...@@ -197,8 +203,16 @@ ...@@ -197,8 +203,16 @@
</block> </block>
<coupon-goods show="{{showCoupon}}" only="{{only}}" couponData="{{couponData}}" bindclick="showCouponFun"></coupon-goods> <coupon-goods show="{{showCoupon}}" only="{{only}}" couponData="{{couponData}}" bindclick="showCouponFun"></coupon-goods>
<block wx:if="{{navHeight && goodsFlag}}"> <block wx:if="{{navHeight && goodsFlag}}">
<goods-action bindready="goodsActionReady" pay-disabled="{{goodsInfo.activityStatus != 2 }}" stock="{{goodsInfo.goodsStock === 0}}" buyFlag="{{goodsInfo.buyFlag == 2}}" bindclick="goodsActionClick" hideShop="{{isActivity}}"></goods-action> <goods-action pay-disabled="{{goodsInfo.activityStatus != 2 }}" stock="{{goodsInfo.goodsStock === 0}}" buyFlag="{{goodsInfo.buyFlag == 2}}" bindclick="goodsActionClick" hideShop="{{isActivity}}"></goods-action>
<block wx:if="{{activeSku}}"> <block wx:if="{{activeSku}}">
<sku show="{{showSku}}" showName="showSku" isActivity="{{isActivity}}" skuData="{{goodsInfo}}" bindpay="pay" bindjoin="join"></sku> <sku show="{{showSku}}" showName="showSku" isActivity="{{isActivity}}" skuData="{{goodsInfo}}" bindpay="pay" bindjoin="join"></sku>
</block> </block>
</block> </block>
<block wx:if="{{showPoster && posterUrl}}">
<view class="model" catchtouchmove="noScroll">
<view class="model-bg" bindtap="hidden"></view>
<view class="poster" bindlongpress='save'>
<image webp src="{{posterUrl}}"></image>
</view>
</view>
</block>
\ No newline at end of file \ No newline at end of file
// packageMall/pages/index/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
/* packageMall/pages/index/index.wxss */
\ No newline at end of file \ No newline at end of file
<!--packageMall/pages/index/index.wxml-->
<text>packageMall/pages/index/index.wxml</text>
...@@ -321,13 +321,6 @@ Page({ ...@@ -321,13 +321,6 @@ Page({
} }
} }
} }
// // 添加推荐人
// const staff = wx.p.storage.get('shareStaff')
// if (staff) {
// let tem = JSON.parse(staff)
// orderParams.shareStaffUuid = tem.shareStaffUuid
// orderParams.shareStaffName = tem.shareStaffName
// }
wx.p.wxApi.showLoading() wx.p.wxApi.showLoading()
wx.p.api.shopmallApi.createOrder(orderParams).then(data => { wx.p.api.shopmallApi.createOrder(orderParams).then(data => {
this.pay(data.orderCode) this.pay(data.orderCode)
...@@ -380,17 +373,6 @@ Page({ ...@@ -380,17 +373,6 @@ Page({
...params, ...params,
success(res) { success(res) {
_this.requestSubscribeMessage() _this.requestSubscribeMessage()
// const staffTrack = wx.p.storage.get('shareStaffTracker')
// if (staffTrack) {
// let tem = JSON.parse(staffTrack)
// tem.item_type = tem.isActivity ? 3 : 1
// tem.action_type = 3
// tem.item_id = tem.id
// tem.order_id = orderCode
// // wx.$util.reportData(tem, false, false, true)
// wx.p.storage.rm('shareStaffTracker')
// }
// wx.p.storage.rm('shareStaff')
}, },
fail(res) { fail(res) {
if (res.errMsg == 'requestPayment:fail cancel') { if (res.errMsg == 'requestPayment:fail cancel') {
......
/* components/Stepper/Stepper.wxss */ /* components/Stepper/Stepper.wxss */
@import '/style/common.wxss'; @import "/assets/style/common.wxss";
.stepper-box { .stepper-box {
display: flex; display: flex;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<view class="nothing-box"> <view class="nothing-box">
<view class="nothing"> <view class="nothing">
<view class="icon"> <view class="icon">
<image webp src="{{IMGURL}}mall/shoppingcart.png?v={{img_version}}" /> <glsx-image webp src="mall/shoppingcart.png" />
</view> </view>
购物车还是空的 购物车还是空的
<view class="btn text-center" bindtap="jump">随便看看</view> <view class="btn text-center" bindtap="jump">随便看看</view>
......
...@@ -16,7 +16,6 @@ Page({ ...@@ -16,7 +16,6 @@ Page({
} }
}, },
onLoad: function (options) { onLoad: function (options) {
console.log(options,'==========')
if (options.id) { if (options.id) {
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: '编辑收货地址' title: '编辑收货地址'
...@@ -54,23 +53,23 @@ Page({ ...@@ -54,23 +53,23 @@ Page({
getLocation() { getLocation() {
let { currentAddress } = this.data let { currentAddress } = this.data
if (currentAddress) return if (currentAddress) return
this.setData({
unauthorized: false
})
wx.getLocation({ wx.getLocation({
type: 'gcj02' type: 'gcj02'
}) })
.then(({ latitude, longitude }) => { .then(({ latitude, longitude }) => {
this.setData({ this.setData({
current: true, current: true
unauthorized: false
}) })
mapApi.detailedAdrress([latitude, longitude]).then(detail => { mapApi.detailedAdrress([latitude, longitude]).then(detail => {
console.log(detail)
this.setData({ this.setData({
currentAddress: detail currentAddress: detail
}) })
}) })
}) })
.catch(err => { .catch(err => {
console.log(err)
wx.p.wxApi.showToast('获取位置失败') wx.p.wxApi.showToast('获取位置失败')
}) })
}, },
...@@ -156,7 +155,6 @@ Page({ ...@@ -156,7 +155,6 @@ Page({
}, },
/**选择地区 */ /**选择地区 */
chooseArea(e) { chooseArea(e) {
console.log(e)
let { value, code } = e.detail let { value, code } = e.detail
let { userObj } = this.data let { userObj } = this.data
userObj.region = [value[0], value[1], value[2]] userObj.region = [value[0], value[1], value[2]]
......
...@@ -9,6 +9,11 @@ ...@@ -9,6 +9,11 @@
padding: var(--margin); padding: var(--margin);
background: #fff; background: #fff;
border-radius:var(--borderRadius); border-radius:var(--borderRadius);
height: 156rpx;
box-sizing: border-box;
.flex{
height: 100%;
}
} }
.current .address-box { .current .address-box {
......
...@@ -2,10 +2,12 @@ ...@@ -2,10 +2,12 @@
<view class="current"> <view class="current">
<block wx:if="{{!current}}"> <block wx:if="{{!current}}">
<block wx:if="{{unauthorized}}"> <block wx:if="{{unauthorized}}">
<view bindtap="authAddress">授权获取当前位置</view> <view class="flex" bindtap="authAddress">授权获取当前位置</view>
</block> </block>
<block wx:else> <block wx:else>
<view class="flex">
获取当前位置中... 获取当前位置中...
</view>
</block> </block>
</block> </block>
<block wx:else> <block wx:else>
......
...@@ -14,7 +14,6 @@ Page({ ...@@ -14,7 +14,6 @@ Page({
let { let {
item item
} = e.currentTarget.dataset } = e.currentTarget.dataset
// console.log(e)
let url = '/packageMine/pages/order/detail/detail' let url = '/packageMine/pages/order/detail/detail'
wx.p.router.go(url, item) wx.p.router.go(url, item)
}, },
...@@ -69,7 +68,6 @@ Page({ ...@@ -69,7 +68,6 @@ Page({
if (!isMerchant) para.merchantId = merchantId if (!isMerchant) para.merchantId = merchantId
wx.p.api.couponsApi.getCardData(para).then(res => { wx.p.api.couponsApi.getCardData(para).then(res => {
wx.hideLoading() wx.hideLoading()
// console.log(res);
let list = res.map(item => { let list = res.map(item => {
item.checkCoupon = false item.checkCoupon = false
item.userCouponList.map((itm, index) => { item.userCouponList.map((itm, index) => {
...@@ -99,7 +97,6 @@ Page({ ...@@ -99,7 +97,6 @@ Page({
}) })
}, },
async onLoad(options) { async onLoad(options) {
console.log(options)
const showLogin = await wx.p.router.intercept(false) const showLogin = await wx.p.router.intercept(false)
this.setData({ this.setData({
showLogin showLogin
......
<view class="success_page"> <view class="success_page">
<!-- <image webp class="success_icon" src="../../../../images/coupons/success.png" /> --> <!-- <image webp class="success_icon" src="../../../../images/coupons/success.png" /> -->
<image webp class="success_icon" src="{{IMGURL}}coupons/success.png?v={{img_version}}" /> <glsx-image webp class="success_icon" src="coupons/success.png" />
<view class="success_text">您的优惠礼券领取成功!</view> <view class="success_text">您的优惠礼券领取成功!</view>
<view class="success_count">{{count}}秒后自动跳转到首页</view> <view class="success_count">{{count}}秒后自动跳转到首页</view>
<view class="success_btn_wrap btn_pos"> <view class="success_btn_wrap btn_pos">
......
...@@ -21,9 +21,6 @@ Page({ ...@@ -21,9 +21,6 @@ Page({
wx.p.router.go(url, { wx.p.router.go(url, {
orderCode: item orderCode: item
}) })
// wx.navigateTo({
// url: '/packageMine/pages/order/detail/detail?orderCode=S2112081509592138'
// })
}, },
state(e) { state(e) {
let { let {
...@@ -160,8 +157,5 @@ Page({ ...@@ -160,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
// packageMine/pages/index/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/index/index.wxss */
\ No newline at end of file \ No newline at end of file
<!--packageMine/pages/index/index.wxml-->
<text>packageMine/pages/index/index.wxml</text>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<view class="item text-center {{item.active?'active':''}}" bindtap="choose" data-index="{{index}}"> <view class="item text-center {{item.active?'active':''}}" bindtap="choose" data-index="{{index}}">
{{afterType[item.value]}} {{afterType[item.value]}}
<view class="icon"> <view class="icon">
<image webp src="{{IMGURL}}mine/active.png?v={{img_version}}"></image> <glsx-image webp src="mine/active.png"></glsx-image>
</view> </view>
</view> </view>
</block> </block>
......
// packageMine/pages/order/components/OrderItem/OrderItem.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
{ {
"component": true,
"usingComponents": {} "usingComponents": {}
} }
\ No newline at end of file \ No newline at end of file
/* packageMine/pages/order/components/OrderItem/OrderItem.wxss */
\ No newline at end of file \ No newline at end of file
<!--packageMine/pages/order/components/OrderItem/OrderItem.wxml-->
<text>packageMine/pages/order/components/OrderItem/OrderItem.wxml</text>
...@@ -41,7 +41,6 @@ Page({ ...@@ -41,7 +41,6 @@ Page({
}, },
} = e.currentTarget.dataset } = e.currentTarget.dataset
if (orderSource == 5 && (orderStatus == 2 || orderStatus == 7)) return if (orderSource == 5 && (orderStatus == 2 || orderStatus == 7)) return
console.log(e)
let url = '/packageMine/pages/order/detail/detail' let url = '/packageMine/pages/order/detail/detail'
wx.p.router.go(url, { wx.p.router.go(url, {
orderCode orderCode
...@@ -66,7 +65,6 @@ Page({ ...@@ -66,7 +65,6 @@ Page({
else wx.p.router.back() else wx.p.router.back()
}, },
changeTab(e) { changeTab(e) {
console.log('e', e)
this.setData({ this.setData({
tabIndex: e.detail, tabIndex: e.detail,
orderStatusPart: orderStatusPartEnum[e.detail], orderStatusPart: orderStatusPartEnum[e.detail],
...@@ -83,7 +81,6 @@ Page({ ...@@ -83,7 +81,6 @@ Page({
let { let {
userInfo userInfo
} = this.data } = this.data
console.log(orderCode)
wx.p.router.go('/packageMall/pages/addComment/addComment', { wx.p.router.go('/packageMall/pages/addComment/addComment', {
orderCode, orderCode,
userInfo, userInfo,
...@@ -96,7 +93,6 @@ Page({ ...@@ -96,7 +93,6 @@ Page({
orderCode orderCode
}, },
} = e.currentTarget.dataset } = e.currentTarget.dataset
console.log(orderCode)
wx.p.router.go('/packageMall/pages/commentDetails/commentDetails', orderCode) wx.p.router.go('/packageMall/pages/commentDetails/commentDetails', orderCode)
}, },
//取消售后 //取消售后
...@@ -223,7 +219,6 @@ Page({ ...@@ -223,7 +219,6 @@ Page({
let list = [] let list = []
wx.p.api.mineApi.getOrderList(obj).then((data) => { wx.p.api.mineApi.getOrderList(obj).then((data) => {
wx.hideLoading() wx.hideLoading()
console.log('data', data)
data?.list?.map((e) => { data?.list?.map((e) => {
let { let {
orderGoods, orderGoods,
...@@ -447,7 +442,6 @@ Page({ ...@@ -447,7 +442,6 @@ Page({
let { let {
orderCode orderCode
} = e.currentTarget.dataset } = e.currentTarget.dataset
console.log(orderCode)
wx.p.router.go('/packageMine/pages/boutiquePages/boutiqueOrder/boutiqueOrder', { wx.p.router.go('/packageMine/pages/boutiquePages/boutiqueOrder/boutiqueOrder', {
orderCode, orderCode,
type: 2, type: 2,
......
<view class="sticky-box "> <view class="sticky-box">
<navigation-bar custom bindnavbarReady="navbarReady" page-title="我的订单"> <navigation-bar custom bindnavbarReady="navbarReady" page-title="我的订单">
<view class="navigation"> <view class="navigation">
<view class="back text-center y-center" bindtap="back"> <view class="back text-center y-center" bindtap="back">
......
...@@ -12,10 +12,11 @@ Page({ ...@@ -12,10 +12,11 @@ Page({
wx.p.wxApi.showLoading() wx.p.wxApi.showLoading()
if (code == '0') { if (code == '0') {
// wx.$Track.setTrack({}, 4) // wx.$Track.setTrack({}, 4)
wx.$authStatus = true wx.$LoginStatus = true
// wx.$util.removeSystemStorage() // wx.$util.removeSystemStorage()
wx.p.storage.rm('userInfo') wx.p.storage.rm('userInfo')
wx.p.storage.rm('sessionId') wx.p.storage.rm('sessionId')
wx.p.storage.rm('isVIP')
wx.p.router.back(prevPage => { wx.p.router.back(prevPage => {
prevPage.setData({ prevPage.setData({
userInfo: null, userInfo: null,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<view class="topCtn" bindtap="goAgreement"> <view class="topCtn" bindtap="goAgreement">
<view class="text">隐私政策</view> <view class="text">隐私政策</view>
<view> <view>
<image webp mode="widthFix" class="setting-icon" src="{{IMGURL}}index/setting-icon.png?v={{img_version}}"></image> <glsx-image webp mode="widthFix" class="setting-icon" src="home/setting-icon.png"></glsx-image>
</view> </view>
</view> </view>
<view class="default-btn x-center" bindtap="logout">退出登录</view> <view class="default-btn x-center" bindtap="logout">退出登录</view>
......
...@@ -38,11 +38,7 @@ Page({ ...@@ -38,11 +38,7 @@ Page({
data, data,
code code
} = await wx.p.api.userApi.login() } = await wx.p.api.userApi.login()
if (code == '0') { if (code == '0') this.customerLoginCallBack(data)
wx.p.storage.set('userInfo', data)
wx.p.storage.set('sessionId', data.sessionId)
wx.p.router.back()
}
if (data) this.sessionId = data.sessionId if (data) this.sessionId = data.sessionId
wx.hideLoading() wx.hideLoading()
}, },
...@@ -130,6 +126,9 @@ Page({ ...@@ -130,6 +126,9 @@ Page({
wx.hideLoading() wx.hideLoading()
} catch (error) { } catch (error) {
this.showTips(error || '服务不可用') this.showTips(error || '服务不可用')
setTimeout(() => {
this.onLoad()
}, 1500)
} }
}, },
/**微信登录 */ /**微信登录 */
...@@ -154,13 +153,15 @@ Page({ ...@@ -154,13 +153,15 @@ Page({
else throw message else throw message
} catch (error) { } catch (error) {
console.log(error) console.log(error)
this.onLoad()
this.showTips(error || '服务不可用') this.showTips(error || '服务不可用')
setTimeout(() => {
this.onLoad()
}, 1500)
} }
}, },
/**C端登录回调 */ /**C端登录回调 */
customerLoginCallBack(data) { customerLoginCallBack(data) {
wx.$authStatus = false wx.$LoginStatus = false
wx.p.storage.set('userInfo', data) wx.p.storage.set('userInfo', data)
wx.p.storage.set('sessionId', data.sessionId) wx.p.storage.set('sessionId', data.sessionId)
// 返回上一页 // 返回上一页
...@@ -168,6 +169,7 @@ Page({ ...@@ -168,6 +169,7 @@ Page({
thisPage && thisPage.setData({ thisPage && thisPage.setData({
userInfo: data userInfo: data
}) })
thisPage.onLoginSuccess && thisPage.onLoginSuccess() //登陆成功后页面回调
}) })
}, },
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<button class="wx-auth-button text-center {{isAgree}}" bindtap="showTips">登录</button> <button class="wx-auth-button text-center {{isAgree}}" bindtap="showTips">登录</button>
</block> </block>
<block wx:else> <block wx:else>
<button open-type="getPhoneNumber" catchgetphonenumber="getPhoneNumber" class="wx-auth-button text-center">微信登录</button> <button open-type="getPhoneNumber" catchgetphonenumber="getPhoneNumber" class="wx-auth-button text-center">登录</button>
</block> </block>
</view> </view>
</block> </block>
......
...@@ -10,13 +10,13 @@ Page({ ...@@ -10,13 +10,13 @@ Page({
data: { data: {
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
async onLoad(options) { async onLoad(options) {
console.log('---------------- 页面初始化 ----------------')
console.log('options参数:', options)
systemApi.getImageVersion() //获取图片版本号 systemApi.getImageVersion() //获取图片版本号
console.log(options, '===')
this.tabList = __wxConfig.tabBar.list this.tabList = __wxConfig.tabBar.list
wx.p.wxApi.showLoading() wx.p.wxApi.showLoading()
//scenc获取页面参数并跳转 //scenc获取页面参数并跳转
...@@ -36,7 +36,7 @@ Page({ ...@@ -36,7 +36,7 @@ Page({
data, data,
message message
} = await wx.p.api.userApi.login() } = await wx.p.api.userApi.login()
wx.$authStatus = code != 0 wx.$LoginStatus = code != 0
if (data) wx.p.storage.set('merchant_info', { if (data) wx.p.storage.set('merchant_info', {
merchantId: data.merchantId, merchantId: data.merchantId,
merchantName: data.merchantName merchantName: data.merchantName
...@@ -48,14 +48,16 @@ Page({ ...@@ -48,14 +48,16 @@ Page({
} else { } else {
wx.p.storage.rm('userInfo') wx.p.storage.rm('userInfo')
wx.p.storage.rm('sessionId') wx.p.storage.rm('sessionId')
} }
console.log(data, '=============') console.log('登陆信息:', data)
if (options.url) { if (options.url) {
return this.jumpPage(options.url) return this.jumpPage(options.url)
} }
// 默认跳转到首页 // 默认跳转到首页
wx.p.router.goHome() wx.p.router.goHome()
} catch (error) { } catch (error) {
wx.$LoginStatus = true //请求失败默认未登录
console.log(error) console.log(error)
wx.p.wxApi.showToast(String(error)) wx.p.wxApi.showToast(String(error))
wx.p.router.goHome() wx.p.router.goHome()
......
...@@ -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,54 @@ Page({ ...@@ -119,44 +122,54 @@ 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' notIntercept: true
}) })
}, },
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, {
notIntercept: true
}) })
}, },
// 定位 // 定位
...@@ -176,7 +189,12 @@ Page({ ...@@ -176,7 +189,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 +251,9 @@ Page({ ...@@ -233,7 +251,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 +266,12 @@ Page({ ...@@ -246,9 +266,12 @@ 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,
notIntercept: true
}) })
}, },
...@@ -264,7 +287,8 @@ Page({ ...@@ -264,7 +287,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 +315,9 @@ Page({ ...@@ -291,7 +315,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 +331,11 @@ Page({ ...@@ -305,7 +331,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 +380,10 @@ Page({ ...@@ -350,7 +380,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,
......
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,7 @@
</block> </block>
</view> </view>
<view wx:if="{{unauthorized}}" class="reLocation_wrap flex_cc"> <view wx:if="{{unauthorized}}" class="reLocation_wrap flex_cc">
<glsx-image webp class="loca_icon" webp src="location_icon.png" /> <glsx-image webp class="loca_icon" webp src="equity/location_icon.png" />
<view bind:tap="relocation" class="loca_text">定位一下,发现附近优惠</view> <view bind:tap="relocation" class="loca_text">定位一下,发现附近优惠</view>
</view> </view>
</view> </view>
......
// pages/tab/index/components/ChannelsModal/ChannelsModal.js
import {
systemApi
} from '~/api/index'
import {
IMG_URL
} from '~/config'
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
showChannels: true
},
/**
* 组件的方法列表
*/
methods: {
noScroll() {},
async init(auto = true) {
const {
finderUserName
} = await wx.p.api.systemApi.getMockData()
this.setData({
finderUserName: finderUserName || 'sph7YsAMEGQixoU'
})
this.getChannelsLiveInfo(auto)
},
getChannelsLiveInfo(auto) {
const _this = this,
{
finderUserName
} = this.data
wx.getChannelsLiveInfo({
finderUserName,
success(liveInfo) {
console.log('视频号直播信息:', liveInfo)
if (liveInfo.status == 3) {
_this.getChannelsLiveNoticeInfo(finderUserName, auto)
liveInfo = null
} else if (!auto) _this.close()
_this.setData({
liveInfo
})
},
fail(err) {
console.log(err)
_this.getChannelsLiveNoticeInfo(finderUserName, auto)
}
})
},
getChannelsLiveNoticeInfo(finderUserName, auto) {
const _this = this
wx.getChannelsLiveNoticeInfo({
finderUserName,
success(liveNoticeInfo) {
console.log('视频号预告信息:', liveNoticeInfo)
let startTime = liveNoticeInfo.startTime * 1e3,
month = new Date(startTime).format('M'),
day = new Date(startTime).format('d'),
time = new Date(startTime).format('hh:mm')
liveNoticeInfo = {
...liveNoticeInfo,
month,
day,
time
}
_this.setData({
liveNoticeInfo
})
if (!auto) _this.close()
},
fail(err) {
console.log('视频号预告信息:', err)
_this.setData({
liveNoticeInfo: null
})
}
})
},
jumpLive() {
const {
liveInfo: {
feedId,
nonceId
},
finderUserName
} = this.data,
_this = this
wx.openChannelsLive({
finderUserName,
feedId,
nonceId,
success(res) {
_this.close()
},
fail(err) {
if (err && err.errMsg && !err.errMsg.includes('cancel')) wx.p.wxApi.showToast(err.errMsg)
}
})
},
reserve() {
this.close()
const {
noticeId
} = this.data.liveNoticeInfo
wx.reserveChannelsLive({
noticeId
})
},
close(e) {
if (e) this.setData({
animation: true
}, setTimeout(() => {
this.setBanner()
}, .8e3))
else this.setBanner()
},
async setBanner() {
const v = await systemApi.getImageVersion() || Date.now()
const {
liveInfo,
liveNoticeInfo,
finderUserName
} = this.data,
bannerImg = `${IMG_URL}home/live/${liveInfo ? 'live' :'notice'}.png?v=${v}`,
thisPage = wx.p.router.getPageInstance()
let {
bannerList
} = thisPage.data,
item = liveInfo || liveNoticeInfo,
obj = {
bannerImg,
bannerType: 'channels',
type: liveInfo ? 1 : 0,
finderUserName,
...item,
}
if (!bannerList) bannerList = []
bannerList.unshift(obj)
thisPage.setData({
bannerList
})
this.setData({
showChannels: false
})
}
},
lifetimes: {
ready() {
this.init()
}
}
})
\ No newline at end of file \ No newline at end of file
{ {
"component": true,
"usingComponents": {} "usingComponents": {}
} }
\ No newline at end of file \ No newline at end of file
/* pages/tab/index/components/ChannelsModal/ChannelsModal.wxss */
.channels {
position: fixed;
width: 100vw;
height: 100vh;
top: 0;
left: 0;
z-index: 101;
&-bg {
width: 100%;
height: 100%;
background-color: rgba($color: #000000, $alpha: .5);
}
&-box {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
width: 590rpx;
background: #8A303A;
border-radius: 16rpx;
animation: show-live-box .5s forwards;
.close {
position: absolute;
top: 20rpx;
right: 20rpx;
width: 36rpx;
height: 36rpx;
z-index: 3;
}
.live-box {
width: 100%;
min-height: 994rpx;
.live-view {
height: 800rpx;
}
.live-info {
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
text-align: center;
padding: 20rpx 55rpx 48rpx;
.text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.channels-btn {
margin: 20rpx auto 0;
}
}
}
.notice-bg {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.notice-box {
min-height: 892rpx;
position: relative;
z-index: 1;
.notice-title {
font-weight: 600;
font-size: 28rpx;
color: #FFFFFF;
letter-spacing: 2rpx;
padding: 24rpx 0;
text-align: center;
}
.notice-head-url {
width: 486rpx;
height: 480rpx;
position: absolute;
top: 112rpx;
left: 50%;
transform: translateX(-50%);
border-radius: 16rpx;
overflow: hidden;
}
.notice-time {
position: absolute;
left: 50%;
bottom: 208rpx;
transform: translateX(-50%);
width: 100%;
font-size: 60rpx;
color: #8A303A;
display: flex;
justify-content: center;
align-items: baseline;
line-height: 72rpx;
.unit {
font-size: 28rpx;
margin: 0 10rpx;
line-height: 40rpx;
}
}
.channels-btn {
position: absolute;
left: 50%;
bottom: 48rpx;
transform: translateX(-50%);
}
}
.channels-btn {
width: 264rpx;
height: 72rpx;
background-image: radial-gradient(circle at 12% 25%, #FFEDC9 0%, #E7AE6E 98%);
border-radius: 12rpx;
font-weight: 600;
font-size: 28rpx;
color: #000000;
letter-spacing: 2rpx;
display: flex;
align-items: center;
justify-content: center;
}
}
}
.true {
animation: close-live-box 1s forwards;
overflow: hidden;
}
@keyframes close-live-box {
0% {
opacity: 1;
}
100% {
height: 140rpx;
opacity: 0;
top: 35%;
left: 0;
}
}
@keyframes show-live-box {
0% {
opacity: 0;
transform: translate(-50%, -50%) scale(.15);
}
100% {
opacity: 1;
transform: translate(-50%, -50%) scale(1);
}
}
\ No newline at end of file \ No newline at end of file
<block wx:if="{{(liveInfo || liveNoticeInfo) && showChannels}}">
<view class="channels {{animation}}" catchtouchmove="noScroll">
<view class="channels-bg"></view>
<view class="channels-box">
<view class="close" bindtap="close">
<glsx-image src="home/live/close.png" />
</view>
<block wx:if="{{liveInfo}}">
<view class="live-box">
<view class="live-view" bindtap="close">
<channel-live feed-id="{{liveInfo.feedId}}" finder-user-name="{{finderUserName}}"></channel-live>
</view>
<view class="live-info">
<view class="text">{{liveInfo.description}}</view>
<view class="channels-btn" bindtap="jumpLive">进入直播间</view>
</view>
</view>
</block>
<block wx:else>
<view class="notice-bg">
<glsx-image src="home/live/notice-bg.png"></glsx-image>
</view>
<view class="notice-box">
<view class="notice-title">
视频号直播预告
</view>
<view class="notice-head-url">
<image src="{{liveNoticeInfo.headUrl}}" />
</view>
<view class="notice-time">
{{liveNoticeInfo.month}}
<view class="unit">月</view>
{{liveNoticeInfo.day}}
<view class="unit day">日</view>
{{liveNoticeInfo.time}}
</view>
<view class="channels-btn" bindtap="reserve">立即预约</view>
</view>
</block>
</view>
</view>
</block>
\ No newline at end of file \ No newline at end of file
...@@ -6,14 +6,23 @@ Component({ ...@@ -6,14 +6,23 @@ Component({
properties: { properties: {
bannerList: { bannerList: {
type: Array, type: Array,
value: [] value: [],
observer(n) {
this.setData({
dotsList: new Array(n.length),
bannerIndex: 0
})
} }
}, },
},
/** /**
* 组件的初始数据 * 组件的初始数据
*/ */
data: {}, data: {
dotsList: [],
bannerIndex: 0
},
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
...@@ -25,6 +34,21 @@ Component({ ...@@ -25,6 +34,21 @@ Component({
equity, equity,
item item
} = e.currentTarget.dataset } = e.currentTarget.dataset
if (item.bannerType == 'channels') {
if (item.type) wx.openChannelsLive({
...item,
success(res) {
console.log(res)
},
fail(err) {
if (err && err.errMsg && !err.errMsg.includes('cancel')) wx.p.wxApi.showToast(err.errMsg)
}
})
else wx.reserveChannelsLive({
noticeId: item.noticeId
})
return
}
if (id) wx.p.router.go('/packageMall/pages/detail/detail', { if (id) wx.p.router.go('/packageMall/pages/detail/detail', {
id, id,
isActivity: false, isActivity: false,
...@@ -35,15 +59,11 @@ Component({ ...@@ -35,15 +59,11 @@ Component({
}, },
changePage(e) { changePage(e) {
let { let {
bannerList current,
} = this.data source
bannerList.map(i => i.active = false)
let {
current
} = e.detail } = e.detail
bannerList[current].active = true if(source == 'autoplay' || source == 'touch') this.setData({
this.setData({ bannerIndex: current
bannerList
}) })
}, },
} }
......
<block> <view class="banner">
<view class="banner"> <swiper class="swiper" bindanimationfinish="changePage" autoplay interval="5000" current="{{bannerIndex}}">
<swiper class="swiper" bindchange="changePage" autoplay interval="5000">
<block wx:for="{{bannerList}}" wx:key="index"> <block wx:for="{{bannerList}}" wx:key="index">
<swiper-item> <swiper-item>
<block>
<image webp src="{{item.bannerImg}}" class="banner-img" bindtap="jumpGoods" data-item="{{item}}" data-bannerType="{{item.bannerType}}" data-id="{{item.goods.id}}" data-url="{{item.linkUrl}}" data-equity="{{item.equity}}"></image> <image webp src="{{item.bannerImg}}" class="banner-img" bindtap="jumpGoods" data-item="{{item}}" data-bannerType="{{item.bannerType}}" data-id="{{item.goods.id}}" data-url="{{item.linkUrl}}" data-equity="{{item.equity}}"></image>
</block>
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
<block wx:if="{{bannerList.length > 1}}"> <block wx:if="{{dotsList.length}}">
<view class="banner-dots"> <view class="banner-dots">
<block wx:for="{{bannerList}}" wx:key="index"> <block wx:for="{{dotsList}}" wx:key="index">
<view class="dots {{item.active?'active':''}}"></view> <view class="dots {{bannerIndex == index?'active':''}}"></view>
</block> </block>
</view> </view>
</block> </block>
</view> </view>
</block>
\ No newline at end of file \ No newline at end of file
...@@ -51,5 +51,5 @@ ...@@ -51,5 +51,5 @@
} }
.banner .banner-dots .dots.active { .banner .banner-dots .dots.active {
background-color: #2A69FF; background-color: var(--btnColor);
} }
\ No newline at end of file \ No newline at end of file
/* components/Tab/Tab.wxss */ /* components/Tab/Tab.wxss */
@import "/style/common.wxss"; @import "/assets/style/common.wxss";
.tab-box { .tab-box {
display: flex; display: flex;
......
...@@ -76,7 +76,10 @@ Component({ ...@@ -76,7 +76,10 @@ Component({
}) })
}, },
toBuyMember() { toBuyMember() {
wx.p.router.go('/packageEquity/pages/open/open') wx.p.router.go('/packageEquity/pages/open/open', {
notIntercept: true
})
}, },
jump() { jump() {
const { const {
......
...@@ -15,7 +15,8 @@ Page({ ...@@ -15,7 +15,8 @@ Page({
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad(options) {
this.getHomeConfig()
this.getActivityList() this.getActivityList()
}, },
getActivityList() { getActivityList() {
...@@ -95,7 +96,7 @@ Page({ ...@@ -95,7 +96,7 @@ Page({
}) })
}, },
//获取banner //获取banner
getHomeConfig() { getHomeConfig(refresh) {
wx.p.api.homeApi.getHomeConfig().then(data => { wx.p.api.homeApi.getHomeConfig().then(data => {
let { let {
noticeContent noticeContent
...@@ -117,6 +118,7 @@ Page({ ...@@ -117,6 +118,7 @@ Page({
bannerList bannerList
}) })
this.filterKfList(data) this.filterKfList(data)
if (refresh) this.selectComponent('#channels').init(false)
}) })
}, },
changeTab(e) { changeTab(e) {
...@@ -128,7 +130,6 @@ Page({ ...@@ -128,7 +130,6 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.getHomeConfig()
}, },
/** /**
...@@ -148,7 +149,7 @@ Page({ ...@@ -148,7 +149,7 @@ Page({
this.setData({ this.setData({
noticeContent: '' noticeContent: ''
}) })
this.getHomeConfig() this.getHomeConfig(true)
this.getActivityList() this.getActivityList()
this.selectComponent('#storeQuity').onPullDownRefresh() this.selectComponent('#storeQuity').onPullDownRefresh()
}, },
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
"good-tab": "./components/good-tab/good-tab", "good-tab": "./components/good-tab/good-tab",
"goods": "./components/goods/goods", "goods": "./components/goods/goods",
"activity": "./components/activity/activity", "activity": "./components/activity/activity",
"customer": "./components/customer/customer" "customer": "./components/customer/customer",
"channels-modal": "./components/ChannelsModal/ChannelsModal"
}, },
"navigationStyle": "custom", "navigationStyle": "custom",
"onReachBottomDistance": 10, "onReachBottomDistance": 10,
......
...@@ -80,3 +80,6 @@ ...@@ -80,3 +80,6 @@
</block> </block>
<!-- 客服 --> <!-- 客服 -->
<customer model:show="{{widgetStatus}}" customerlist="{{customerlist}}"></customer> <customer model:show="{{widgetStatus}}" customerlist="{{customerlist}}"></customer>
<!-- 视频号直播 -->
<channels-modal id="channels" />
...@@ -54,7 +54,6 @@ Page({ ...@@ -54,7 +54,6 @@ Page({
res = await wx.p.api.shopmallApi.getMerchantClassify({ res = await wx.p.api.shopmallApi.getMerchantClassify({
merchantId merchantId
}) })
console.log(res)
let tabList = [{ let tabList = [{
zoneName: '全部', zoneName: '全部',
id: '', id: '',
......
...@@ -78,7 +78,6 @@ Page({ ...@@ -78,7 +78,6 @@ Page({
}) })
} else { } else {
wx.p.api.equityApi.checkOpenMember().then(res => { wx.p.api.equityApi.checkOpenMember().then(res => {
console.log(res, '----------')
let flag = false, let flag = false,
identity = 0 // 普通会员3 银卡2 金卡1 非会员 0 identity = 0 // 普通会员3 银卡2 金卡1 非会员 0
if (res.data && res.data.validitDate) { if (res.data && res.data.validitDate) {
...@@ -124,7 +123,9 @@ Page({ ...@@ -124,7 +123,9 @@ Page({
}, },
// 开通会员页面 // 开通会员页面
toBuyMember() { toBuyMember() {
wx.p.router.go('/packageEquity/pages/open/open') wx.p.router.go('/packageEquity/pages/open/open',{
notIntercept: true
})
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
......
{ {
"description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"setting": { "setting": {
"compileMode": "dynamic",
"urlCheck": true, "urlCheck": true,
"scopeDataCheck": false, "scopeDataCheck": false,
"coverView": true, "coverView": true,
...@@ -36,7 +37,7 @@ ...@@ -36,7 +37,7 @@
"useCompilerPlugins": [ "useCompilerPlugins": [
"sass" "sass"
], ],
"condition": false "condition": true
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"simulatorType": "wechat", "simulatorType": "wechat",
...@@ -59,5 +60,5 @@ ...@@ -59,5 +60,5 @@
"include": [] "include": []
}, },
"appid": "wx2a9f38eb8e39b823", "appid": "wx2a9f38eb8e39b823",
"projectname": "hmd" "projectname": "hmd-0817"
} }
\ No newline at end of file \ No newline at end of file
...@@ -85,13 +85,14 @@ class Router { ...@@ -85,13 +85,14 @@ class Router {
/** /**
* *
* @param {*} auto 是否自动跳转到登录,默认自动跳转 * @param {*} auto 是否自动跳转到登录,默认自动跳转
* @param {*} callBack true未登录 false已登录
*/ */
async intercept(auto = true) { async intercept(auto = true) {
const authStatus = wx.$authStatus; const authStatus = wx.$LoginStatus
if (authStatus) { if (authStatus) {
if (auto) wx.navigateTo({ if (auto) wx.navigateTo({
url: '/pages/Login/Login', url: '/pages/Login/Login',
}); })
return true; return true;
} else { } else {
return false; return false;
......
/**app.wxss**/
.sticky {
position: sticky;
top: 0;
left: 0;
z-index: 2;
background-color: #fff;
}
.flex {
display: flex;
align-items: center;
}
.y-center {
top: 50%;
transform: translateY(-50%);
}
.x-center {
left: 50%;
transform: translateX(-50%);
}
.box-center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.text-two-line {
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.isFullSucreen {
padding-bottom: var(--constantSafeAreaInsetBottom) !important;
padding-bottom: var(--envSafeAreaInsetBottom) !important;
}
.isFullSucreen-bottom {
bottom: var(--constantSafeAreaInsetBottom) !important;
bottom: var(--envSafeAreaInsetBottom) !important;
}
.isFullSucreen-padding-bottom {
padding-bottom: var(--constantSafeAreaInsetBottom) !important;
padding-bottom: var(--envSafeAreaInsetBottom) !important;
}
.default-btn {
width: 686rpx;
height: 88rpx;
background: var(--btnColor);
border-radius: var(--borderRadius);
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: var(--margin);
}
/* .list-nothing {
width: 100%;
padding: 8rpx 0 30rpx;
text-align: center;
font-size: 28rpx;
color: #C1C2C3;
} */
.list-nothing {
width: 100%;
padding: 8rpx 0 30rpx;
text-align: center;
font-size: 24rpx;
color: #858A94;
}
.list-nothing.to-bottom::after {
content: '- 到 底 了 -'
}
.list-nothing .icon {
width: 320rpx;
height: 320rpx;
}
.list-not {
display: flex;
align-items: center;
justify-content: center;
color: #999;
font-size: 24rpx;
height: 100%;
}
.flex_sc {
display: flex;
align-items: center;
}
.store-btn-disabled {
background-image: none;
background: #CCCED1 !important;
color: #fff !important;
}
.store-btn-disabled::after {
border: none;
}
.flex_cc {
display: flex;
align-items: center;
justify-content: center;
}
.flex_scb {
display: flex;
align-items: center;
justify-content: space-between;
}
@keyframes show-box {
0% {
opacity: 0;
transform: scale(2.5);
}
100% {
opacity: 1;
transform: scale(1);
}
}
@keyframes show-box-opacity {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
\ 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!