| @@ -9,7 +9,8 @@ | |||||
| "pages/userProtocol/userProtocol", | "pages/userProtocol/userProtocol", | ||||
| "pages/mine/mine", | "pages/mine/mine", | ||||
| "pages/ContactUs/ContactUs", | "pages/ContactUs/ContactUs", | ||||
| "pages/selections/selections" | |||||
| "pages/selections/selections", | |||||
| "pages/selectionDetail/selectionDetail" | |||||
| ], | ], | ||||
| "window": { | "window": { | ||||
| "backgroundTextStyle": "light", | "backgroundTextStyle": "light", | ||||
| @@ -125,12 +125,12 @@ Page({ | |||||
| }, | }, | ||||
| goToChat() { | goToChat() { | ||||
| wx.navigateTo({ | |||||
| url: '/pages/chat/chat', | |||||
| }) | |||||
| // wx.navigateTo({ | // wx.navigateTo({ | ||||
| // url: '/pages/selections/selections', | |||||
| // url: '/pages/chat/chat', | |||||
| // }) | // }) | ||||
| wx.navigateTo({ | |||||
| url: '/pages/selections/selections', | |||||
| }) | |||||
| }, | }, | ||||
| checkCheatCode(e) { | checkCheatCode(e) { | ||||
| @@ -0,0 +1,103 @@ | |||||
| // pages/selectionDetail.ts | |||||
| const app = getApp() | |||||
| import request from '../../utils/request' | |||||
| import { scrollToID, keyWordsEnum } from '../../utils/util' | |||||
| Page({ | |||||
| /** | |||||
| * 页面的初始数据 | |||||
| */ | |||||
| data: { | |||||
| id: "", | |||||
| list: [] | |||||
| }, | |||||
| getTypeList(id) { | |||||
| const that = this | |||||
| request.get({ | |||||
| url: `/api/promote/titleList?typeId=${id}` | |||||
| }).then(res => { | |||||
| console.log(res, 'res'); | |||||
| let i = 0 | |||||
| const len = res.data.length | |||||
| const interval = setInterval(() => { | |||||
| if (i == len) { | |||||
| clearInterval(interval) | |||||
| return | |||||
| } | |||||
| const list = that.data.list | |||||
| list.push(res.data[i]) | |||||
| that.setData({ | |||||
| list | |||||
| }) | |||||
| i++ | |||||
| }, 100); | |||||
| }).catch(err => { | |||||
| console.log(err, 'err'); | |||||
| }) | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面加载 | |||||
| */ | |||||
| onLoad(options) { | |||||
| const that = this | |||||
| if (options.id) { | |||||
| this.setData({ | |||||
| id: options.id | |||||
| }) | |||||
| this.getTypeList(options.id) | |||||
| } | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面初次渲染完成 | |||||
| */ | |||||
| onReady() { | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面显示 | |||||
| */ | |||||
| onShow() { | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面隐藏 | |||||
| */ | |||||
| onHide() { | |||||
| }, | |||||
| /** | |||||
| * 生命周期函数--监听页面卸载 | |||||
| */ | |||||
| onUnload() { | |||||
| }, | |||||
| /** | |||||
| * 页面相关事件处理函数--监听用户下拉动作 | |||||
| */ | |||||
| onPullDownRefresh() { | |||||
| }, | |||||
| /** | |||||
| * 页面上拉触底事件的处理函数 | |||||
| */ | |||||
| onReachBottom() { | |||||
| }, | |||||
| /** | |||||
| * 用户点击右上角分享 | |||||
| */ | |||||
| onShareAppMessage() { | |||||
| } | |||||
| }) | |||||
| @@ -0,0 +1,6 @@ | |||||
| { | |||||
| "navigationBarTitleText": "问答模板", | |||||
| "navigationBarTextStyle": "white", | |||||
| "navigationBarBackgroundColor": "#0d1322", | |||||
| "usingComponents": {} | |||||
| } | |||||
| @@ -0,0 +1,38 @@ | |||||
| /* pages/selectionDetail.wxss */ | |||||
| page { | |||||
| .content { | |||||
| width: 100%; | |||||
| min-height: 1500rpx; | |||||
| background-color: #0d1322; | |||||
| padding: 35rpx 0; | |||||
| box-sizing: border-box; | |||||
| .title { | |||||
| color: #ffffff; | |||||
| text-align: center; | |||||
| font-size: 38rpx; | |||||
| margin-bottom: 60rpx; | |||||
| } | |||||
| @keyframes getIn { | |||||
| 0% { | |||||
| transform: translateY(3000rpx); | |||||
| } | |||||
| 100% { | |||||
| transform: translateY(0); | |||||
| } | |||||
| } | |||||
| .item { | |||||
| width: 65%; | |||||
| color: #ffffff; | |||||
| text-align: center; | |||||
| background-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%); | |||||
| margin: 50rpx auto; | |||||
| padding: 20rpx 0; | |||||
| border-radius: 20rpx; | |||||
| animation: getIn 1s linear; | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,5 @@ | |||||
| <!--pages/selectionDetail.wxml--> | |||||
| <view class="content"> | |||||
| <view class="title">你可以选择以下模板</view> | |||||
| <view class="item" wx:for="{{ list }}" wx:key="id">{{ item.title }}</view> | |||||
| </view> | |||||
| @@ -48,31 +48,21 @@ Page({ | |||||
| url: '/api/promote/list' | url: '/api/promote/list' | ||||
| }).then(res => { | }).then(res => { | ||||
| console.log(res, 'res'); | console.log(res, 'res'); | ||||
| // if (res.data) { | |||||
| // that.setData({ | |||||
| // list: res.data | |||||
| // }) | |||||
| // } | |||||
| if (res.data) { | |||||
| that.setData({ | |||||
| list: res.data | |||||
| }) | |||||
| } | |||||
| }).catch(err => { | }).catch(err => { | ||||
| console.log(err, 'err'); | console.log(err, 'err'); | ||||
| }) | }) | ||||
| }, | }, | ||||
| getTypeList(id) { | |||||
| const that = this | |||||
| return request.get({ | |||||
| url: `/api/promote/titleList?typeId=${id}` | |||||
| }) | |||||
| }, | |||||
| goDetail(e) { | goDetail(e) { | ||||
| const id = e.currentTarget.dataset.id | const id = e.currentTarget.dataset.id | ||||
| this.getTypeList(id) | |||||
| .then(res => { | |||||
| console.log(res, 'res'); | |||||
| }).catch(err => { | |||||
| console.log(err, 'err'); | |||||
| }) | |||||
| wx.navigateTo({ | |||||
| url: `/pages/selectionDetail/selectionDetail?id=${id}`, | |||||
| }) | |||||
| }, | }, | ||||
| /** | /** | ||||
| @@ -27,14 +27,12 @@ page { | |||||
| .artItem { | .artItem { | ||||
| width: 45%; | width: 45%; | ||||
| height: 280rpx; | |||||
| text-align: center; | text-align: center; | ||||
| color: #ffffff; | color: #ffffff; | ||||
| margin: 5rpx; | margin: 5rpx; | ||||
| border-radius: 10rpx; | border-radius: 10rpx; | ||||
| border: 2px solid #fff; | border: 2px solid #fff; | ||||
| padding: 10rpx; | padding: 10rpx; | ||||
| padding-bottom: 0; | |||||
| margin-bottom: 15rpx; | margin-bottom: 15rpx; | ||||
| image { | image { | ||||
| @@ -6,10 +6,10 @@ | |||||
| <view class="artList"> | <view class="artList"> | ||||
| <view wx:for="{{ list }}" wx:key="id" class="artItem" bindtap="goDetail" data-id="{{ item.id }}"> | <view wx:for="{{ list }}" wx:key="id" class="artItem" bindtap="goDetail" data-id="{{ item.id }}"> | ||||
| <image src="{{ item.imgUrl }}" mode="widthFix" /> | |||||
| <image src="{{ '../../asset/image/Audi-RS7-item.png' }}" mode="widthFix" /> | |||||
| <view class="textArea"> | <view class="textArea"> | ||||
| <view>{{ item.name }}</view> | <view>{{ item.name }}</view> | ||||
| <view>{{ item.detail }}</view> | |||||
| <view>{{ '简述简述简述' }}</view> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| @@ -39,6 +39,7 @@ | |||||
| "miniprogram/components/userNumberChkeck/userNumberChkeck.js", | "miniprogram/components/userNumberChkeck/userNumberChkeck.js", | ||||
| "miniprogram/pages/ContactUs/ContactUs.js", | "miniprogram/pages/ContactUs/ContactUs.js", | ||||
| "miniprogram/pages/selections/selections.js", | "miniprogram/pages/selections/selections.js", | ||||
| "miniprogram/pages/selectionDetail/selectionDetail.js", | |||||
| ], | ], | ||||
| "exclude": [ | "exclude": [ | ||||
| "node_modules" | "node_modules" | ||||