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 1488 additions and 1429 deletions
......@@ -180,4 +180,19 @@ module.exports = {
...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
......@@ -58,7 +58,7 @@ class Request {
merchantId
} = wx.p.storage.get('merchant_info')
header.merchantId = wx.$merchant_id || merchantId || defaultMerchantId
let projectName = this.getRopProject(params.method)
let projectName = params.projectName
if (!projectName) projectName = this.getRopProject(params.method)
const path = pathEnum[projectName]
params = this.getData(params)
......
......@@ -22,8 +22,7 @@
"selectedColor": "#8A303A",
"backgroundColor": "#FFFFFF",
"borderStyle": "white",
"list": [
{
"list": [{
"pagePath": "pages/tab/index/index",
"text": "首页",
"iconPath": "assets/images/home.png",
......@@ -49,11 +48,9 @@
}
]
},
"subpackages": [
{
"subpackages": [{
"root": "packageIndex",
"pages": [
"pages/index/index",
"pages/bannerJumpPage/bannerJumpPage",
"pages/common/contact/contact",
"pages/serviceCode/serviceCode"
......@@ -62,7 +59,6 @@
{
"root": "packageEquity",
"pages": [
"pages/index/index",
"pages/package/package",
"pages/directional/directional",
"pages/open/open",
......@@ -84,7 +80,6 @@
{
"root": "packageMall",
"pages": [
"pages/index/index",
"pages/shoppingCart/shoppingCart",
"pages/pay/pay",
"pages/detail/detail",
......@@ -95,7 +90,6 @@
{
"root": "packageMine",
"pages": [
"pages/index/index",
"pages/setting/index",
"pages/address/index/index",
"pages/address/detail/detail",
......@@ -132,5 +126,10 @@
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"plugins": {}
"plugins": {
"authorization-plugin": {
"version": "1.0.2",
"provider": "wxe10067a63c1856ac"
}
}
}
\ No newline at end of file
......@@ -121,4 +121,21 @@
100% {
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
/* components/Tab/Tab.wxss */
@import "../../assets/style/common.wxss";
@import "/assets/style/common.wxss";
.tab-box {
display: flex;
......
......@@ -13,31 +13,37 @@ Component({
* 组件的方法列表
*/
methods: {
toDetail(){
let {chargeInfo} = this.data
let query = {
brandName:chargeInfo.brandName,
supplier:chargeInfo.supplier,
icon:chargeInfo.icon
toDetail() {
let {
chargeInfo
} = this.data
let param = {
brandName: chargeInfo.brandName,
supplier: chargeInfo.supplier,
icon: chargeInfo.icon
}
const temp = JSON.stringify(query)
wx.navigateTo({
url: '/packageEquity/pages/commodity/chargeDetail/chargeDetail?param='+temp
wx.p.router.go('/packageEquity/pages/commodity/chargeDetail/chargeDetail', {
param,
notIntercept: true
})
},
toDetailPage(e){
let {item} = e.currentTarget.dataset
let {chargeInfo} = this.data
let query = {
brandName:chargeInfo.brandName,
supplier:chargeInfo.supplier,
id:item.id,
productName:item.productName,
icon:chargeInfo.icon
toDetailPage(e) {
let {
item
} = e.currentTarget.dataset
let {
chargeInfo
} = this.data
let param = {
brandName: chargeInfo.brandName,
supplier: chargeInfo.supplier,
id: item.id,
productName: item.productName,
icon: chargeInfo.icon
}
const temp = JSON.stringify(query)
wx.navigateTo({
url: '/packageEquity/pages/commodity/chargeDetail/chargeDetail?param='+temp
wx.p.router.go('/packageEquity/pages/commodity/chargeDetail/chargeDetail', {
param,
notIntercept: true
})
}
}
......
......@@ -6,7 +6,7 @@ Component({
data: {
curErrorIndex:-1,
curErrorIndex: -1,
},
/**
......@@ -14,37 +14,47 @@ Component({
*/
methods: {
toDetail() {
const { businessInfo, address } = this.data
let query = {
const {
businessInfo,
address
} = this.data
let param = {
supplier: businessInfo.supplier,
brandName: businessInfo.brandName,
lat: address.location.lat,
lng: address.location.lng,
}
const temp = JSON.stringify(query)
wx.navigateTo({
url: '/packageEquity/pages/commodity/detail/detail?param=' + temp
wx.p.router.go('/packageEquity/pages/commodity/detail/detail', {
param,
notIntercept: true
})
},
toDetailPage(e) {
const { item } = e.currentTarget.dataset
const { businessInfo, address } = this.data
let query = {
const {
item
} = e.currentTarget.dataset
const {
businessInfo,
address
} = this.data
let param = {
supplier: businessInfo.supplier,
brandName: businessInfo.brandName,
lat: address.location.lat,
lng: address.location.lng,
id: item.id
}
const temp = JSON.stringify(query)
wx.navigateTo({
url: '/packageEquity/pages/commodity/detail/detail?param=' + temp
wx.p.router.go('/packageEquity/pages/commodity/detail/detail', {
param,
notIntercept: true
})
},
// 打开地图
openMap() {
const { businessInfo } = this.data
const {
businessInfo
} = this.data
wx.openLocation({
latitude: parseFloat(businessInfo.lat),
longitude: parseFloat(businessInfo.lng),
......
......@@ -16,13 +16,14 @@ Component({
value: '',
observer: async function (url, o) {
if (url) {
let isWebp = url.includes('webp')
let checkList = ['https://', 'http://']
let isFullAdd = checkList.map(item => url.includes(item)).some(item => item)
let isBASE64 = url.includes('data:image')
let isWebp = url.includes('webp'),
checkList = ['https://', 'http://'],
isFullAdd = checkList.map(item => url.includes(item)).some(item => item),
isBASE64 = url.includes('data:image'),
v = await systemApi.getImageVersion()
this.setData({
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
import kfMixin from './kfMixin'
import orderMixin from './orderMixin'
import afterSaleMixin from './afterSaleMixin'
import countdownMixin from './countdownMixin'
module.exports = {
kfMixin,
orderMixin,
afterSaleMixin,
countdownMixin
}
......@@ -99,24 +99,25 @@ Page({
const { item } = e.currentTarget.dataset
let url = ''
if (item.appearance == 1) {
let para = {
let param = {
supplier: item.supplier,
brandName: item.brandName,
location: true
}
const temp = JSON.stringify(para)
url = '/packageEquity/pages/commodity/detail/detail?param=' + temp
wx.p.router.go('/packageEquity/pages/commodity/detail/detail',{
param,
notIntercept: true
})
} else if (item.appearance == 2) {
let para = {
let param = {
supplier: item.supplier,
brandName: item.brandName,
icon: item.equityIcon
}
const temp = JSON.stringify(para)
url = '/packageEquity/pages/commodity/chargeDetail/chargeDetail?param=' + temp
wx.p.router.go('/packageEquity/pages/commodity/chargeDetail/chargeDetail',{
param,
notIntercept: true
})
}
wx.navigateTo({
url
})
}
})
{
"usingComponents": {}
"usingComponents": {},
"navigationBarTitleText": "全部服务"
}
\ No newline at end of file
<view class="allEquity-container">
<view style="height:{{cHeight}}px" class="left_wrap">
<block wx:for="{{equityList}}" wx:key="index">
<view bind:tap="slectLeftItem" data-index="{{index}}" class="selecTab flex_cc {{curIndex==index?'actvie_class':''}}">
<text>{{item.goodsCategory}}</text>
<view wx:if="{{curIndex==index}}" class="active_line"></view>
<view style="height:{{cHeight}}px" class="left_wrap">
<block wx:for="{{equityList}}" wx:key="index">
<view bind:tap="slectLeftItem" data-index="{{index}}" class="selecTab flex_cc {{curIndex==index?'actvie_class':''}}">
<text>{{item.goodsCategory}}</text>
<view wx:if="{{curIndex==index}}" class="active_line"></view>
</view>
</block>
</view>
<view style="height:{{cHeight}}px" class="right_wrap">
<scroll-view scroll-y="{{true}}" scroll-with-animation scroll-into-view="{{to}}" bindscroll="scrollViewFn" style="height:{{cHeight}}px">
<block wx:for="{{equityList}}" wx:key="index">
<view id="to-{{index}}" class="scroll_item_wrap">
<view class="scroll_title">{{item.goodsCategory}}</view>
<view class="scroll_content">
<view wx:for="{{item.equityGoodsGroupDescDtos}}" wx:for-item="childItem" wx:for-index="indexs" wx:key="indexs" class="element" data-item="{{childItem}}" bind:tap="toNewPage">
<image webp class="element_icon" mode="widthFix" src="{{childItem.equityIcon}}" />
<view class="element_label common_element_text">
{{childItem.equityName}}
</view>
<view class="element_tip common_element_text">
{{childItem.equityDesc}}
</view>
</view>
</block>
</view>
<view style="height:{{cHeight}}px" class="right_wrap">
<scroll-view scroll-y="{{true}}" scroll-with-animation scroll-into-view="{{to}}" bindscroll="scrollViewFn" style="height:{{cHeight}}px">
<block wx:for="{{equityList}}" wx:key="index">
<view id="to-{{index}}" class="scroll_item_wrap">
<view class="scroll_title">{{item.goodsCategory}}</view>
<view class="scroll_content">
<view wx:for="{{item.equityGoodsGroupDescDtos}}" wx:for-item="childItem" wx:for-index="indexs" wx:key="indexs" class="element" data-item="{{childItem}}" bind:tap="toNewPage">
<image webp class="element_icon" mode="widthFix" src="{{childItem.equityIcon}}" />
<view class="element_label common_element_text">
{{childItem.equityName}}
</view>
<view class="element_tip common_element_text">
{{childItem.equityDesc}}
</view>
</view>
</view>
</view>
</block>
</scroll-view>
</view>
</view>
</view>
</block>
<view class="safe-area isFullSucreen"></view>
</scroll-view>
</view>
</view>
\ No newline at end of file
// pages/chargeWait/chargeWait.js
Page({
/**
* 页面的初始数据
*/
data: {
/**
* 页面的初始数据
*/
data: {
},
},
onLoad: function(options) {
console.log(wx.p);
let query = JSON.parse(options.query)
this.setData({
query
})
},
toOrderList() {
wx.redirectTo({
url:'/packageMine/pages/order/index/index'
})
},
toBack() {
wx.navigateBack({
delta: 1
})
}
onLoad: function (options) {
let query = options.query
this.setData({
query
})
},
toOrderList() {
wx.p.router.redirectTo('/packageMine/pages/order/index/index')
},
toBack() {
wx.p.router.back()
}
})
\ No newline at end of file
......@@ -22,17 +22,19 @@ Page({
if (loadOver) {
return
}
wx.p.wxApi.showLoading()
wx.p.api.equityApi.lasteCommodity(pageParam).then(res => {
if (!res) {
this.setData({
loadOver: true
})
wx.hideLoading()
return
}
let tempArr = []
res.map(item => {
let newArr = []
if (item.chargeGoddsList) {
if (item && item.chargeGoddsList) {
item.chargeGoddsList.forEach(ele => {
ele.denominationList.forEach(info => {
let tempObj = {
......@@ -58,6 +60,7 @@ Page({
loadingMore: false,
loadOver: false
})
wx.hideLoading()
})
},
......
<view class="charge-container-page">
<view class="charge-container-page isFullSucreen">
<block wx:for="{{commodityList}}" wx:key="index">
<commodityItem chargeInfo="{{item}}"/>
</block>
......
import { decimal } from '~/utils/format'
import {
decimal
} from '~/utils/format'
Page({
data: {
curIndex: 0,
......@@ -6,26 +8,28 @@ Page({
isOpen: false,
selectedItem: null,
listData: [],
isGameUse:false,
coupons:null,
showCoupons:false,
isGameUse: false,
coupons: null,
showCoupons: false,
},
// 获取当前商品绑定的优惠券并且处理价格
getCouponsItem(e){
getCouponsItem(e) {
const couponsItem = e.detail
let {selectedItem} = this.data
selectedItem.payCouponsPrice = decimal(selectedItem.lineationPrice-(Number(couponsItem.denomination)), 2)
let {
selectedItem
} = this.data
selectedItem.payCouponsPrice = decimal(selectedItem.lineationPrice - (Number(couponsItem.denomination)), 2)
this.setData({
selectedItem,
coupons:couponsItem
coupons: couponsItem
})
},
toSelectCoupons(){
toSelectCoupons() {
const isLogin = this.checkLogin()
if (!isLogin) {
return
}
if(this.data.isGH)return
if (this.data.isGH) return
this.setData({
showCoupons: true
})
......@@ -36,22 +40,39 @@ Page({
})
},
changeMumberType(e) {
let { selectedItem, listData,coupons } = this.data
const { index } = e.currentTarget.dataset
let {
selectedItem,
listData,
coupons
} = this.data
const {
index
} = e.currentTarget.dataset
selectedItem = listData[index].denominationList[0]
if(coupons){
selectedItem.payCouponsPrice = decimal(selectedItem.lineationPrice-(Number(coupons.denomination)), 2)
if (coupons) {
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) {
const { item, index } = e.currentTarget.dataset
const {
item,
index
} = e.currentTarget.dataset
let richText = decodeURIComponent(item.buysNotes)
richText = richText.replace(/\<span/g, '<span class="rich_text"')
this.setData({ checkedItem: index, selectedItem: item, richText })
this.setData({
checkedItem: index,
selectedItem: item,
richText
})
},
toCheckMember() {
if(this.data.isGameUse)return
if (this.data.isGameUse) return
const SID = wx.p.storage.get('sessionId')
if (!SID) {
return
......@@ -67,27 +88,32 @@ Page({
wx.p.eventbus.off('EQUITYGOODS')
})
},
getChargeDetail(query,options) {
getChargeDetail(query, options) {
let para = {
brandName: query.brandName,
supplier: query.supplier
}
if(this.data.isGameUse){
if (this.data.isGameUse) {
para.id = query.id
}
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) {
setTimeout(()=>{
wx.navigateBack({
delta: 1
});
},1500)
setTimeout(() => {
wx.p.router.back()
}, 1500)
return
}
if (res.length) {
let brandLogo = res[0].brandLogo
query.icon = query.icon?query.icon:brandLogo
query.icon = query.icon ? query.icon : brandLogo
res.forEach(item => {
item.denominationList.map(el => {
if (el.noMemberPrice) {
......@@ -116,7 +142,7 @@ Page({
}
richText = decodeURIComponent(selectedItem.buysNotes)
richText = richText.replace(/\<span/g, '<span class="rich_text"')
if(isGameUse){
if (isGameUse) {
selectedItem.payCouponsPrice = selectedItem.lineationPrice
}
this.setData({
......@@ -128,39 +154,36 @@ Page({
richText,
showLogin: false,
isGameUse,
showComponent:true
},()=>{
if(options.source=='GH'){
showComponent: true
}, () => {
if (options.source == 'GH') {
this.handleEquityOfGH(options.couponsItem)
}
})
})
},
toCoupons() {
wx.navigateTo({
url: '/packageMine/pages/order/index/index'
})
wx.p.router.go('/packageMine/pages/order/index/index')
},
toOpenPage() {
this.modalOnCancel()
wx.navigateTo({
url: '/packageEquity/pages/open/open?page=business'
})
wx.p.router.go('/packageEquity/pages/open/open?page=business')
},
toMemberPage() {
this.toOpenPage()
},
toRecharge() {
const isLogin = this.checkLogin()
if (!isLogin) {
return
}
async toRecharge() {
const loginStatus = await wx.p.router.intercept()
if (loginStatus) return
if (!this.data.rechageNum) {
wx.p.wxApi.showToast('请输入充值账号')
return
}
if(this.data.isGameUse)return this.comfirmBuyItem()
const { noMemberPrice, salesPrice } = this.data.selectedItem
if (this.data.isGameUse) return this.comfirmBuyItem()
const {
noMemberPrice,
salesPrice
} = this.data.selectedItem
let diffPrice = 0
if (noMemberPrice) {
diffPrice = decimal(noMemberPrice - salesPrice, 2)
......@@ -190,7 +213,12 @@ Page({
if (!orderCode) {
return
}
const { selectedItem, rechageNum,isGameUse,coupons } = this.data
const {
selectedItem,
rechageNum,
isGameUse,
coupons
} = this.data
let para = {
orderCode,
goodsId: selectedItem.id,
......@@ -199,7 +227,7 @@ Page({
// payMannerId: 19,
paySource: 3
}
if(isGameUse&&coupons){
if (isGameUse && coupons) {
para.usedCouponIds = [coupons.id]
}
wx.p.api.equityApi.payGoodsOrder(para).then(res => {
......@@ -209,7 +237,13 @@ Page({
},
// 处理支付
handlePay(payData) {
const { timeStamp, nonceStr, packages, signType, paySign } = payData
const {
timeStamp,
nonceStr,
packages,
signType,
paySign
} = payData
let self = this
wx.requestPayment({
timeStamp: timeStamp,
......@@ -219,15 +253,17 @@ Page({
paySign: paySign,
success() {
//跳转商品详情
let { query, selectedItem, rechageNum } = self.data
let obj = {
...query,
...selectedItem,
rechageNum,
}
const temp = JSON.stringify(obj)
wx.navigateTo({
url: '/packageEquity/pages/chargeWait/chargeWait?query=' + temp
let {
query,
selectedItem,
rechageNum
} = self.data
wx.p.router.go('/packageEquity/pages/chargeWait/chargeWait', {
query: {
...query,
...selectedItem,
rechageNum,
}
})
},
fail() {}
......@@ -240,8 +276,8 @@ Page({
})
},
onLoad(options) {
const query = options ? JSON.parse(decodeURIComponent(options.param)) : this.data.query
this.getChargeDetail(query,options)
const query = options.param
this.getChargeDetail(query, options)
this.setNaviTitle(query.brandName)
wx.p.eventbus.on('EQUITYGOODS', data => {
this.toCheckMember()
......@@ -251,12 +287,14 @@ Page({
this.toCheckMember()
},
// 处理广汇权益明细进入的卡券
handleEquityOfGH(couponsItem){
let {selectedItem} = this.data
selectedItem.payCouponsPrice = decimal(selectedItem.lineationPrice-(Number(couponsItem.denomination)), 2)
handleEquityOfGH(couponsItem) {
let {
selectedItem
} = this.data
selectedItem.payCouponsPrice = decimal(selectedItem.lineationPrice - (Number(couponsItem.denomination)), 2)
this.setData({
selectedItem,
coupons:couponsItem
coupons: couponsItem
})
},
// 检测是否已经登录
......@@ -267,7 +305,7 @@ Page({
flag = false
this.setData({
showLogin: true,
showComponent:false
showComponent: false
})
}
return flag
......@@ -277,4 +315,4 @@ Page({
this.toCheckMember()
}
}
})
})
\ No newline at end of file
......@@ -4,7 +4,8 @@ page{
background: white;
}
.detail_container{
padding-bottom: 100rpx;
padding-bottom: calc(120rpx + var(--constantSafeAreaInsetBottom));
padding-bottom: calc(120rpx + var(--envSafeAreaInsetBottom));
}
.account_area {
......@@ -71,7 +72,7 @@ page{
.member_type_item {
height: 80rpx;
width: 188rpx;
min-width: 188rpx;
display: inline-flex;
align-items: center;
justify-content: center;
......@@ -79,6 +80,7 @@ page{
font-size: 28rpx;
color: #B1B1B3;
background-color: #F2F2F2;
padding: 0 20rpx;
}
.activeNav{
......@@ -219,8 +221,8 @@ page{
box-sizing: border-box;
background-color: #fff;
/* padding: 10rpx 30rpx; */
padding: 0 32rpx 0 90rpx;
height: 100rpx;
padding: 20rpx 32rpx 20rpx 90rpx;
min-height: 100rpx;
left: 0;
right: 0;
bottom: 0;
......
import { decimal } from '~/utils/format'
import {
decimal
} from '~/utils/format'
import mapApi from '../../../../utils/mapapi/mapapi'
Page({
data: {
......@@ -10,18 +12,17 @@ Page({
currentIndex: 0,
richText: '',
showModal: false,
noScroll: wx.p.wxApi.noScroll(),
isGameUse:false,
coupons:null,
showCoupons:false,
showComponent:false
isGameUse: false,
coupons: null,
showCoupons: false,
showComponent: false
},
noScroll() {},
onShow: function () {
this.toCheckMember()
},
onLoad: function (options) {
options = JSON.stringify(options)==='{}'?this.options:options
const query = options ? JSON.parse(decodeURIComponent(options.param)) : this.data.query
const query = options.param
this.setNaviTitle(query.brandName)
if (!query.lat) {
const tem = wx.p.storage.get('address_info')
......@@ -38,7 +39,7 @@ Page({
// return
// }
wx.p.wxApi.showLoading()
this.toGetCommodity(query,options)
this.toGetCommodity(query, options)
this.setData({
// unauthorized,
showLogin: false,
......@@ -49,22 +50,26 @@ Page({
})
},
// 处理广汇权益明细进入的卡券
handleEquityOfGH(couponsItem){
let {curentGoodsItem} = this.data
curentGoodsItem.payCouponsPrice = decimal(curentGoodsItem.lineationPrice-(Number(couponsItem.denomination)), 2)
handleEquityOfGH(couponsItem) {
let {
curentGoodsItem
} = this.data
curentGoodsItem.payCouponsPrice = decimal(curentGoodsItem.lineationPrice - (Number(couponsItem.denomination)), 2)
this.setData({
curentGoodsItem,
coupons:couponsItem
coupons: couponsItem
})
},
// 获取当前商品绑定的优惠券并且处理价格
getCouponsItem(e){
getCouponsItem(e) {
const couponsItem = e.detail
let {curentGoodsItem} = this.data
curentGoodsItem.payCouponsPrice = decimal(curentGoodsItem.lineationPrice-(Number(couponsItem.denomination)), 2)
let {
curentGoodsItem
} = this.data
curentGoodsItem.payCouponsPrice = decimal(curentGoodsItem.lineationPrice - (Number(couponsItem.denomination)), 2)
this.setData({
curentGoodsItem,
coupons:couponsItem
coupons: couponsItem
})
},
// 选择优惠券
......@@ -80,7 +85,10 @@ Page({
// },
// 选择商品
selectGoodsItem(e) {
const { index, item } = e.currentTarget.dataset
const {
index,
item
} = e.currentTarget.dataset
let richText = ''
if (item.buysNotes) {
richText = decodeURIComponent(item.buysNotes)
......@@ -97,7 +105,7 @@ Page({
},
// 查询会员开通情况
toCheckMember() {
if(this.data.isGameUse)return
if (this.data.isGameUse) return
const SID = wx.p.storage.get('sessionId')
if (!SID) {
return
......@@ -114,10 +122,17 @@ Page({
})
},
// 获取商品信息
toGetCommodity(query,options) {
let { curentGoodsItem, currentIndex,isGameUse,coupons } = this.data
let tem = {...query}
if(tem.id&&!isGameUse){
toGetCommodity(query, options) {
let {
curentGoodsItem,
currentIndex,
isGameUse,
coupons
} = this.data
let tem = {
...query
}
if (tem.id && !isGameUse) {
delete tem.id
}
wx.p.api.equityApi.commodityMsg(tem).then(res => {
......@@ -147,11 +162,11 @@ Page({
richText = richText.replace(/\<span/g, '<span class="rich_text"')
richText = richText.replace(/\<a/g, '<a class="rich_text_a"')
}
if(isGameUse){
if (isGameUse) {
curentGoodsItem.payCouponsPrice = curentGoodsItem.lineationPrice
}
if(this.data.isGameUse){
tempList = tempList.filter(item=>item.id===query.id)
if (this.data.isGameUse) {
tempList = tempList.filter(item => item.id === query.id)
currentIndex = 0
}
this.setData({
......@@ -162,16 +177,14 @@ Page({
query,
currentIndex,
to: `to-${currentIndex}`,
showComponent:true,
showComponent: true,
showLogin: false
})
if (!tempList.length) {
wx.p.wxApi.showToast('原商品已下架,已为您推荐其他商品')
setTimeout(()=>{
wx.navigateBack({
delta: 1
});
},1500)
setTimeout(() => {
wx.p.router.back()
}, 1500)
return
}
this.toGetCommodityStock(query.id || tempList[0].id)
......@@ -184,7 +197,10 @@ Page({
}
wx.hideLoading()
wx.p.api.equityApi.checkStock(para).then(res => {
const { code, data } = res
const {
code,
data
} = res
let flag = false
if (code == 0 && data != 0) {
flag = true
......@@ -197,22 +213,25 @@ Page({
})
},
toMemberPage() {
wx.navigateTo({
url: '/packageEquity/pages/open/open?page=business'
})
wx.p.router.go('/packageEquity/pages/open/open?page=business')
},
// 去购买
toBuyItem() {
const isLogin = this.checkLogin()
if (!isLogin) {
return
}
const { curentGoodsItem, isHaveInventory,isGameUse } = this.data
async toBuyItem() {
const loginStatus = await wx.p.router.intercept()
if (loginStatus) return
const {
curentGoodsItem,
isHaveInventory,
isGameUse
} = this.data
if (!isHaveInventory) {
return
}
if(isGameUse)return this.comfirmBuyItem()
const { noMemberPrice, salesPrice } = curentGoodsItem
if (isGameUse) return this.comfirmBuyItem()
const {
noMemberPrice,
salesPrice
} = curentGoodsItem
let diffPrice = 0
if (noMemberPrice) {
diffPrice = decimal(noMemberPrice - salesPrice, 2)
......@@ -223,7 +242,7 @@ Page({
})
},
// 确定购买
comfirmBuyItem() {
async comfirmBuyItem() {
wx.p.wxApi.showLoading()
this.toGetCode()
this.modalOnCancel()
......@@ -242,7 +261,11 @@ Page({
if (!orderCode) {
return
}
const { curentGoodsItem,coupons,isGameUse } = this.data
const {
curentGoodsItem,
coupons,
isGameUse
} = this.data
let para = {
orderCode,
goodsId: curentGoodsItem.id,
......@@ -250,7 +273,7 @@ Page({
// payMannerId: 19,
paySource: 3,
}
if(isGameUse&&coupons){
if (isGameUse && coupons) {
para.usedCouponIds = [coupons.id]
}
wx.p.api.equityApi.payGoodsOrder(para).then(res => {
......@@ -260,7 +283,13 @@ Page({
},
// 处理支付
handlePay(payData, orderCode) {
const { timeStamp, nonceStr, packages, signType, paySign } = payData
const {
timeStamp,
nonceStr,
packages,
signType,
paySign
} = payData
let self = this
wx.requestPayment({
timeStamp: timeStamp,
......@@ -270,9 +299,7 @@ Page({
paySign: paySign,
success() {
//跳转商品详情
wx.navigateTo({
url: '/packageEquity/pages/kaqDetail/kaqDetail?orderCode=' + orderCode
})
wx.p.router.go(`/packageEquity/pages/kaqDetail/kaqDetail?orderCode=${orderCode}`)
},
fail() {}
})
......@@ -283,9 +310,7 @@ Page({
})
},
toMyCoupons() {
wx.navigateTo({
url: '/packageMine/pages/order/index/index'
})
wx.p.router.go('/packageMine/pages/order/index/index')
},
openBottomModal() {
this.setData({
......@@ -299,7 +324,9 @@ Page({
},
// /**获取当前位置 */
getLocation(query) {
this.getAddressInfo().then(({ location }) => {
this.getAddressInfo().then(({
location
}) => {
query.lat = location.lat
query.lng = location.lng
this.toGetCommodity(query)
......@@ -310,7 +337,9 @@ Page({
},
// 重新收起获取定位
relocation() {
const { query } = this.data
const {
query
} = this.data
const tem = wx.p.storage.get('address_info')
query.lat = tem ? tem.location.lat : ''
query.lng = tem ? tem.location.lng : ''
......@@ -321,7 +350,9 @@ Page({
return
}
this.toGetCommodity(query)
this.setData({ query })
this.setData({
query
})
},
/**授权失败 */
authFail() {
......@@ -335,7 +366,9 @@ Page({
},
// 打开地图
openMap() {
const { addressInfo } = this.data
const {
addressInfo
} = this.data
if (!addressInfo || !addressInfo.latitude) {
this.relocation()
return
......@@ -352,19 +385,6 @@ Page({
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标签链接
getALabel(str) {
let reg = /(http:\/\/|https:\/\/)((\w|=|\?|\.|\/|&|-)+)/g
......@@ -378,10 +398,8 @@ Page({
toClickRich() {
let str = this.getALabel(this.data.richText)
if (!str) return
const url = encodeURIComponent(str)
wx.navigateTo({
url: '/pages/webView/webView?url=' + url
})
wx.p.router.jumpH5(str)
},
loginCallBack(data) {
if (data) {
......@@ -395,7 +413,10 @@ Page({
else
wx.getLocation({
type: 'gcj02'
}).then(({ latitude, longitude }) => {
}).then(({
latitude,
longitude
}) => {
mapApi.detailedAdrress([latitude, longitude]).then(detail => {
let info = {
...detail,
......@@ -407,4 +428,4 @@ Page({
})
})
}
})
})
\ No newline at end of file
......@@ -44,11 +44,13 @@ Page({
if (loadOver) {
return
}
wx.p.wxApi.showLoading()
wx.p.api.equityApi.lasteCommodity(para).then(res => {
if (!res) {
this.setData({
loadOver: true
})
wx.hideLoading()
return
}
let tempArr = []
......@@ -65,6 +67,7 @@ Page({
loadingMore: 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">
<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>
<block wx:for="{{commodityList}}" wx:key="index">
......
......@@ -125,9 +125,7 @@ Page({
})
},
toMineCoupons() {
wx.navigateTo({
url: '/packageMine/pages/coupon/index/index'
})
wx.p.router.go('/packageMine/pages/coupon/index/index')
},
// 去使用
toUseGifts(e) {
......
......@@ -32,19 +32,8 @@ Page({
}
}
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.router.reLaunch('/pages/tab/shopMall/index?tabIndex=1', { notIntercept: true })
wx.reLaunch({
url: '/pages/tab/equity/index',
});
wx.p.router.reLaunch('/pages/tab/equity/index');
})
},
toGetFreeCardDay(merchantId) {
......@@ -67,9 +56,6 @@ Page({
const userInfo = wx.p.storage.get('userInfo')
let { merchantId, phone } = userInfo
if (!phone) {
return
}
wx.p.wxApi.showLoading()
this.toPostFreeCard(merchantId, phone, userInfo)
},
......@@ -77,85 +63,12 @@ Page({
onLoad(options) {
let system = wx.getSystemInfoSync()
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.setData({
paddingH: system.windowHeight * 0.11,
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 () {
//wx.p.cache.storageApi.customerbehavior(2)
}
})
<view class="freecard_container" style="padding-bottom:{{paddingH}}rpx;box-sizing: border-box;">
<glsx-image webp class="bgIcon"src="equity/freecard_bg_icon.png" />
<view class="wrapper2" style="top:{{textpadding}}rpx">
<view class="dayText">
{{freeDay}}
<text class="mintext">天</text>
</view>
<glsx-image webp class="bottomIcon" mode="widthFix" src="equity/mini_new_freecard_icon_text.png" />
</view>
<view class="wrapper1">
<!-- <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" />
</view>
<view style="height:22rpx"></view>
<view class="wrapper1">
<glsx-image webp class="bottomIcon" webp mode="widthFix" src="equity/new_freecard_icon.png" />
<glsx-image webp class="bgIcon" src="equity/freecard_bg_icon.png" />
<view class="wrapper2" style="top:{{textpadding}}rpx">
<view class="dayText">
{{freeDay}}
<text class="mintext">天</text>
</view>
<glsx-image webp class="bottomIcon" mode="widthFix" src="equity/mini_new_freecard_icon_text.png" />
</view>
<view class="wrapper1">
<!-- <view class="btnText" bind:tap="tofreeReceive">免费领取</view> -->
<glsx-image webp bind:tap="tofreeReceive" webp class="bottomIcon animaiton" mode="widthFix" src="equity/freecard_btn_icon_new.png" />
</view>
<view style="height:22rpx"></view>
<view class="wrapper1">
<glsx-image webp class="bottomIcon" webp mode="widthFix" src="equity/new_freecard_icon.png" />
</view>
</view>
<services/>
\ No newline at end of file
<services />
\ 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
<!--packageEquity/pages/index/index.wxml-->
<text>packageEquity/pages/index/index.wxml</text>
......@@ -7,7 +7,9 @@ Page({
},
getOrderInfo(orderCode) {
wx.p.wxApi.showLoading()
wx.p.api.equityApi.orderDetailData({ orderCode }).then(res => {
wx.p.api.equityApi.orderDetailData({
orderCode
}).then(res => {
wx.hideLoading();
let richText = res.useNotes
res.warrantyDate = res.warrantyDate ? new Date(res.warrantyDate).format('yyyy-MM-dd hh:mm:ss') : ''
......@@ -31,4 +33,4 @@ Page({
wx.p.wxApi.showToast('复制成功')
})
}
})
})
\ No newline at end of file
......@@ -44,15 +44,10 @@ Page({
if (this.data.pageForm == 'oil') {
wx.p.storage.set('refresh_oil_oage', true)
}
wx.navigateBack({
delta: 1
})
wx.p.router.back()
return
}
// wx.$router.reLaunch('/pages/tab/shopMall/index?tabIndex=1')
wx.switchTab({
url: '/pages/tab/equity/index',
});
wx.p.router.switchTab('/pages/tab/equity/index')
}
})
},
......@@ -116,13 +111,7 @@ Page({
this.data.pageForm = options.page
},
toLook() {
wx.navigateTo({
url: '/packageEquity/pages/agreement/index'
})
wx.p.router.go('/packageEquity/pages/agreement/index')
},
// toActive() {
// wx.navigateTo({
// url: '/packageShopmall/packageEquity/pages/active/active'
// })
// }
})
\ No newline at end of file
......@@ -5,6 +5,8 @@ page{
box-sizing: border-box;
padding: 33rpx 0;
position: relative;
padding-bottom: calc(162rpx + var(--constantSafeAreaInsetBottom));
padding-bottom: calc(162rpx + var(--envSafeAreaInsetBottom));
}
.top_widget {
......
<view class="open-container-page">
<view class="top_widget">
<glsx-image webp class="top_icon_bg" webp src="{{IMGURKBASE}}pt_vip_bg.png" />
<view class="card_title">{{memberInfo.equityName}}</view>
<!-- <glsx-image webp mode="widthFix" class="top_icon_bg" webp src="equity/scrm_index_bg.png" />
<view class="top_widget">
<glsx-image webp class="top_icon_bg" webp src="{{IMGURKBASE}}pt_vip_bg.png" />
<view class="card_title">{{memberInfo.equityName}}</view>
<!-- <glsx-image webp mode="widthFix" class="top_icon_bg" webp src="equity/scrm_index_bg.png" />
<view class="mini_title">{{ isOpen ? "已开通" : "未开通" }}</view>
<view class="card_title">{{memberInfo.equityName}}</view>
<view class="card_title_1">尊享100+专属权益</view> -->
</view>
<view class="mid_desc_bg">
<glsx-image webp mode="widthFix" webp class="desc_icon" src="{{IMGURKBASE}}scrm_opening_vip.png" />
</view>
<!-- <glsx-image webp class="device_icon" bind:tap="toActive" mode="widthFix" webp src="equity/scrm_device_bg_new.png" /> -->
<view class="fixed_wrapper isFullSucreen">
<view class="btn_wrap">
<view wx:if="{{!isOpen&&memberInfo.goodPrice}}" class="btn_element btn_element_active" catchtap="openMemberFn">¥{{memberInfo.goodPrice}} 立即开通</view>
<view wx:else class="btn_element">{{ isOpen ? "已开通" : "暂不支持付费购买" }}</view>
</view>
<view class="mid_desc_bg">
<glsx-image webp mode="widthFix" webp class="desc_icon" src="{{IMGURKBASE}}scrm_opening_vip.png" />
<view class="card_desc">
<view class="desc_tip"> 开通权益代表接受</view>
<view class="desc_tip_a" catchtap="toLook"> 《权益服务协议》</view>
</view>
<!-- <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">
<view class="btn_wrap">
<view wx:if="{{!isOpen&&memberInfo.goodPrice}}" class="btn_element btn_element_active" catchtap="openMemberFn">¥{{memberInfo.goodPrice}} 立即开通</view>
<view wx:else class="btn_element">{{ isOpen ? "已开通" : "暂不支持付费购买" }}</view>
</view>
<view class="card_desc">
<view class="desc_tip"> 开通权益代表接受</view>
<view class="desc_tip_a" catchtap="toLook"> 《权益服务协议》</view>
</view>
</view>
<view wx:if="{{openingStatus}}" class="overlay">
<view class="loading_wrapper">
<view class="new_open_loading">
<glsx-image webp class="loading_icon" src="equity/scrm_opening_loading.png" />
<view class="loading_title">支付成功</view>
<view class="loading_title_max">正在开卡中...</view>
<view class="loading_icon_status">
<glsx-image webp class="loading_icon_gif" webp src="equity/loading_icon.gif" />
</view>
</view>
</view>
<view wx:if="{{openingStatus}}" class="overlay">
<view class="loading_wrapper">
<view class="new_open_loading">
<glsx-image webp class="loading_icon" src="equity/scrm_opening_loading.png" />
<view class="loading_title">支付成功</view>
<view class="loading_title_max">正在开卡中...</view>
<view class="loading_icon_status">
<glsx-image webp class="loading_icon_gif" webp src="equity/loading_icon.gif" />
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
......@@ -41,9 +41,13 @@ Page({
},
async onShow() {
this.getPackageDetail(this.packageId)
this.setData({ showAuthBtn: false })
this.setData({
showAuthBtn: false
})
const loginStatus = await wx.p.router.intercept(false)
if (loginStatus) return this.setData({ showAuthBtn: true })
if (loginStatus) return this.setData({
showAuthBtn: true
})
},
// 登录
// login() {
......@@ -65,7 +69,9 @@ Page({
// },
// 设置标题名称
setNaviTitle(tile) {
const { merchantName } = wx.p.storage.get('merchant_info')
const {
merchantName
} = wx.p.storage.get('merchant_info')
wx.setNavigationBarTitle({
title: merchantName
})
......@@ -87,7 +93,9 @@ Page({
// },
// 获取套餐详情
getPackageDetail(id) {
const { merchantId } = wx.p.storage.get('merchant_info')
const {
merchantId
} = wx.p.storage.get('merchant_info')
wx.p.api.couponsApi
.packageInfo({
id,
......@@ -124,7 +132,12 @@ Page({
},
// 创建订单
createStoreOrder(orderCode) {
let { packageId, sessionId, packageInfo, shareStaff } = this.data
let {
packageId,
sessionId,
packageInfo,
shareStaff
} = this.data
let para = {
packageId,
paySource: 3,
......@@ -142,7 +155,13 @@ Page({
wx.p.api.couponsApi.createOrder(para).then(res => {
wx.hideLoading()
if (res) {
const { timeStamp, nonceStr, packages, signType, paySign } = res
const {
timeStamp,
nonceStr,
packages,
signType,
paySign
} = res
wx.requestPayment({
timeStamp: timeStamp,
nonceStr: nonceStr,
......@@ -150,9 +169,8 @@ Page({
signType: signType,
paySign: paySign,
success() {
let temp = JSON.stringify(jumpParam)
wx.navigateTo({
url: '/packageEquity/pages/success/success?order=' + temp
wx.p.router.go('/packageEquity/pages/success/success',{
order: jumpParam
})
// if (_this.data.options) {
// wx.p.cache.storageApi.reportData(_this.data.options, false, true)
......@@ -200,4 +218,4 @@ Page({
onUnload: function () {
// wx.p.cache.storageApi.customerbehavior(2)
}
})
})
\ No newline at end of file
/* packageEquity/pages/package/package.wxss */
.package-container {
width: 100%;
box-sizing: border-box;
padding: 0 32rpx;
}
.top_wrapper {
width: 100%;
height: 160rpx;
background-image: url("https://img02.glsx.com.cn/weapp/resource/miniprogram/glsx/equity/scrm_package_bg.png");
background-size: 100% 160rpx;
box-sizing: border-box;
padding-left: 128rpx;
display: flex;
align-items: center;
font-size: 36rpx;
color: #fff;
}
.title_widget {
width: 100%;
color: #282829;
font-size: 36rpx;
margin: 32rpx 0 24rpx 0;
text-align: center;
font-weight: 500;
}
.title_num {
color: #C57463;
margin: 0 10rpx;
}
.package_content_wrapper {
box-sizing: border-box;
background: #fff;
border-radius: 8rpx;
width: 100%;
padding: 24rpx;
}
.package_element {
position: relative;
height: 82rpx;
margin-bottom: 48rpx;
}
.ele_top {
width: 70%;
color: #282829;
font-size: 28rpx;
font-weight: 500;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.ele_right {
color: #282829;
font-size: 24rpx;
position: absolute;
right: 0;
top: 4rpx;
font-weight: 500;
}
.ele_left {
color: #b1b1b3;
font-size: 24rpx;
position: absolute;
left: 40rpx;
bottom: 0;
}
.ele_bottom {
color: #b1b1b3;
font-size: 24rpx;
position: absolute;
right: 0;
bottom: 0;
}
.content_tip {
color: #656566;
font-size: 22rpx;
box-sizing: border-box;
padding-left: 24rpx;
word-wrap: break-word;
}
.fixed-button-wrap {
position: fixed;
left: 0;
right: 0;
bottom: 0;
background: #F5F5F5;
box-sizing: border-box;
padding: 0 32rpx;
padding-bottom: 40rpx;
padding-top: 20rpx;
}
.button-item {
width: 100%;
height: 88rpx;
background: #892F3B;
border-radius: 8rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: 500;
font-size: 28rpx;
color: #FFFFFF;
}
.grey-btn{
background: #ccc;
}
.auth-button {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
opacity: 0;
z-index: 102;
}
.price_total_title {
font-size: 36rpx;
font-weight: 500;
color: #282829;
margin: 32rpx 0 24rpx 0;
text-align: center;
}
.statistical_wrapper {
/* margin: 0 32rpx; */
box-sizing: border-box;
padding: 32rpx 24rpx;
background: #FFFFFF;
border-radius: 16rpx;
}
.price_line_item {
display: flex;
align-items: center;
}
.line_label {
font-size: 24rpx;
font-weight: 500;
color: #282829;
line-height: 34rpx;
width: 40%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.line_num {
width: 20%;
font-size: 24rpx;
font-weight: 500;
color: #656566;
line-height: 34rpx;
text-align: center;
}
.line_price {
width: 40%;
font-size: 24rpx;
font-weight: 500;
color: #656566;
line-height: 34rpx;
text-align: right;
display: flex;
align-items: center;
justify-content: flex-end;
}
.total_desc {
font-size: 28rpx;
font-weight: 500;
color: #282829;
line-height: 40rpx;
text-align: center;
margin-bottom: 22rpx;
}
.price_text {
font-size: 32rpx;
font-weight: 500;
color: #FC5B32;
line-height: 44rpx;
margin: 0 10rpx;
}
\ No newline at end of file
width: 100%;
box-sizing: border-box;
padding: 0 32rpx;
padding-bottom: calc(128rpx + var(--constantSafeAreaInsetBottom));
padding-bottom: calc(128rpx + var(--envSafeAreaInsetBottom));
}
.top_wrapper {
width: 100%;
height: 160rpx;
background-image: url("https://img02.glsx.com.cn/weapp/resource/miniprogram/glsx/equity/scrm_package_bg.png");
background-size: 100% 160rpx;
box-sizing: border-box;
padding-left: 128rpx;
display: flex;
align-items: center;
font-size: 36rpx;
color: #fff;
}
.title_widget {
width: 100%;
color: #282829;
font-size: 36rpx;
margin: 32rpx 0 24rpx 0;
text-align: center;
font-weight: 500;
}
.title_num {
color: #C57463;
margin: 0 10rpx;
}
.package_content_wrapper {
box-sizing: border-box;
background: #fff;
border-radius: 8rpx;
width: 100%;
padding: 24rpx;
}
.package_element {
position: relative;
height: 82rpx;
margin-bottom: 48rpx;
}
.ele_top {
width: 70%;
color: #282829;
font-size: 28rpx;
font-weight: 500;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.ele_right {
color: #282829;
font-size: 24rpx;
position: absolute;
right: 0;
top: 4rpx;
font-weight: 500;
}
.ele_left {
color: #b1b1b3;
font-size: 24rpx;
position: absolute;
left: 40rpx;
bottom: 0;
}
.ele_bottom {
color: #b1b1b3;
font-size: 24rpx;
position: absolute;
right: 0;
bottom: 0;
}
.content_tip {
color: #656566;
font-size: 22rpx;
box-sizing: border-box;
padding-left: 24rpx;
word-wrap: break-word;
}
.fixed-button-wrap {
position: fixed;
left: 0;
right: 0;
bottom: 0;
background: #F5F5F5;
box-sizing: border-box;
padding: 0 32rpx;
padding-bottom: 40rpx;
padding-top: 20rpx;
}
.button-item {
width: 100%;
height: 88rpx;
background: #892F3B;
border-radius: 8rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: 500;
font-size: 28rpx;
color: #FFFFFF;
}
.grey-btn {
background: #ccc;
}
.auth-button {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
opacity: 0;
z-index: 102;
}
.price_total_title {
font-size: 36rpx;
font-weight: 500;
color: #282829;
margin: 32rpx 0 24rpx 0;
text-align: center;
}
.statistical_wrapper {
/* margin: 0 32rpx; */
box-sizing: border-box;
padding: 32rpx 24rpx;
background: #FFFFFF;
border-radius: 16rpx;
}
.price_line_item {
display: flex;
align-items: center;
}
.line_label {
font-size: 24rpx;
font-weight: 500;
color: #282829;
line-height: 34rpx;
width: 40%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.line_num {
width: 20%;
font-size: 24rpx;
font-weight: 500;
color: #656566;
line-height: 34rpx;
text-align: center;
}
.line_price {
width: 40%;
font-size: 24rpx;
font-weight: 500;
color: #656566;
line-height: 34rpx;
text-align: right;
display: flex;
align-items: center;
justify-content: flex-end;
}
.total_desc {
font-size: 28rpx;
font-weight: 500;
color: #282829;
line-height: 40rpx;
text-align: center;
margin-bottom: 22rpx;
}
.price_text {
font-size: 32rpx;
font-weight: 500;
color: #FC5B32;
line-height: 44rpx;
margin: 0 10rpx;
}
\ No newline at end of file
......@@ -52,5 +52,4 @@
</view>
<view wx:if="{{!packageInfo.isPayFlag&&!showAuthBtn}}" class="button-item grey-btn">非指定用户不可购买</view>
</view>
<view style="height: 164rpx"></view>
</view>
\ No newline at end of file
<view class="package-detail-container">
<view wx:if="{{orderStatus>3}}" class="afterSale_wrapper">
<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>
<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>
<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>
<view wx:if="{{orderStatus==4}}" class="return_message">
......@@ -43,7 +43,7 @@
<view style="height:32rpx"></view>
<view class="wrapper">
<!-- <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> -->
<view class="row_wrap flex_sc">
......
......@@ -46,12 +46,12 @@ Page({
filePath: tempFiles, //选择图片返回的相对路径
encoding: 'base64', //编码格式
success(_res) {
wx.p.wxApi.showLoading('上传中...')
wx.p.api.common.uploadImg({
wx.p.wxApi.showLoading('上传中...')
wx.p.api.common.uploadImg({
file: `${type}@${_res.data}`
})
.then(img => {
wx.p.wxApi.hideLoading()
wx.p.wxApi.hideLoading()
_this.data.upImageURL = []
_this.data.upImageURL.push(img)
_this.setData({
......@@ -66,20 +66,25 @@ Page({
// 提交
sumbit() {
if (this.data.isPackage) {
wx.p.wxApi.showLoading()
wx.p.wxApi.showLoading()
this.packageSumbit()
return
}
if (!this.data.desc) {
wx.p.wxApi.showToast('请输入申请描述')
wx.p.wxApi.showToast('请输入申请描述')
return
}
if (!this.data.upImageURL.length) {
wx.p.wxApi.showToast('请上传图片')
wx.p.wxApi.showToast('请上传图片')
return
}
const { query, desc, upImageURL, isPackage } = this.data
wx.p.wxApi.showLoading()
const {
query,
desc,
upImageURL,
isPackage
} = this.data
wx.p.wxApi.showLoading()
let para = {
orderCode: query.orderCode,
reason: desc,
......@@ -92,12 +97,12 @@ Page({
})
setTimeout(() => {
if (isPackage) {
wx.redirectTo({
url: '/packageEquity/pages/packageDetail/packageDetail?orderCode=' + query.orderCode
wx.p.router.redirectTo('/packageEquity/pages/packageDetail/packageDetail', {
orderCode: query.orderCode
})
} else {
wx.redirectTo({
url: '/packageEquity/pages/saleDetail/saleDetail?orderCode=' + query.orderCode
wx.p.router.redirectTo('/packageEquity/pages/saleDetail/saleDetail', {
orderCode: query.orderCode
})
}
}, 3000)
......@@ -105,7 +110,10 @@ Page({
},
// 套餐提交申请售后
packageSumbit() {
const { query, desc } = this.data
const {
query,
desc
} = this.data
let para = {
orderCode: query.orderCode,
reason: desc
......@@ -116,13 +124,10 @@ Page({
showWaiting: true
})
setTimeout(() => {
wx.redirectTo({
url: '/packageEquity/pages/packageDetail/packageDetail?orderCode=' + query.orderCode
wx.p.router.redirectTo('/packageEquity/pages/packageDetail/packageDetail', {
orderCode: query.orderCode
})
// wx.navigateBack({
// delta: 1
// })
}, 3000)
})
}
})
})
\ No newline at end of file
......@@ -10,43 +10,17 @@ Page({
*/
onLoad: function (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({
order: temp
order: options.order
})
},
toMyCoupons() {
wx.redirectTo({
url: '/packageMine/pages/coupon/index/index'
})
// wx.$router.redirectTo('packageMine.coupon.index', {
// success: true
// })
wx.p.router.redirectTo('/packageMine/pages/coupon/index/index')
},
toHtmlOrder() {
const { orderCode, name } = this.data.order
// const sessionId = wx.$util.getSessionId()
// let merchantId = wx.p.storage.get('srcm_shopmall_merchant_id')
// 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
wx.p.router.redirectTo('/packageEquity/pages/packageDetail/packageDetail',{
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
<view>
{{a}}
<view>{{b}}</view>
<view>{{c}}</view>
<view>{{d}}</view>
</view>
\ No newline at end of file
/* components/Sku/Sku.wxss */
@import '/style/common.wxss';
@import '/assets/style/common.wxss';
.sku {
position: fixed;
......
......@@ -48,9 +48,9 @@ Page({
})
.then(data => {
console.log(data)
let lists = this.unique([...list, ...data.list])
// let lists = this.unique([...list, ...data.list])
this.setData({
list: lists,
list: data.list,
total
})
wx.hideLoading()
......@@ -124,17 +124,18 @@ Page({
useMemberType,
detailInfo
} = options
console.log(userCouponId)
wx.p.wxApi.showLoading('加载中...')
this.setData({
useMemberType,
detailInfo
})
wx.p.api.couponsApi
.getWWCoupon({
userCouponId
if (userCouponId) {
console.log(userCouponId)
this.setData({
useMemberType,
detailInfo
})
.then(res => {
wx.p.api.couponsApi.getWWCoupon({
userCouponId
}).then(res => {
wx.hideLoading()
wx.nextTick(() => {
this.setCouponData(res)
......@@ -145,6 +146,7 @@ Page({
verificationCode: code
})
})
}
if (options && options.couponId) {
console.log(options)
wx.p.wxApi.showLoading('加载中...')
......@@ -171,7 +173,6 @@ Page({
this.setData({
detailInfo: couponInfo
})
// wx.hideLoading()
wx.p.api.couponsApi.getCouponInfo(options).then(res => {
this.setCouponData(res)
this.setData({
......@@ -188,9 +189,9 @@ Page({
} else {
if (callBack) callBack(couponInfo)
}
wx.hideLoading()
})
})
wx.hideLoading()
},
setCouponData(res) {
if (res.receiveStartTime) res.receiveStartTime = new Date(res.receiveStartTime).format('yyyy.MM.dd hh:mm:ss')
......@@ -248,12 +249,12 @@ Page({
message
}) => {
if (code == '0') {
wx.$Track.setTrack({
data,
type: '领取优惠券'
},
7
)
// wx.$Track.setTrack({
// data,
// type: '领取优惠券'
// },
// 7
// )
console.log(data)
if (data.discountType == 3) {
this.jump()
......
// packageMall/pages/detail/detail.js
import {
centsToyuan,
iosTimeFormat
centsToyuan
} from '~/utils/format'
const navStyle = 'background-color: transparent;'
let navBarHeight = 38
import NP from 'number-precision'
import {
countdownMixin
} from '~/mixins/index'
Page({
behaviors: [countdownMixin],
/**
* 页面的初始数据
*/
......@@ -111,11 +115,6 @@ Page({
navStyle: e.scrollTop >= navBarHeight ? '' : navStyle
})
},
goodsActionReady(e) {
this.setData({
padding_bottom: e.detail
})
},
showSkuFun() {
this.setData({
showSku: true
......@@ -127,30 +126,26 @@ Page({
})
},
goodsActionClick(e) {
let type = e.detail
let {
activeSku,
isActivity,
goodsInfo: {
activityStatus,
goodsStock,
buyFlag
}
} = this.data
if (activeSku) {
this.showSkuFun()
return
}
let type = e.detail,
{
activeSku,
isActivity,
goodsInfo: {
activityStatus,
goodsStock,
buyFlag
}
} = this.data
if (activeSku) return this.showSkuFun()
if (isActivity && activityStatus != 2) return
if (goodsStock == 0) return
if (buyFlag == 2) return
if (type == 'pay') {
this.pay()
} else {
this.join()
}
if (type == 'pay') this.pay()
else this.join()
},
pay(e) {
async pay(e) {
const loginStatus = await wx.p.router.intercept()
if (loginStatus) return
let {
isActivity,
isLive,
......@@ -160,12 +155,6 @@ Page({
isDefault
} = this.data
let stock
if (wx.$authStatus) {
wx.navigateTo({
url: '/pages/Login/Login'
})
return
}
let params = {
orderSource: 1
}
......@@ -387,7 +376,14 @@ Page({
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()
} else {
wx.hideLoading()
......@@ -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
wx.p.api.shopmallApi
.getGoodscouponList({
......@@ -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({
*/
onShow: function () {
this.getUserAddressList()
this.getUserAddressDefault()
},
/**
......@@ -522,56 +554,5 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
countDown(params) {
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)
}
noScroll() {}
})
\ No newline at end of file
......@@ -4,7 +4,11 @@
align-items: center;
position: relative;
}
.layout{
padding-bottom: calc(140rpx + var(--constantSafeAreaInsetBottom));
padding-bottom: calc(140rpx + var(--envSafeAreaInsetBottom));
animation: show-box-opacity .5s forwards;
}
.navigation-bar {
position: fixed;
top: 0;
......@@ -40,10 +44,10 @@
.navigation .back {
width: 64rpx;
height: 64rpx;
background: rgba(255, 255, 255, 0.5);
background: #F9F7F7;
border-radius: var(--margin);
position: absolute;
left: 20rpx;
left: 10rpx;
}
.navigation .back .icon {
......@@ -408,8 +412,8 @@
color: #282829;
line-height: 40rpx;
padding: 0 0 20rpx 0;
white-space:normal;
word-break:break-all;
white-space: normal;
word-break: break-all;
}
......@@ -447,7 +451,8 @@
background-color: #333333;
border-radius: 50%;
}
.user-portrait image{
.user-portrait image {
border-radius: 50%;
}
......@@ -481,104 +486,82 @@
background-color: #e7e7e7;
margin-bottom: 10rpx;
}
.goods-comment .comment-images .icon image {
border-radius: 8rpx;
}
.share {
width: 108rpx;
height: 34rpx;
background: rgba(252, 91, 50, 0.1);
border-radius: 4rpx;
height: 44rpx;
background: #EFDEE0;
border-radius: 22rpx;
font-size: 24rpx;
color: var(--btnColor);
line-height: 34rpx;
display: flex;
align-items: center;
position: absolute;
right: 0;
padding-left: 12rpx;
padding-left: 16rpx;
box-sizing: border-box;
&-icon {
width: 20rpx;
height: 22rpx;
margin-left: 8rpx;
}
}
.share text {
flex-shrink: 0;
}
.icon-goods-share {
transform: scale(0.54);
}
.model {
position: fixed;
left: 0;
right: 0;
top: 0;
right: 0;
background: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
bottom: 0;
left: 0;
z-index: 999999;
display: flex;
align-items: 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 {
width: 540rpx;
height: 860rpx;
border-radius: 8rpx;
height: 924rpx;
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 {
min-height: 34rpx;
display: flex;
font-size: 24rpx;
padding: 32rpx 0;
}
.goods-param .items .labels {
width: 136rpx;
color: #656566;
}
.goods-param .items .values {
width: 490rpx;
color: #3B3B3D;
}
.tab-widget{
.tab-widget {
width: 100%;
height: 88rpx;
background: white;
......@@ -588,22 +571,26 @@
right: 0;
z-index: 999;
}
.tab-widget .tab-item{
.tab-widget .tab-item {
width: 50%;
height: 100%;
position: relative;
}
.tab-widget .tab-item .text{
.tab-widget .tab-item .text {
font-size: 28rpx;
color: #656566;
line-height: 40rpx;
}
.tab-widget .tab-item .text-ative{
.tab-widget .tab-item .text-ative {
font-weight: 500;
font-size: 28rpx;
color: #2C2C2C;
}
.tab-widget .tab-item .line{
.tab-widget .tab-item .line {
position: absolute;
left: 50%;
bottom: 0;
......
......@@ -12,7 +12,7 @@
活动重新配置中,请稍后重试
</view>
<block wx:if="{{goodsFlag}}">
<view class="{{posterUrl==''?'layout':'layout hidden'}} " style="padding-bottom:{{padding_bottom + 20}}px;">
<view class="layout">
<view class="banner-box">
<swiper class="banner" bindchange="changeBanner">
<block wx:for="{{goodsInfo.goodsDetailImageList}}" wx:key="index">
......@@ -99,6 +99,12 @@
<view class="flex">
<view class="name"> {{isActivity?goodsInfo.activityName:goodsInfo.goodsName}}
</view>
<view class="share" bindtap="sharePoster">
<text>分享</text>
<view class="share-icon">
<glsx-image src="mall/share.png"></glsx-image>
</view>
</view>
</view>
<block wx:if="{{!isActivity}}">
<view class="count">
......@@ -197,8 +203,16 @@
</block>
<coupon-goods show="{{showCoupon}}" only="{{only}}" couponData="{{couponData}}" bindclick="showCouponFun"></coupon-goods>
<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}}">
<sku show="{{showSku}}" showName="showSku" isActivity="{{isActivity}}" skuData="{{goodsInfo}}" bindpay="pay" bindjoin="join"></sku>
</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
// packageMall/pages/index/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
/* packageMall/pages/index/index.wxss */
\ No newline at end of file
<!--packageMall/pages/index/index.wxml-->
<text>packageMall/pages/index/index.wxml</text>
......@@ -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.api.shopmallApi.createOrder(orderParams).then(data => {
this.pay(data.orderCode)
......@@ -380,17 +373,6 @@ Page({
...params,
success(res) {
_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) {
if (res.errMsg == 'requestPayment:fail cancel') {
......
/* components/Stepper/Stepper.wxss */
@import '/style/common.wxss';
@import "/assets/style/common.wxss";
.stepper-box {
display: flex;
......
......@@ -4,7 +4,7 @@
<view class="nothing-box">
<view class="nothing">
<view class="icon">
<image webp src="{{IMGURL}}mall/shoppingcart.png?v={{img_version}}" />
<glsx-image webp src="mall/shoppingcart.png" />
</view>
购物车还是空的
<view class="btn text-center" bindtap="jump">随便看看</view>
......
......@@ -16,7 +16,6 @@ Page({
}
},
onLoad: function (options) {
console.log(options,'==========')
if (options.id) {
wx.setNavigationBarTitle({
title: '编辑收货地址'
......@@ -54,23 +53,23 @@ Page({
getLocation() {
let { currentAddress } = this.data
if (currentAddress) return
this.setData({
unauthorized: false
})
wx.getLocation({
type: 'gcj02'
})
.then(({ latitude, longitude }) => {
this.setData({
current: true,
unauthorized: false
current: true
})
mapApi.detailedAdrress([latitude, longitude]).then(detail => {
console.log(detail)
this.setData({
currentAddress: detail
})
})
})
.catch(err => {
console.log(err)
wx.p.wxApi.showToast('获取位置失败')
})
},
......@@ -156,7 +155,6 @@ Page({
},
/**选择地区 */
chooseArea(e) {
console.log(e)
let { value, code } = e.detail
let { userObj } = this.data
userObj.region = [value[0], value[1], value[2]]
......
......@@ -9,6 +9,11 @@
padding: var(--margin);
background: #fff;
border-radius:var(--borderRadius);
height: 156rpx;
box-sizing: border-box;
.flex{
height: 100%;
}
}
.current .address-box {
......
......@@ -2,10 +2,12 @@
<view class="current">
<block wx:if="{{!current}}">
<block wx:if="{{unauthorized}}">
<view bindtap="authAddress">授权获取当前位置</view>
<view class="flex" bindtap="authAddress">授权获取当前位置</view>
</block>
<block wx:else>
获取当前位置中...
<view class="flex">
获取当前位置中...
</view>
</block>
</block>
<block wx:else>
......
......@@ -14,7 +14,6 @@ Page({
let {
item
} = e.currentTarget.dataset
// console.log(e)
let url = '/packageMine/pages/order/detail/detail'
wx.p.router.go(url, item)
},
......@@ -69,7 +68,6 @@ Page({
if (!isMerchant) para.merchantId = merchantId
wx.p.api.couponsApi.getCardData(para).then(res => {
wx.hideLoading()
// console.log(res);
let list = res.map(item => {
item.checkCoupon = false
item.userCouponList.map((itm, index) => {
......@@ -99,7 +97,6 @@ Page({
})
},
async onLoad(options) {
console.log(options)
const showLogin = await wx.p.router.intercept(false)
this.setData({
showLogin
......
<view class="success_page">
<!-- <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_count">{{count}}秒后自动跳转到首页</view>
<view class="success_btn_wrap btn_pos">
......
......@@ -21,9 +21,6 @@ Page({
wx.p.router.go(url, {
orderCode: item
})
// wx.navigateTo({
// url: '/packageMine/pages/order/detail/detail?orderCode=S2112081509592138'
// })
},
state(e) {
let {
......@@ -160,8 +157,5 @@ Page({
wx.p.router.go('/packageMine/pages/coupon/detail/detail', {
item
})
wx.navigateTo({
url: '/?item=' + temp
})
}
})
\ 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
/* packageMine/pages/index/index.wxss */
\ No newline at end of file
<!--packageMine/pages/index/index.wxml-->
<text>packageMine/pages/index/index.wxml</text>
......@@ -5,7 +5,7 @@
<view class="item text-center {{item.active?'active':''}}" bindtap="choose" data-index="{{index}}">
{{afterType[item.value]}}
<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>
</block>
......
// packageMine/pages/order/components/OrderItem/OrderItem.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
/* packageMine/pages/order/components/OrderItem/OrderItem.wxss */
\ 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({
},
} = e.currentTarget.dataset
if (orderSource == 5 && (orderStatus == 2 || orderStatus == 7)) return
console.log(e)
let url = '/packageMine/pages/order/detail/detail'
wx.p.router.go(url, {
orderCode
......@@ -66,7 +65,6 @@ Page({
else wx.p.router.back()
},
changeTab(e) {
console.log('e', e)
this.setData({
tabIndex: e.detail,
orderStatusPart: orderStatusPartEnum[e.detail],
......@@ -83,7 +81,6 @@ Page({
let {
userInfo
} = this.data
console.log(orderCode)
wx.p.router.go('/packageMall/pages/addComment/addComment', {
orderCode,
userInfo,
......@@ -96,7 +93,6 @@ Page({
orderCode
},
} = e.currentTarget.dataset
console.log(orderCode)
wx.p.router.go('/packageMall/pages/commentDetails/commentDetails', orderCode)
},
//取消售后
......@@ -223,7 +219,6 @@ Page({
let list = []
wx.p.api.mineApi.getOrderList(obj).then((data) => {
wx.hideLoading()
console.log('data', data)
data?.list?.map((e) => {
let {
orderGoods,
......@@ -447,7 +442,6 @@ Page({
let {
orderCode
} = e.currentTarget.dataset
console.log(orderCode)
wx.p.router.go('/packageMine/pages/boutiquePages/boutiqueOrder/boutiqueOrder', {
orderCode,
type: 2,
......
<view class="sticky-box ">
<view class="sticky-box">
<navigation-bar custom bindnavbarReady="navbarReady" page-title="我的订单">
<view class="navigation">
<view class="back text-center y-center" bindtap="back">
......@@ -67,7 +67,7 @@
</view>
</view>
<!-- !hasUserInfo -->
<view wx:if="{{item.orderGoods.length > 1 && !hasUserInfo}}">
<view wx:if="{{item.orderGoods.length > 1 && !hasUserInfo}}">
<block wx:if="{{item.orderStatus == 5 || item.orderStatus == 8}}">
<block wx:if="{{item.evaluatedFlag == 'Y'}}">
<view class="btn confirm" catchtap="lookevaluate" data-item="{{item}}">查看评价</view>
......
......@@ -12,10 +12,11 @@ Page({
wx.p.wxApi.showLoading()
if (code == '0') {
// wx.$Track.setTrack({}, 4)
wx.$authStatus = true
wx.$LoginStatus = true
// wx.$util.removeSystemStorage()
wx.p.storage.rm('userInfo')
wx.p.storage.rm('sessionId')
wx.p.storage.rm('isVIP')
wx.p.router.back(prevPage => {
prevPage.setData({
userInfo: null,
......
......@@ -3,7 +3,7 @@
<view class="topCtn" bindtap="goAgreement">
<view class="text">隐私政策</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 class="default-btn x-center" bindtap="logout">退出登录</view>
......
......@@ -38,11 +38,7 @@ Page({
data,
code
} = await wx.p.api.userApi.login()
if (code == '0') {
wx.p.storage.set('userInfo', data)
wx.p.storage.set('sessionId', data.sessionId)
wx.p.router.back()
}
if (code == '0') this.customerLoginCallBack(data)
if (data) this.sessionId = data.sessionId
wx.hideLoading()
},
......@@ -130,6 +126,9 @@ Page({
wx.hideLoading()
} catch (error) {
this.showTips(error || '服务不可用')
setTimeout(() => {
this.onLoad()
}, 1500)
}
},
/**微信登录 */
......@@ -154,13 +153,15 @@ Page({
else throw message
} catch (error) {
console.log(error)
this.onLoad()
this.showTips(error || '服务不可用')
setTimeout(() => {
this.onLoad()
}, 1500)
}
},
/**C端登录回调 */
customerLoginCallBack(data) {
wx.$authStatus = false
wx.$LoginStatus = false
wx.p.storage.set('userInfo', data)
wx.p.storage.set('sessionId', data.sessionId)
// 返回上一页
......@@ -168,6 +169,7 @@ Page({
thisPage && thisPage.setData({
userInfo: data
})
thisPage.onLoginSuccess && thisPage.onLoginSuccess() //登陆成功后页面回调
})
},
......
......@@ -25,7 +25,7 @@
<button class="wx-auth-button text-center {{isAgree}}" bindtap="showTips">登录</button>
</block>
<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>
</view>
</block>
......@@ -38,7 +38,7 @@
<input maxlength="11" type="number" adjust-position="{{false}}" placeholder-class="placeholderClass" placeholder="填写手机号" bindinput="input" data-name="mobile" class="input" value="{{mobile}}" />
</view>
<view class="login-item flex">
<input maxlength="4" type="number" adjust-position="{{false}}" placeholder-class="placeholderClass" placeholder="填写验证码" bindinput="input" data-name="captcha" class="input" value="{{captcha}}" />
<input maxlength="4" type="number" adjust-position="{{false}}" placeholder-class="placeholderClass" placeholder="填写验证码" bindinput="input" data-name="captcha" class="input" value="{{captcha}}" />
<button disabled="{{!mobile}}" class="code-btn" bindtap="getSmsCode">{{count? count + 's':'获取验证码'}}</button>
</view>
</view>
......
......@@ -10,13 +10,13 @@ Page({
data: {
},
/**
* 生命周期函数--监听页面加载
*/
async onLoad(options) {
console.log('---------------- 页面初始化 ----------------')
console.log('options参数:', options)
systemApi.getImageVersion() //获取图片版本号
console.log(options, '===')
this.tabList = __wxConfig.tabBar.list
wx.p.wxApi.showLoading()
//scenc获取页面参数并跳转
......@@ -36,7 +36,7 @@ Page({
data,
message
} = await wx.p.api.userApi.login()
wx.$authStatus = code != 0
wx.$LoginStatus = code != 0
if (data) wx.p.storage.set('merchant_info', {
merchantId: data.merchantId,
merchantName: data.merchantName
......@@ -48,14 +48,16 @@ Page({
} else {
wx.p.storage.rm('userInfo')
wx.p.storage.rm('sessionId')
}
console.log(data, '=============')
console.log('登陆信息:', data)
if (options.url) {
return this.jumpPage(options.url)
}
// 默认跳转到首页
wx.p.router.goHome()
} catch (error) {
wx.$LoginStatus = true //请求失败默认未登录
console.log(error)
wx.p.wxApi.showToast(String(error))
wx.p.router.goHome()
......
......@@ -17,8 +17,7 @@ Page({
IMGURKBASE: 'equity/version/1_0_0/',
userInfo: {},
isOpen: true,
menuList: [
{
menuList: [{
title: '惠享生活',
desc: '5折起',
icon: 'share_icon',
......@@ -100,14 +99,18 @@ Page({
onPullDownRefresh() {
this.getShopPackage()
this.toCheckMember()
this.setData(
{
this.setData({
'pageParam.pageSize': 0,
loadingMore: false
},
() => {
let { currentAddress } = this.data
const { lat, lng } = currentAddress.location
let {
currentAddress
} = this.data
const {
lat,
lng
} = currentAddress.location
this.toGetCommodity(lat, lng)
}
)
......@@ -119,44 +122,54 @@ Page({
if (!this.data.commodityList.length) {
return
}
let { pageParam } = this.data
let {
pageParam
} = this.data
pageParam.pageSize++
this.setData(
{
this.setData({
pageParam,
loadingMore: true
},
() => {
let { currentAddress } = this.data
const { lat, lng } = currentAddress.location
let {
currentAddress
} = this.data
const {
lat,
lng
} = currentAddress.location
this.toGetCommodity(lat, lng)
}
)
},
// 新版
openMorePack(e) {
const { show } = e.currentTarget.dataset
const {
show
} = e.currentTarget.dataset
this.setData({
showMorePack: !show
})
},
// 页面跳转
// toAllEquityPage() {
// wx.navigateTo({
// url: '/packageEquity/pages/allEquity/allEquity'
// })
// wx.p.router.go('/packageEquity/pages/allEquity/allEquity')
// },
toBuyMember() {
wx.navigateTo({
url: '/packageEquity/pages/open/open'
wx.p.router.go('/packageEquity/pages/open/open', {
notIntercept: true
})
},
toNewPage(e) {
const { index, item } = e.currentTarget.dataset
wx.navigateTo({
url: item.url
const {
index,
item
} = e.currentTarget.dataset
wx.p.router.go(item.url, {
notIntercept: true
})
},
// 定位
......@@ -176,7 +189,12 @@ Page({
// 获取附近优惠数据
toGetCommodity(lat, lng, page) {
let { pageParam, loadingMore, commodityList, loadOver } = this.data
let {
pageParam,
loadingMore,
commodityList,
loadOver
} = this.data
let para = {
lat,
lng,
......@@ -233,7 +251,9 @@ Page({
},
// 获取门店套餐
getShopPackage() {
const { merchantId } = wx.p.storage.get('merchant_info')
const {
merchantId
} = wx.p.storage.get('merchant_info')
let para = {
merchantId
}
......@@ -246,9 +266,12 @@ Page({
// 去套餐详情页
toPackageDetail(e) {
const { id } = e.currentTarget.dataset
wx.navigateTo({
url: '/packageEquity/pages/package/package?id=' + id
const {
id
} = e.currentTarget.dataset
wx.p.router.go('/packageEquity/pages/package/package', {
id,
notIntercept: true
})
},
......@@ -264,7 +287,8 @@ Page({
return
}
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) {
res.data.time = new Date(res.data.validitDate).format('yyyy.MM.dd')
}
......@@ -291,7 +315,9 @@ Page({
// 获取门店会员卡信息
getMemberCardData() {
const { merchantId } = wx.p.storage.get('merchant_info')
const {
merchantId
} = wx.p.storage.get('merchant_info')
let para = {
merchantId
}
......@@ -305,7 +331,11 @@ Page({
// 处理免费领取权益页面带来的参数---弹框显示
handleFreeCard(bindInfo) {
wx.p.storage.rm('bindInfo')
const { code, errId, message } = bindInfo
const {
code,
errId,
message
} = bindInfo
if (code == 0) {
wx.showModal({
title: '提示',
......@@ -350,7 +380,10 @@ Page({
else
wx.getLocation({
type: 'gcj02'
}).then(({ latitude, longitude }) => {
}).then(({
latitude,
longitude
}) => {
mapApi.detailedAdrress([latitude, longitude]).then(detail => {
let info = {
...detail,
......@@ -362,4 +395,4 @@ Page({
})
})
}
})
})
\ No newline at end of file
......@@ -241,7 +241,7 @@
</block>
</view>
<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>
</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
/* 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
<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
......@@ -6,14 +6,23 @@ Component({
properties: {
bannerList: {
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({
equity,
item
} = 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', {
id,
isActivity: false,
......@@ -35,15 +59,11 @@ Component({
},
changePage(e) {
let {
bannerList
} = this.data
bannerList.map(i => i.active = false)
let {
current
current,
source
} = e.detail
bannerList[current].active = true
this.setData({
bannerList
if(source == 'autoplay' || source == 'touch') this.setData({
bannerIndex: current
})
},
}
......
<block>
<view class="banner">
<swiper class="swiper" bindchange="changePage" autoplay interval="5000">
<block wx:for="{{bannerList}}" wx:key="index">
<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>
</block>
</swiper-item>
</block>
</swiper>
<block wx:if="{{bannerList.length > 1}}">
<view class="banner-dots">
<block wx:for="{{bannerList}}" wx:key="index">
<view class="dots {{item.active?'active':''}}"></view>
</block>
</view>
<view class="banner">
<swiper class="swiper" bindanimationfinish="changePage" autoplay interval="5000" current="{{bannerIndex}}">
<block wx:for="{{bannerList}}" wx:key="index">
<swiper-item>
<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>
</swiper-item>
</block>
</swiper>
<block wx:if="{{dotsList.length}}">
<view class="banner-dots">
<block wx:for="{{dotsList}}" wx:key="index">
<view class="dots {{bannerIndex == index?'active':''}}"></view>
</block>
</view>
</block>
</block>
</view>
\ No newline at end of file
......@@ -51,5 +51,5 @@
}
.banner .banner-dots .dots.active {
background-color: #2A69FF;
background-color: var(--btnColor);
}
\ No newline at end of file
/* components/Tab/Tab.wxss */
@import "/style/common.wxss";
@import "/assets/style/common.wxss";
.tab-box {
display: flex;
......
......@@ -76,7 +76,10 @@ Component({
})
},
toBuyMember() {
wx.p.router.go('/packageEquity/pages/open/open')
wx.p.router.go('/packageEquity/pages/open/open', {
notIntercept: true
})
},
jump() {
const {
......
......@@ -15,7 +15,8 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad(options) {
this.getHomeConfig()
this.getActivityList()
},
getActivityList() {
......@@ -95,7 +96,7 @@ Page({
})
},
//获取banner
getHomeConfig() {
getHomeConfig(refresh) {
wx.p.api.homeApi.getHomeConfig().then(data => {
let {
noticeContent
......@@ -117,6 +118,7 @@ Page({
bannerList
})
this.filterKfList(data)
if (refresh) this.selectComponent('#channels').init(false)
})
},
changeTab(e) {
......@@ -128,7 +130,6 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getHomeConfig()
},
/**
......@@ -148,7 +149,7 @@ Page({
this.setData({
noticeContent: ''
})
this.getHomeConfig()
this.getHomeConfig(true)
this.getActivityList()
this.selectComponent('#storeQuity').onPullDownRefresh()
},
......
......@@ -6,7 +6,8 @@
"good-tab": "./components/good-tab/good-tab",
"goods": "./components/goods/goods",
"activity": "./components/activity/activity",
"customer": "./components/customer/customer"
"customer": "./components/customer/customer",
"channels-modal": "./components/ChannelsModal/ChannelsModal"
},
"navigationStyle": "custom",
"onReachBottomDistance": 10,
......
......@@ -79,4 +79,7 @@
</view>
</block>
<!-- 客服 -->
<customer model:show="{{widgetStatus}}" customerlist="{{customerlist}}"></customer>
\ No newline at end of file
<customer model:show="{{widgetStatus}}" customerlist="{{customerlist}}"></customer>
<!-- 视频号直播 -->
<channels-modal id="channels" />
......@@ -54,7 +54,6 @@ Page({
res = await wx.p.api.shopmallApi.getMerchantClassify({
merchantId
})
console.log(res)
let tabList = [{
zoneName: '全部',
id: '',
......
......@@ -78,7 +78,6 @@ Page({
})
} else {
wx.p.api.equityApi.checkOpenMember().then(res => {
console.log(res, '----------')
let flag = false,
identity = 0 // 普通会员3 银卡2 金卡1 非会员 0
if (res.data && res.data.validitDate) {
......@@ -124,7 +123,9 @@ Page({
},
// 开通会员页面
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",
"setting": {
"compileMode": "dynamic",
"urlCheck": true,
"scopeDataCheck": false,
"coverView": true,
......@@ -36,7 +37,7 @@
"useCompilerPlugins": [
"sass"
],
"condition": false
"condition": true
},
"compileType": "miniprogram",
"simulatorType": "wechat",
......@@ -59,5 +60,5 @@
"include": []
},
"appid": "wx2a9f38eb8e39b823",
"projectname": "hmd"
"projectname": "hmd-0817"
}
\ No newline at end of file
......@@ -85,13 +85,14 @@ class Router {
/**
*
* @param {*} auto 是否自动跳转到登录,默认自动跳转
* @param {*} callBack true未登录 false已登录
*/
async intercept(auto = true) {
const authStatus = wx.$authStatus;
const authStatus = wx.$LoginStatus
if (authStatus) {
if (auto) wx.navigateTo({
url: '/pages/Login/Login',
});
})
return true;
} else {
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
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!