Commit b080a672 by 匡雅琴

添加

1 parent 27ec1eeb
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
......@@ -102,6 +102,12 @@
"pages/pay/index",
"pages/PayResult/payResult"
]
},
{
"root": "packageStrategy",
"pages": [
"pages/strategyDetail/index"
]
}
],
"usingComponents": {
......
Page({
data: {
strategyDetailObj: {},
},
onLoad(options) {
this.getStrategyDetail(options.id);
},
getStrategyDetail(id) {
wx.p.api.strategyApi
.getStrategyDetail({
id,
})
.then((res) => {
this.setData({
strategyDetailObj: res,
});
});
},
});
<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>
<view class="">{{strategyDetailObj.content}}</view>
</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
// 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();
},
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
});
<view class="strategy-box">
<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!