Commit 37dba5ff by 杨北旺

合并

2 parents 353fffa0 babd881b
import { preReleaseAppId } from '~/config'
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
let index = 2
let index = 1
/**
*
......
......@@ -9,6 +9,7 @@ import couponsApi from './coupons'
import equityApi from './equity'
import common from './common'
import entmicroApi from './entmicro'
import strategyApi from './strategy'
module.exports = {
wechatApi,
......@@ -21,5 +22,6 @@ module.exports = {
couponsApi,
equityApi,
common,
entmicroApi
entmicroApi,
strategyApi
}
\ No newline at end of file
import api from '../request/http'
module.exports = {
// 查询攻略列表
getStrategyList(data) {
return api.post({
method: 'scrm.api.shopmall.strategy.list',
...data
})
},
// 查询攻略详情
getStrategyDetail(data) {
return api.post({
method: 'scrm.api.shopmall.strategy.detail',
...data
})
},
}
\ No newline at end of file
......@@ -123,6 +123,12 @@
"provider": "wx5e90fdd843841356"
}
}
},
{
"root": "packageStrategy",
"pages": [
"pages/strategyDetail/index"
]
}
],
"usingComponents": {
......
Component({
data: {},
properties: {},
methods: {}
properties: {
list: {
type: Array,
value: []
}
},
methods: {
selectStrategy(e) {
console.log(e);
const {id} = e.currentTarget.dataset
this.triggerEvent('selectStrategy', {id})
}
}
})
\ No newline at end of file
......@@ -4,13 +4,13 @@
<view class="text">省钱攻略</view>
</view>
<view class="img-box">
<view class="img-item-box">
<glsx-image webp src="home/saving_1.png" class="saving-img"></glsx-image>
<view class="viewer">9520人浏览</view>
<view wx:for="{{list}}" wx:key="index" class="img-item-box" data-id="{{item.id}}" bind:tap="selectStrategy">
<image webp src="{{item.strategyImg}}" class="saving-img"></image>
<view class="viewer">{{item.viewAmount}}人浏览</view>
</view>
<view class="img-item-box">
<!-- <view class="img-item-box">
<glsx-image webp src="home/saving_2.png" class="saving-img"></glsx-image>
<view class="viewer">9520人浏览</view>
</view>
</view> -->
</view>
</view>
\ No newline at end of file
......@@ -7,14 +7,30 @@ Page({
*/
data: {
recreationMenu,
foodMenu
foodMenu,
strategyList: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
onLoad() {
this.getStrategyList();
},
// 获取省钱攻略
getStrategyList() {
wx.p.api.strategyApi
.getStrategyList({
pageNum: 1,
pageSize: 100
})
.then((res) => {
console.log(res);
this.setData({
strategyList: res.list,
});
});
},
/**
......
......@@ -9,4 +9,4 @@
</view>
<menu-box menuList="{{foodMenu}}"></menu-box>
</view>
<money-saving-tips></money-saving-tips>
\ No newline at end of file
<money-saving-tips list="{{strategyList}}"></money-saving-tips>
\ No newline at end of file
Page({
data: {
strategyDetailObj: {},
},
onLoad(options) {
console.log(options);
this.getStrategyDetail(options.id);
},
getStrategyDetail(id) {
wx.p.api.strategyApi
.getStrategyDetail({
id,
})
.then((res) => {
this.setData({
strategyDetailObj: res,
});
});
},
});
{
"usingComponents": {
"mp-html": "../../../components/mp-html/index"
}
}
\ No newline at end of file
<view class="strategy-detail-box">
<view class="strategy-detail-title">{{strategyDetailObj.strategyName}}</view>
<view class="strategy-detail-view">{{strategyDetailObj.viewAmount}}人浏览</view>
<image webp src="{{item.strategyImg}}" class="strategy-img"></image>
<mp-html content="{{strategyDetailObj.content}}"></mp-html>
</view>
\ No newline at end of file
.strategy-detail-box {
height: 100vh;
background: #FFFFFF;
padding: 30rpx 40rpx;
box-sizing: border-box;
}
.strategy-detail-title {
font-weight: 600;
font-size: 48rpx;
color: #333333;
letter-spacing: 2rpx;
}
.strategy-detail-view {
font-weight: 400;
font-size: 32rpx;
color: #999999;
}
.strategy-img {
width: 670rpx;
height: 376rpx;
border-radius: 16rpx;
-webkit-border-radius: 16rpx;
-moz-border-radius: 16rpx;
-ms-border-radius: 16rpx;
-o-border-radius: 16rpx;
}
\ No newline at end of file
import {foodMenuList,funMenuList,carMenuList} from './constant/constant'
Page({
data: {
import {
foodMenuList,
funMenuList,
carMenuList
},
} from './constant/constant'
Page({
data: {
foodMenuList,
funMenuList,
carMenuList,
commodityList: [],
pageParam: {
appearance: 1,
pageSize: 0,
pageCount: 10
},
loadingMore: false,
loadOver: false,
},
properties: {},
......@@ -15,7 +29,80 @@ data: {
},
onShow() {
},
navbarReady(e) {
let {
height
} = e.detail
this.setData({
user_box_style: `padding-top:${height + 20}px`
})
},
// 获取附近优惠数据
toGetCommodity(lat, lng, page) {
let {
pageParam,
loadingMore,
commodityList,
loadOver
} = this.data
let para = {
lat,
lng,
...pageParam
}
if (loadOver) {
return
}
if (page) {
para.pageSize = 0
}
equityApi.lasteCommodity(para).then(res => {
if (!res) {
this.setData({
loadOver: true
})
return
}
let tempArr = []
res.forEach(item => {
if (item.couponsGoodsList) {
tempArr.push(item)
}
})
if (loadingMore) {
commodityList = commodityList.concat(tempArr)
}
this.setData({
commodityList: loadingMore ? commodityList : tempArr,
loadingMore: false,
loadOver: false
})
})
},
onReachBottom() {
if (this.data.unauthorized) {
return
}
if (!this.data.commodityList.length) {
return
}
let { pageParam } = this.data
pageParam.pageSize++
this.setData(
{
pageParam,
loadingMore: true
},
() => {
let { currentAddress } = this.data
const { lat, lng } = currentAddress.location
this.toGetCommodity(lat, lng)
}
)
},
})
\ No newline at end of file
......@@ -4,6 +4,7 @@
"onReachBottomDistance": 10,
"usingComponents": {
"main-title": "../../../components/MainTitle/MainTitle",
"menu-box": "./components/MenuBox/MenuBox"
"menu-box": "./components/MenuBox/MenuBox",
"gl-icon": "glsx-applet-component/GLIcon/index"
}
}
\ No newline at end of file
......@@ -8,29 +8,69 @@
.save-money-box {
padding-top: 84px;
.save-money-box-content {
padding: 30rpx;
background: #f8f8f8;
}
.save-money-img {
width: 690rpx;
height: 268rpx;
}
.save-money-order-box {
position: relative;
}
.save-money-order-img {
width: 690rpx;
height: 432rpx;
margin-top: 6rpx;
}
.save-money-order-text-box {
position: absolute;
top: 48rpx;
right: 22rpx;
width: 152rpx;
height: 68rpx;
background: #FCE9CB;
border: 1rpx solid #6B2A0B;
border-radius: 34rpx;
font-weight: 400;
font-size: 30rpx;
color: #6B2A0B;
text-align: center;
line-height: 68rpx;
}
.title-box {
margin: 30rpx 0 20rpx 0;
.near-title {
font-weight: 500;
font-size: 36rpx;
color: #333333;
}
.near-subTitle {
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
.more-text {
display: flex;
font-weight: 400;
font-size: 22rpx;
color: #666666;
align-items: flex-end;
}
}
}
.flex {
display: flex;
justify-content: space-between;
}
\ No newline at end of file
<view class="navigation-bar">
<navigation-bar bindnavbarReady="navbarReady" page-title="省钱专区">省钱专区</navigation-bar>
<navigation-bar bindnavbarReady="navbarReady" page-title="省钱专区">省钱专区</navigation-bar>
</view>
<view class="save-money-box">
<view class="save-money-box-content" hover-class="none" hover-stop-propagation="false">
<glsx-image webp src="home/homelife_bg.png" class="save-money-img"></glsx-image>
<glsx-image webp src="savemoney/save_order.png" class="save-money-order-img"></glsx-image>
<view class="title-box">
<main-title title="吃喝省"></main-title>
</view>
<menu-box menuList="{{foodMenuList}}"></menu-box>
<view class="title-box">
<main-title title="娱乐省"></main-title>
</view>
<menu-box menuList="{{funMenuList}}"></menu-box>
<view class="title-box">
<main-title title="用车省"></main-title>
</view>
<menu-box menuList="{{carMenuList}}"></menu-box>
<view class="title-box">
<view class="near-title">附近优惠</view>
<view class="near-subTitle">为您精选附近热销商品</view>
</view>
<view class="save-money-box-content" hover-class="none" hover-stop-propagation="false">
<glsx-image webp src="home/homelife_bg.png" class="save-money-img"></glsx-image>
<view class="save-money-order-box">
<glsx-image webp src="savemoney/save_order.png" class="save-money-order-img"></glsx-image>
<view class="save-money-order-text-box">去下单</view>
</view>
<view class="title-box flex">
<main-title title="吃喝省"></main-title>
<view class="more-text">更多 <gl-icon iconName="{{'gl-icon-the-arrow'}}" fontSize="26" color="#666666"></gl-icon></view>
</view>
<menu-box menuList="{{foodMenuList}}"></menu-box>
<view class="title-box flex">
<main-title title="娱乐省"></main-title>
<view class="more-text">更多 <gl-icon iconName="{{'gl-icon-the-arrow'}}" fontSize="26" color="#666666"></gl-icon></view>
</view>
<menu-box menuList="{{funMenuList}}"></menu-box>
<view class="title-box flex">
<main-title title="用车省"></main-title>
<view class="more-text">更多 <gl-icon iconName="{{'gl-icon-the-arrow'}}" fontSize="26" color="#666666"></gl-icon></view>
</view>
<menu-box menuList="{{carMenuList}}"></menu-box>
<view class="title-box">
<view class="near-title">附近优惠</view>
<view class="near-subTitle">为您精选附近热销商品</view>
<view wx:if="{{commodityList.length}}" class="commodity_list_widget">
<block wx:for="{{commodityList}}" wx:key="index">
<commodityItem address="{{currentAddress}}" businessInfo="{{item}}" />
</block>
</view>
<view wx:if="{{unauthorized}}" class="reLocation_wrap flex_cc">
<image webp class="loca_icon" webp src="{{IMGURL}}equity/location_icon.png?v={{img_version}}" />
<view bind:tap="relocation" class="loca_text">定位一下,发现附近优惠</view>
</view>
<view style="height:400rpx"></view>
</view>
</view>
</view>
\ No newline at end of file
const navStyle = "background-color: transparent;";
import { IMG_URL } from '../../../config'
Page({
data: {
IMG_URL,
navStyle,
......@@ -25,36 +24,63 @@ Page({
urlName:''
},
navbarReady(e) {
let {
height
} = e.detail;
let { height } = e.detail;
this.setData({
navBarHeight: height,
user_box_style: `padding-top:${height + 20}px`
})
user_box_style: `padding-top:${height + 20}px`,
});
},
// 处理滚动事件
onPageScroll(e) {
const { navBarHeight } = this.data
const { navBarHeight } = this.data;
this.setData({
navStyle: e.scrollTop >= navBarHeight-50 ? '' : navStyle,
})
navStyle: e.scrollTop >= navBarHeight - 50 ? "" : navStyle,
});
},
onLoad() {
this.getStrategyList();
},
// 获取省钱攻略
getStrategyList() {
wx.p.api.strategyApi
.getStrategyList({
pageNum: 1,
pageSize: 100,
mainFlag: 1,
})
.then((res) => {
console.log(res);
this.setData({
strategyList: res.list,
});
});
},
onLoad(options) {
selectStrategy(e) {
const { id } = e.detail;
wx.p.router.go("/packageStrategy/pages/strategyDetail/index", {
id,
});
},
toShowQrCode(e){
const {url} = e.currentTarget.dataset
toShowQrCode(e) {
const { url } = e.currentTarget.dataset;
this.setData({
urlName:url,
showModal:true
})
urlName: url,
showModal: true,
});
},
closeModal(){
closeModal() {
this.setData({
showModal:false,
urlName:''
})
showModal: false,
urlName: "",
});
},
})
\ No newline at end of file
toHomeLife() {
wx.p.router.go("/packageIndex/pages/homeLife/index");
},
toCarLife() {
wx.p.router.go("/packageIndex/pages/carLife/index");
},
});
......@@ -21,8 +21,8 @@
</block>
<!-- 家生活/车生活 -->
<view class="menu_wrap flex_scb">
<glsx-image class="cover" webp src="home/family_menu_banner.png"></glsx-image>
<glsx-image class="cover" webp src="home/car_menu_banner.png"></glsx-image>
<glsx-image class="cover" webp src="home/family_menu_banner.png" bind:tap="toHomeLife"></glsx-image>
<glsx-image class="cover" webp src="home/car_menu_banner.png" bind:tap="toCarLife"></glsx-image>
</view>
<!-- 轮播图 -->
<view class="banner-box" wx:if="{{bannerList.length > 0}}">
......@@ -44,7 +44,7 @@
</block>
</view>
<!-- 省钱攻略 -->
<MoneySavingTips></MoneySavingTips>
<MoneySavingTips list="{{strategyList}}" bind:selectStrategy="selectStrategy"></MoneySavingTips>
</view>
<!-- 弹框 -->
<view wx:if="{{showModal}}" class="modal_widget">
......
// pages/tab/select/index.js
import { strategyList } from './constant/constant'
// import { strategyList } from "./constant/constant";
Page({
/**
* 页面的初始数据
*/
data: {
strategyList
strategyList: [],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
this.getStrategyList();
},
navbarReady(e) {
let {
height
} = e.detail
this.setData({
user_box_style: `padding-top:${height + 20}px`
})
},
getStrategyList() {
wx.p.api.strategyApi.getStrategyList({
pageNum: 1,
pageSize: 100
}).then(res => {
console.log(res);
this.setData({
strategyList: res.list
})
});
},
selectStrategy(e) {
console.log(e);
const {id} = e.currentTarget.dataset.item
wx.p.router.go('/packageStrategy/pages/strategyDetail/index', {
id
})
}
})
\ No newline at end of file
});
{
"navigationStyle": "custom",
"usingComponents": {}
}
\ No newline at end of file
/* pages/tab/select/index.wxss */
.navigation-bar {
position: fixed;
top: 0;
left: 0;
z-index: 2;
background: #ffffff;
}
.strategy-box {
padding: 30rpx;
background: #F8F8F8;
......@@ -19,8 +27,8 @@
color: #333333;
}
&-bottom {
display: flex;
justify-content: space-between;
// display: flex;
// justify-content: space-between;
margin-top: 14rpx;
.tag {
width: 128rpx;
......@@ -36,7 +44,7 @@
font-weight: 400;
font-size: 24rpx;
color: #999999;
text-align: right;
// text-align: right;
line-height: 36rpx;
}
}
......
<view class="strategy-box">
<view class="navigation-bar">
<navigation-bar bindnavbarReady="navbarReady" page-title="攻略专区">攻略专区</navigation-bar>
</view>
<view class="strategy-box" style="{{user_box_style}}">
<view class="strategy-item" wx:for="{{strategyList}}" wx:key="index" data-item="{{item}}" bind:tap="selectStrategy">
<glsx-image webp src="strategy/{{item.url}}" class="strategy-img"></glsx-image>
<image webp src="{{item.strategyImg}}" class="strategy-img"></image>
<view class="strategy-detail">
<text class="strategy-detail-title">{{item.name}}</text>
<text class="strategy-detail-title">{{item.strategyName}}</text>
<view class="strategy-detail-bottom">
<view class="tag">{{item.tagName}}</view>
<view class="viewer">{{item.viewer}}人浏览</view>
<view class="viewer">{{item.viewAmount}}人浏览</view>
</view>
</view>
</view>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!