Commit 716f4e3f by 李伟康

提交

1 parent 1fc672bc
......@@ -27,6 +27,7 @@ module.exports = {
...data
})
},
/**领取优惠券 */
toReciveCard(data) {
let {
......
import api from '../request/http'
module.exports = {
getServiceCode(data) {
return api.fetch('dracIm.api.entmicro.findMiniProgramIm',data)
}
}
\ No newline at end of file
......@@ -8,6 +8,7 @@ import systemApi from './system'
import couponsApi from './coupons'
import equityApi from './equity'
import common from './common'
import entmicroApi from './entmicro'
module.exports = {
wechatApi,
......@@ -19,5 +20,6 @@ module.exports = {
systemApi,
couponsApi,
equityApi,
common
common,
entmicroApi
}
\ No newline at end of file
......@@ -54,7 +54,9 @@
"root": "packageIndex",
"pages": [
"pages/index/index",
"pages/bannerJumpPage/bannerJumpPage"
"pages/bannerJumpPage/bannerJumpPage",
"pages/common/contact/contact",
"pages/serviceCode/serviceCode"
]
},
{
......@@ -86,7 +88,8 @@
"pages/shoppingCart/shoppingCart",
"pages/pay/pay",
"pages/detail/detail",
"pages/search/search"
"pages/search/search",
"pages/coupon/coupon"
]
},
{
......
......@@ -48,7 +48,7 @@ module.exports = Behavior({
},
fail({ errMsg }) {
console.log(errMsg)
wx.$api.showToast(errMsg)
wx.p.wxApi.showToast(errMsg)
}
})
else
......
......@@ -22,7 +22,7 @@ Page({
})
if (options.showToast) {
setTimeout(()=>{
wx.$api.showToast('原商品及品牌均已下架,您可查看其他权益商品')
wx.p.wxApi.showToast('原商品及品牌均已下架,您可查看其他权益商品')
},500)
}
},
......
......@@ -30,7 +30,7 @@ Page({
})
})
.catch(err => {
// wx.$api.showToast('获取位置失败')
// wx.p.wxApi.showToast('获取位置失败')
})
},
// 获取附近优惠数据
......
......@@ -58,8 +58,8 @@ Page({
},
// 去购买会员
async openMemberFn() {
const loginStatu = await wx.p.router.intercept()
if (loginStatu) return
const loginStatus = await wx.p.router.intercept()
if (loginStatus) return
const {
memberInfo
} = this.data
......
......@@ -166,7 +166,7 @@ Page({
},
// 客户id
handlerCustomerId() {
// let customerId = wx.$storage.get('srcm_shopmall_customer_id')
// let customerId = wx.p.storage.get('srcm_shopmall_customer_id')
// if (customerId) wx.p.api.userApi.updataCustomerPhone()
},
// 价格格式化
......
......@@ -28,7 +28,7 @@ Page({
toHtmlOrder() {
const { orderCode, name } = this.data.order
// const sessionId = wx.$util.getSessionId()
// let merchantId = wx.$storage.get('srcm_shopmall_merchant_id')
// let merchantId = wx.p.storage.get('srcm_shopmall_merchant_id')
// merchantId = merchantId || defaultMerchantId
// let para = {
// sessionId,
......
// pages/serviceCode/serviceCode.js
Page({
/**
* 页面的初始数据
*/
data: {
list: ['业务问题解答', '维修保养预约', '专属权益提醒', '海量优惠活动'],
},
refresh() {
if (this.isClick) return
this.isClick = true
let userInfo = wx.p.storage.get('userInfo')
if (userInfo) {
this.getServiceCode()
return
}
this.setData({
showLogin: true
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if (options) {
this.setData({
options
})
// wx.$Track.setTrack(
// {
// options,
// type: '进入员工活码生成页面'
// },
// 6
// )
}
this.getServiceCode()
},
longtap() {
let {
options
} = this.data
// wx.$Track.setTrack(
// {
// options,
// type: '长按识别员工活码'
// },
// 7
// )
},
async getServiceCode() {
const loginStatus = await wx.p.router.intercept()
if (loginStatus) return
wx.p.wxApi.showLoading('加载中...')
let {
options
} = this.data
let userInfo = wx.p.storage.get('userInfo')
wx.p.api.entmicroApi
.findByActivityIdAndPhone({
...options,
phone: userInfo.phone
})
.then(({
code,
data,
message
}) => {
wx.hideLoading()
if (code == '0') {
this.setData({
detail: data,
userInfo
})
} else {
wx.showModal({
title: '提示',
content: message,
confirmText: '重试',
cancelText: '知道了',
confirmColor: '#F13C3D'
}).then(res => {
if (res.confirm) {
this.getServiceCode()
}
})
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {}
})
\ No newline at end of file
{
"navigationBarTitleText": "联系我"
}
\ No newline at end of file
.layout {
padding: 40rpx 40rpx 100rpx;
}
.layout .logo {
width: 190rpx;
height: 48rpx;
margin-bottom: 32rpx;
}
.layout .box {
height: 1068rpx;
background: #ffffff;
border-radius: 16rpx;
box-sizing: border-box;
padding: 32rpx;
}
.box .merchant {
font-size: 36rpx;
color: #333333;
font-weight: 600;
}
.box .merchant .icon {
width: 96rpx;
height: 96rpx;
border-radius: 100%;
overflow: hidden;
margin-right: 16rpx;
flex-shrink: 0;
}
.box .merchant .name {
animation: show-text 2s forwards;
}
@keyframes show-text {
0% {
width: 0;
}
100% {
width: calc(100% - 112rpx);
}
}
.box .qr-box {
height: 624rpx;
/* background: #f8f8f8; */
border-radius: 16rpx;
margin: 32rpx 0 48rpx;
flex-direction: column;
justify-content: center;
}
.box .qr-box .text {
font-size: 28rpx;
color: #727272;
width: 450rpx;
text-align: left;
}
.qr-box .icon {
width: 42rpx;
height: 48rpx;
margin: 32rpx 0 26rpx;
}
.qr-box .qr {
width: 310rpx;
height: 310rpx;
background-color: #fff;
position: relative;
}
.qr-box .qr .btn{
position: absolute;
width: 112rpx;
height: 112rpx;
}
.qr-box .refresh{
color: #5850FF;
font-size: 24rpx;
margin: 8rpx 0 12rpx;
}
.box .title {
font-size: 28rpx;
color: #c2c2c2;
text-align: center;
margin-bottom: 32rpx;
}
.box .list {
display: grid;
grid-template-columns: repeat(2, 1fr);
font-size: 28rpx;
color: #727272;
gap: 20rpx 0;
}
.box .list .item .icon {
width: 24rpx;
height: 24rpx;
margin-right: 8rpx;
}
.layout > .tips {
font-size: 24rpx;
color: #a2a2a2;
margin-top: 64rpx;
text-align: center;
}
<view class="layout">
<view class="box">
<view class="merchant flex">
<view class="icon">
<glsx-image webp src="pages/default-merchant.png"></glsx-image>
</view>
<block wx:if="{{detail.merchantName}}">
<view class="name text-hide">{{detail.merchantName}}</view>
</block>
</view>
<view class="qr-box flex">
<view class="text">“您好,我是您的专属服务顾问。长按识别二维码,添加我的企业微信”</view>
<view class="icon">
<glsx-image webp src="pages/qr-icon.png"></glsx-image>
</view>
<view class="qr">
<glsx-image webp src="{{detail.url || 'pages/qr.png'}}" show-menu-by-longpress="{{detail.url}}" bindlongtap="longtap"></glsx-image>
<block wx:if="{{!userInfo || !detail.url}}">
<view class="btn box-center" bindtap="refresh">
<glsx-image webp src="pages/btn.png"></glsx-image>
</view>
</block>
</view>
<block wx:if="{{!userInfo}}">
<view class="refresh">
点击刷新,重新授权
</view>
</block>
</view>
<view class="title">— 添加我的企业微信可获得以下服务 —</view>
<view class="list">
<block wx:for="{{list}}" wx:key="index">
<view class="item text-center">
<view class="icon">
<glsx-image webp src="pages/active-icon.png"></glsx-image>
</view>
{{item}}
</view>
</block>
</view>
</view>
<view class="tips">—— 顾客至上 服务第一 ——</view>
</view>
\ No newline at end of file
// pages/serviceCode/serviceCode.js
Page({
/**
* 页面的初始数据
*/
data: {
list: ['业务问题解答', '维修保养预约', '专属权益提醒', '海量优惠活动'],
},
refresh() {
if (this.isClick) return
this.isClick = true
let userInfo = wx.p.storage.get('userInfo')
if (userInfo) {
this.getServiceCode()
return
}
this.setData({
showLogin: true
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if (options) {
this.setData({
options
})
// wx.$Track.setTrack(
// {
// options,
// type: '进入员工活码生成页面'
// },
// 6
// )
}
this.getServiceCode()
},
longtap() {
let {
options
} = this.data
// wx.$Track.setTrack(
// {
// options,
// type: '长按识别员工活码'
// },
// 7
// )
},
async getServiceCode() {
const loginStatus = await wx.p.router.intercept()
if (loginStatus) return
wx.p.wxApi.showLoading('加载中...')
let {
options
} = this.data
let userInfo = wx.p.storage.get('userInfo')
wx.p.api.entmicroApi
.findByActivityIdAndPhone({
...options,
phone: userInfo.phone
})
.then(({
code,
data,
message
}) => {
wx.hideLoading()
if (code == '0') {
this.setData({
detail: data,
userInfo
})
} else {
wx.showModal({
title: '提示',
content: message,
confirmText: '重试',
cancelText: '知道了',
confirmColor: '#F13C3D'
}).then(res => {
if (res.confirm) {
this.getServiceCode()
}
})
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {}
})
\ No newline at end of file
{
"navigationBarTitleText": "联系我"
}
\ No newline at end of file
/* pages/serviceCode/serviceCode.wxss */
.layout {
padding: 40rpx 40rpx 100rpx;
}
.layout .logo {
width: 190rpx;
height: 48rpx;
margin-bottom: 32rpx;
}
.layout .box {
height: 1068rpx;
background: #ffffff;
border-radius: 16rpx;
box-sizing: border-box;
padding: 32rpx;
}
.box .merchant {
font-size: 36rpx;
color: #333333;
font-weight: 600;
}
.box .merchant .icon {
width: 96rpx;
height: 96rpx;
border-radius: 100%;
overflow: hidden;
margin-right: 16rpx;
flex-shrink: 0;
}
.box .merchant .name {
animation: show-text 2s forwards;
}
@keyframes show-text {
0% {
width: 0;
}
100% {
width: calc(100% - 112rpx);
}
}
.box .qr-box {
height: 624rpx;
/* background: #f8f8f8; */
border-radius: 16rpx;
margin: 32rpx 0 48rpx;
flex-direction: column;
justify-content: center;
}
.box .qr-box .text {
font-size: 28rpx;
color: #727272;
width: 450rpx;
text-align: left;
}
.qr-box .icon {
width: 42rpx;
height: 48rpx;
margin: 32rpx 0 26rpx;
}
.qr-box .qr {
width: 310rpx;
height: 310rpx;
background-color: #fff;
position: relative;
}
.qr-box .qr .btn{
position: absolute;
width: 112rpx;
height: 112rpx;
}
.qr-box .refresh{
color: #5850FF;
font-size: 24rpx;
margin: 8rpx 0 12rpx;
}
.box .title {
font-size: 28rpx;
color: #c2c2c2;
text-align: center;
margin-bottom: 32rpx;
}
.box .list {
display: grid;
grid-template-columns: repeat(2, 1fr);
font-size: 28rpx;
color: #727272;
gap: 20rpx 0;
}
.box .list .item .icon {
width: 24rpx;
height: 24rpx;
margin-right: 8rpx;
}
.layout > .tips {
font-size: 24rpx;
color: #a2a2a2;
margin-top: 64rpx;
text-align: center;
}
<view class="layout">
<view class="box">
<view class="merchant flex">
<view class="icon">
<glsx-image webp src="pages/default-merchant.png"></glsx-image>
</view>
<block wx:if="{{detail.merchantName}}">
<view class="name text-hide">{{detail.merchantName}}</view>
</block>
</view>
<view class="qr-box flex">
<view class="text">“您好,我是您的专属服务顾问。长按识别二维码,添加我的企业微信”</view>
<view class="icon">
<glsx-image webp src="pages/qr-icon.png"></glsx-image>
</view>
<view class="qr">
<glsx-image webp src="{{detail.url || 'pages/qr.png'}}" show-menu-by-longpress="{{detail.url}}" bindlongtap="longtap"></glsx-image>
<block wx:if="{{!userInfo || !detail.url}}">
<view class="btn box-center" bindtap="refresh">
<glsx-image webp src="pages/btn.png"></glsx-image>
</view>
</block>
</view>
<block wx:if="{{!userInfo}}">
<view class="refresh">
点击刷新,重新授权
</view>
</block>
</view>
<view class="title">— 添加我的企业微信可获得以下服务 —</view>
<view class="list">
<block wx:for="{{list}}" wx:key="index">
<view class="item text-center">
<view class="icon">
<glsx-image webp src="pages/active-icon.png"></glsx-image>
</view>
{{item}}
</view>
</block>
</view>
</view>
<view class="tips">—— 顾客至上 服务第一 ——</view>
</view>
\ No newline at end of file
// packageMall/pages/coupon/coupon.js
import {
wxqrcode as QR
} from "~/lib/index";
Page({
/**
* 页面的初始数据
*/
data: {
shareStaff: {},
discountType: {
1: '满减券',
2: '折扣券',
3: '代金券',
4: '兑换券',
5: '购车代金券',
6: '商品折扣券',
7: '会员服务券'
},
useMemberType: 0,
list: [],
pageNum: 1
},
navbarReady(e) {
this.setData({
navBarHeight: e.detail.height
})
},
unique(arr) {
let res = new Set()
return arr.filter(item => {
let id = JSON.stringify(item)
if (res.has(id)) {
return false
} else {
res.add(id)
return true
}
})
},
getCouponGoodsPage(res) {
wx.p.wxApi.showLoading()
let total = 0
let {
list,
pageNum
} = this.data
wx.p.api.shopmallApi
.getCouponGoodsPage({
pageNum,
couponId: res.couponId || res.id,
merchantId: res.merchantId
})
.then(data => {
console.log(data)
let lists = this.unique([...list, ...data.list])
this.setData({
list: lists,
total
})
wx.hideLoading()
})
},
jumpCommodity(e) {
let {
item
} = e.currentTarget.dataset
// console.log('item',item);
let {
id
} = item
let isActivity = false
wx.p.router.go('/packageMall/pages/detail/detail', {
id,
isActivity,
notIntercept: true
})
},
jump(e) {
let {
item
} = e.currentTarget.dataset
wx.openLocation({
latitude: item.lat,
longitude: item.lng,
name: item.merchantName,
address: item.merchantAddress
})
},
jumpMap() {
let {
couponDetail
} = this.data
wx.openLocation({
latitude: couponDetail.lat,
longitude: couponDetail.lng,
name: couponDetail.merchantName,
address: couponDetail.merchantAddress
})
},
jump() {
console.log()
let {
length
} = getCurrentPages()
if (length == 1) wx.p.router.redirectTo('/packageMine/pages/coupon/index/index')
else wx.p.router.back()
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
// 0616添加推荐人
if (options.shareStaffUuid) {
this.data.shareStaff = {
shareStaffUuid: options.shareStaffUuid,
shareStaffName: options.shareStaffName
}
options.item_type = 2
options.action_type = 1
options.item_id = options.couponId
this.data.recommandOptions = options
// wx.$util.reportData(options, false, false, true)
}
// console.log('options',options);
const {
userCouponId,
useMemberType,
detailInfo
} = options
console.log(userCouponId)
wx.p.wxApi.showLoading('加载中...')
this.setData({
useMemberType,
detailInfo
})
wx.p.api.couponsApi
.getWWCoupon({
userCouponId
})
.then(res => {
wx.hideLoading()
wx.nextTick(() => {
this.setCouponData(res)
})
let code = res.verificationCode.replace(/(.{4})/g, '$1 ')
this.setData({
qr: QR.createQrCodeImg(`t=2&c=${res.verificationCode}`),
verificationCode: code
})
})
if (options && options.couponId) {
console.log(options)
wx.p.wxApi.showLoading('加载中...')
this.checkCoupon(options)
if (options.activity_id) {
this.data.activiOptions = options
// wx.$util.reportData(options, true, false)
}
} else {
let {
isReceive
} = this.data
if (isReceive) this.confirm()
}
},
checkCoupon(options, callBack) {
wx.p.api.couponsApi.checkCoupon(options).then(couponInfo => {
console.log(couponInfo)
if (couponInfo) {
couponInfo.receiveEndTime = new Date(couponInfo.receiveEndTime).format('yyyy.MM.dd hh:mm:ss')
couponInfo.receiveStartTime = new Date(couponInfo.receiveStartTime).format('yyyy.MM.dd hh:mm:ss')
couponInfo.receiveTime = new Date(couponInfo.receiveTime).format('yyyy.MM.dd hh:mm:ss')
}
this.setData({
detailInfo: couponInfo
})
// wx.hideLoading()
wx.p.api.couponsApi.getCouponInfo(options).then(res => {
this.setCouponData(res)
this.setData({
...options
})
if (couponInfo) {
let code = couponInfo.verificationCode.replace(/(.{4})/g, '$1 ')
console.log(couponInfo.verificationCode)
this.setData({
useMemberType: couponInfo.useMemberType,
qr: QR.createQrCodeImg(`t=2&c=${couponInfo.verificationCode}`),
verificationCode: code
})
} else {
if (callBack) callBack(couponInfo)
}
})
})
wx.hideLoading()
},
setCouponData(res) {
if (res.receiveStartTime) res.receiveStartTime = new Date(res.receiveStartTime).format('yyyy.MM.dd hh:mm:ss')
if (res.receiveEndTime) res.receiveEndTime = new Date(res.receiveEndTime).format('yyyy.MM.dd hh:mm:ss')
if (res.receiveTime) res.receiveTime = new Date(res.receiveTime).format('yyyy.MM.dd hh:mm:ss')
if (res.list) {
res.list.map(val => (val.verificationTime = new Date(val.verificationTime).format('yyyy.MM.dd hh:mm:ss')))
}
if (res.effectiveStartTime) res.effectiveStartTime = res.effectiveStartTime.replace(/-/g, '.')
if (res.effectiveEndTime) res.effectiveEndTime = res.effectiveEndTime.replace(/-/g, '.')
if (res.full) res.full = res.full / 100
if (res.discountType == 3 && res.useChannel == 1) {
this.getCouponGoodsPage(res)
}
console.log(res, '///////////')
this.setData({
couponDetail: res
})
// setTimeout(() => {
// this.setData({
// flag: true
// })
// }, 500)
},
confirm() {
let {
couponId,
issueName,
issueDate,
userCouponId,
merchantId,
shareSource
} = this.data
if (!couponId && !userCouponId) return
wx.p.router.intercept().then(response => {
if (response) {
this.setData({
isReceive: true
})
return
}
let obj = {
...this.data.shareStaff
}
if (userCouponId) obj.userCouponId = userCouponId
if (couponId) obj.couponId = couponId
if (issueName) obj.issueName = issueName
if (issueDate) obj.issueDate = issueDate
if (merchantId) obj.merchantId = merchantId
if (shareSource) obj.shareSource = shareSource
this.checkCoupon(obj, () => {
wx.p.api.couponsApi.receiveCoupon(obj).then(({
code,
data,
message
}) => {
if (code == '0') {
wx.$Track.setTrack({
data,
type: '领取优惠券'
},
7
)
console.log(data)
if (data.discountType == 3) {
this.jump()
return
}
this.setData({
qr: QR.createQrCodeImg(`t=2&c=${data.verificationCode}`),
verificationCode: data.verificationCode
})
wx.p.wxApi.showToast('领取成功')
this.checkCoupon(obj)
if (this.data.activiOptions) {
// wx.$util.reportData(this.data.activiOptions, false, true)
}
if (this.data.recommandOptions) {
let options = this.data.recommandOptions
options.item_type = 2
options.action_type = 2
options.item_id = options.couponId
// wx.$util.reportData(options, false, false, true)
}
} else {
wx.p.wxApi.showToast(message)
}
})
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
// wx.$util.customerbehavior(2)
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {}
})
\ No newline at end of file
{
"navigationStyle": "custom"
}
\ No newline at end of file
/* packageMall/pages/coupon/coupon.wxss */
.navigation-bar {
position: fixed;
top: 0;
left: 0;
z-index: 2;
}
.navigation {
width: 100%;
height: 100%;
position: relative;
}
.navigation .back {
width: 64rpx;
height: 64rpx;
background: rgba(255, 255, 255, 0.5);
border-radius: var(--margin);
position: absolute;
left: 20rpx;
}
.navigation .back .icon {
width: 36rpx;
height: 36rpx;
}
.navigation .text {
max-width: 50%;
font-size: 32rpx;
color: #333333;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-weight: 500;
box-sizing: border-box;
text-align: center;
letter-spacing: 1rpx;
}
.layout {
padding: 32rpx;
}
.layout .box {
background: #ffffff;
box-shadow: 0px 8rpx 16rpx 0px rgba(224, 224, 224, 0.5);
border-radius: 8rpx;
}
.layout .qr-box {
padding: 32rpx 32rpx 20rpx 32rpx;
margin-bottom: 20rpx;
position: relative;
}
.layout .qr-box .type {
position: absolute;
right: 0;
top: 0;
width: 140rpx;
height: 120rpx;
background-color: var(--btnColor);
}
.layout .qr-box .type text {
color: #fff;
display: block;
transform: rotate(45deg);
font-size: 24rpx;
}
.layout .qr-box .top {
position: relative;
z-index: 2;
/* border-bottom: 2rpx solid #eeeeee;
padding-bottom: 32rpx; */
box-sizing: border-box;
}
.layout .qr-box .top .title {
font-weight: 600;
font-size: 36rpx;
color: #3a3a3a;
padding-bottom: 20rpx;
}
.layout .qr-box .top .title .coupon {
background-color: var(--btnColor);
margin-left: 20rpx;
font-size: 24rpx;
border-radius: 8rpx;
padding: 4rpx 20rpx;
color: #fff;
flex-shrink: 0;
}
.layout .qr-box .top .title .disabled {
background-color: #999999;
}
.layout .qr-box .top .time {
font-size: 24rpx;
color: #bebebe;
}
.layout .qr-box .bottom {
/* min-height: 506rpx; */
flex-direction: column;
}
.layout .qr-box .bottom .title {
padding: 22rpx 0 24rpx;
font-size: 32rpx;
}
.layout .qr-box .bottom .qr {
width: 280rpx;
height: 280rpx;
margin-bottom: 44rpx;
position: relative;
}
.layout .qr-box .bottom .qr .qr-text {
font-size: 24rpx;
color: #bebebe;
width: 200%;
text-align: center;
}
.layout .qr-box .bottom .qr .mask {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
font-size: 28rpx;
font-weight: 500;
line-height: 32rpx;
width: 181rpx;
height: 84rpx;
background: #000;
border-radius: 8rpx;
opacity: 0.7;
color: #FFFFFF;
}
.layout .qr-box .bottom .qr .mask.lose {
font-size: 28rpx;
color: #999999;
}
.layout .qr-box .btn-box {
height: 304rpx;
background: #FFF5F3;
border-radius: 8rpx;
padding: 32rpx;
}
.layout .qr-box .btn-box .text {
width: 100%;
text-align: center;
font-size: 20rpx;
color: #FC5B32;
line-height: 28px;
}
.layout .qr-box .btn {
/* animation: huxi 2.5s infinite; */
/* margin-bottom: 40rpx; */
font-size: 28rpx;
color: #FFFFFF;
margin-top: 38rpx;
width: 400rpx;
height: 68rpx;
background: #FC5B32;
box-shadow: 0px 4rpx 12rpx 4rpx rgba(252, 91, 50, 0.1);
border-radius: 34rpx;
}
/* @keyframes huxi {
0% {
transform: scale(1);
}
50% {
transform: scale(1.1);
}
100% {
transform: scale(1);
}
} */
.layout .qr-box .bottom .code {
font-size: 28rpx;
}
.layout .info {
padding: 32rpx;
line-height: 40rpx;
font-size: 28rpx;
color: #666666;
}
.layout .info .title {
color: #333333;
}
.layout .info .title .sprite-icon {
margin-right: 16rpx;
}
.icon-explain {
width: 32rpx;
height: 32rpx;
}
.layout .info .item {
margin-top: 24rpx;
word-break: break-all;
position: relative;
}
.layout .info .item .num {
position: absolute;
left: 0;
top: 0;
}
.bottom-box {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
z-index: 2;
background-color: #fff;
padding-top: 10rpx;
}
.default-btn {
margin: 0 auto 10rpx;
}
.isFullSucreen {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
.isFullSucreen-btn {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
.box-X {
border-radius: 8rpx;
background-color: #fff;
padding: 24rpx 24rpx 40rpx;
}
.associationBox .title {
font-size: 32rpx;
padding-bottom: 24rpx;
font-weight: 500;
}
.associationBox .goods {
margin-top: 24rpx;
display: flex;
align-items: center;
height: 160rpx;
}
.associationBox .goods .icon {
width: 160rpx;
height: 100%;
overflow: hidden;
border-radius: 8rpx;
margin-right: 20rpx;
}
.associationBox .goods .info {
width: calc(100% - 180rpx);
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.associationBox .goods .info .name {
font-size: 30rpx;
color: #333;
}
.associationBox .goods .info .price {
display: flex;
color: var(--btnColor);
font-weight: 500;
}
.associationBox .goods .info .price-X {
margin-top: -8rpx;
font-size: 36rpx;
font-family: DINAlternate-Bold, DINAlternate;
}
.top .title .title_text {
font-size: 36rpx;
font-weight: 600;
max-width: 510rpx;
}
.top .title .baseImage {
width: 140rpx;
height: 138rpx;
background-size: cover;
position: absolute;
right: -40rpx;
top: -41rpx;
}
.qrText {
color: #FC5B32;
}
.changeColor {
color: #333;
}
.lines {
height: 2rpx;
background: #EEE;
margin: 32rpx 0 0;
}
.title .discount {
font-size: 40rpx;
font-weight: 600;
}
.title .discount_text {
font-size: 24rpx;
padding-top: 8rpx;
}
.title .discount_text_x {
font-size: 32rpx;
padding-left: 10rpx;
}
.numberColor {
color: #B4B4B4;
}
.darkColor {
color: #666;
}
.box .process {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 4rpx;
}
.process .process_text {
margin-left: 4rpx;
font-size: 24rpx;
color: #333;
}
.process image {
width: 24rpx;
height: 24rpx;
}
.process .rightArrow {
padding: 0 40rpx;
}
.qr-box .storeTitle {
font-size: 32rpx;
font-weight: 500;
color: #333;
margin-bottom: 32rpx;
}
.qr-box .store-box {
background: #F9F9F9;
border: 2rpx solid #E9E9E9;
border-radius: 8rpx;
padding: 16rpx 32rpx;
margin-bottom: 18rpx;
}
.qr-box .store-box:last-child {
margin-bottom: 0;
}
.qr-box .storeName {
font-size: 28rpx;
color: #333;
margin-top: -4rpx;
}
.qr-box .businessTime {
font-size: 24rpx;
color: #999;
margin-top: 4rpx;
padding-bottom: 18rpx;
}
.qr-box .line {
height: 2rpx;
background: #EEE;
}
.qr-box .addressBox {
padding-top: 20rpx;
font-size: 24rpx;
color: #666;
display: flex;
align-items: center;
}
.qr-box .addressBox .navigation-X {
width: 32rpx;
height: 32rpx;
}
.qr-box .couponBox-X {
max-width: 610rpx;
line-height: 48rpx;
}
.qr-box .couponBox-X .titleDay {
font-size: 28rpx;
font-weight: 500;
color: #333;
}
.titleDay_text {
font-size: 24rpx;
color: #666;
}
.darkColor {
color: #666;
}
.an_title_text {
font-size: 32rpx;
font-weight: 500;
color: #333;
margin-bottom: 20rpx;
}
.note_line {
box-sizing: border-box;
line-height: 48rpx;
}
.note_line .line_text_name {
font-size: 28rpx;
color: #333;
}
.note_line .line {
height: 2rpx;
background: #EEE;
margin: 16rpx 0 14rpx;
}
.line_text {
font-size: 24rpx;
color: #666;
}
.btn-box .title_text_X {
font-size: 36rpx;
font-weight: 600;
max-width: 510rpx;
}
.btn-box .baseImage{
width: 138rpx;
height: 138rpx;
background-size: cover;
position: absolute;
right: -9rpx;
top: -13rpx;
}
.btn-box .times {
font-size: 24rpx;
color: #D83C14;
margin: 20rpx 0 32rpx;
}
.qr-box .good {
display: flex;
padding-bottom: 12rpx;
}
.qr-box .good .icons {
width: 144rpx;
height: 144rpx;
}
.qr-box .good .infos {
margin-left: 32rpx;
}
.qr-box .good .infos .names {
font-size: 28rpx;
color: #282829;
}
.qr-box .good .infos .prices {
display: flex;
margin-top: 50rpx;
font-size: 36rpx;
font-weight: 600;
color: #FC5B32;
}
.qr-box .good .icons image {
border-radius: 8rpx;
}
.qr-box .good .infos .prices .prices-X {
margin-left: 10rpx;
}
.qr-box .liness {
height: 2rpx;
background: #EFF0F2;
margin: 20rpx 0 32rpx 0;
}
.coupon-X {
height: 203rpx;
margin: 0 -8rpx;
position: relative;
}
.coupon-X .left_box {
width: 230rpx;
height: 150rpx;
color: #FFFFFF;
font-size: 56rpx;
font-weight: 600;
text-align: center;
line-height: 150rpx;
}
.coupon-X .left_box .price_icon {
font-size: 24rpx;
font-weight: 500;
}
.coupon-X .right_box {
padding: 28rpx 28rpx 0 28rpx;
width: 464rpx;
}
.top_box {
height: 120rpx;
border-bottom: 2rpx dashed rgba(216, 60, 20, 0.1);
}
.top_box .voucherName {
font-size: 28rpx;
font-weight: 600;
padding-bottom: 8rpx;
}
.h4_text {
font-size: 20rpx;
font-weight: 400;
}
.brightColor {
color: #FC5B32;
}
.describeColor {
color: #D83C14;
}
.timeColor {
color: #999;
}
.bottom_box {
height: 42rpx;
line-height: 42rpx;
}
.coupon-X .bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.coupon-X .infoss {
position: relative;
z-index: 2;
display: flex;
width: 100%;
height: 100%;
right: 0;
top: 0;
}
\ No newline at end of file
......@@ -235,8 +235,8 @@ Page({
})
},
async join(e) {
const loginStatu = await wx.p.router.intercept()
if(loginStatu) return
const loginStatus = await wx.p.router.intercept()
if(loginStatus) return
let params = e && e.detail
if (!params) {
params = {
......
......@@ -2,5 +2,6 @@
"usingComponents": {
"search-box": "/pages/tab/mall/components/SearchBox/SearchBox",
"goods": "/pages/tab/mall/components/Goods/Goods"
}
},
"navigationBarTitleText": "商城"
}
\ No newline at end of file
......@@ -24,7 +24,7 @@ Page({
let para = {
userCouponId: id
}
wx.$api.showLoading('加载中...')
wx.p.wxApi.showLoading('加载中...')
wx.p.api.couponsApi.couponsDetail(para).then(res => {
wx.hideLoading()
let qrcodeURL = QR.createQrCodeImg(`t=2&c=${res.verificationCode}`)
......
......@@ -47,7 +47,7 @@ Page({
},
fail(res) {
if (res.errMsg == 'requestPayment:fail cancel') {
wx.$api.showToast('取消支付')
wx.p.wxApi.showToast('取消支付')
}
}
})
......
......@@ -22,7 +22,7 @@ Page({
pageNum: 1,
tab: ['全部', '待付款', '待发货', '待收货', '退款/售后'],
list: [],
hasUserInfo: false,
hasUserInfo: true,
},
navbarReady(e) {
wx.p.wxApi.getViewInfo('.tab', (res) => {
......@@ -163,7 +163,6 @@ Page({
onLoad: function (options) {
console.log(options,'=========')
this.setData({
hasUserInfo: true,
tabIndex: options.tabIndex,
orderStatusPart: orderStatusPartEnum[options.tabIndex],
})
......
......@@ -66,8 +66,8 @@
x{{item.orderSource == 5 ? 1: i.goodsNumber}}
</view>
</view>
<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>
......@@ -114,8 +114,8 @@
</view>
</block>
</block>
<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>
......@@ -241,9 +241,12 @@
<view class="bottom">
共{{item.goodsNumber}}件商品,实付款<text class="price">¥{{item.payPrice}}</text>
</view>
<view class="btn-box">
<view class="btn confirm" catchtap="boutiqueJump" data-order-code="{{item.orderCode}}">评价</view>
</view>
<!-- !hasUserInfo -->
<block wx:if="{{!hasUserInfo}}">
<view class="btn-box">
<view class="btn confirm" catchtap="boutiqueJump" data-order-code="{{item.orderCode}}">评价</view>
</view>
</block>
</view>
</block>
<block wx:if="{{item.orderClassify == 5}}">
......
......@@ -22,8 +22,9 @@ Page({
if (options.url) {
return this.login(options)
}
this.login()
},
async login(options) {
async login(options = {}) {
if (options.merchantId) wx.$merchant_id = options.merchantId
try {
const {
......
......@@ -19,7 +19,9 @@ Page({
},
search(e) {
let value = e.detail
let { goodsList } = this.data
let {
goodsList
} = this.data
wx.$router.go('/packageMall/pages/search/search', {
value,
goodsList
......@@ -29,7 +31,68 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getZoneInfo()
// this.getZoneInfo()
this.getClassifyList()
},
getClassifyList(tagIndex) {
wx.p.wxApi.showLoading('加载中...')
wx.p.api.homeApi.getClassifyList().then(data => {
let tabList = [{
zoneName: '全部',
id: '',
zoneImg: `mall/default-banner.png`
}]
let classifyList = []
data.map(e => {
e.goodsList &&
e.goodsList.length &&
e.goodsList.map(i => {
i &&
i.length &&
i.map(c => {
c.goods.goodsStatistics = c.goodsStatistics
c.goods.id = c.goodsId
})
})
if (e.goodsList && e.goodsList.length) {
e.count = 0
// 处理数据
let [arr, obj] = [
[], {}
]
e.goodsList.forEach((val, id) => {
if (val instanceof Array) {
val.forEach((item, index) => {
arr.push(item.goods)
})
obj = {
goodsData: arr,
id: e.id
}
} else {
val.classifyName = e.classifyName
arr.push(val)
obj = {
activityData: arr,
id: e.id
}
}
})
classifyList.push(obj)
tabList.push({
zoneName: e.classifyName,
id: e.id
})
}
})
this.setData({
classifyList,
tabList,
flag: true
})
if (tagIndex) this.changeData(tagIndex)
this.getGoodsList()
})
},
getZoneInfo() {
wx.p.api.discoveryApi.getZoneInfo(2).then(data => {
......@@ -47,10 +110,17 @@ Page({
})
},
getGoodsList(zoneId) {
wx.hideLoading()
const {
tagIndex
} = this.data
if (tagIndex != 0) return
wx.p.wxApi.showLoading('加载中...')
let params = {}
if (zoneId) params.zoneId = zoneId
wx.p.api.shopmallApi.getGoodsList(params).then(({ list }) => {
wx.p.api.shopmallApi.getGoodsList(params).then(({
list
}) => {
this.setData({
goodsList: list,
goodsFlag: true
......@@ -69,31 +139,54 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
let { tabList, tagIndex } = this.data
let {
tabList,
tagIndex
} = this.data
this.setData({
goodsList: [],
goodsFlag: false
})
if (tabList.length == 0) return
this.getGoodsList(tabList[tagIndex].id)
this.getClassifyList(tagIndex)
},
changeData(index) {
const {
classifyList,
tabList
} = this.data
if (tabList[index].id) {
classifyList.map(i => {
if (i.id == tabList[index].id) this.setData({
goodsList: i.goodsData,
goodsFlag: true
})
})
} else this.getGoodsList()
},
goShoppingCart() {
wx.p.router.go('/packageMall/pages/shoppingCart/shoppingCart')
},
tabclick(e) {
let { index } = e.detail
let { tagIndex, tabList } = this.data
let {
index
} = e.detail
let {
tagIndex
} = this.data
if (index == tagIndex) return
this.setData({
tagIndex: index,
goodsList: [],
goodsFlag: false
})
this.getGoodsList(tabList[index].id)
this.changeData(index)
},
search(e) {
let value = e.detail
let { goodsList } = this.data
let {
goodsList
} = this.data
wx.p.router.go('/packageMall/pages/search/search', {
value,
goodsList
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!