Kaynağa Gözat

upload

master
HolyKnightIX 1 yıl önce
ebeveyn
işleme
07d01a1393
10 değiştirilmiş dosya ile 169 ekleme ve 27 silme
  1. +2
    -1
      miniprogram/app.json
  2. +4
    -4
      miniprogram/pages/index/index.js
  3. +103
    -0
      miniprogram/pages/selectionDetail/selectionDetail.js
  4. +6
    -0
      miniprogram/pages/selectionDetail/selectionDetail.json
  5. +38
    -0
      miniprogram/pages/selectionDetail/selectionDetail.less
  6. +5
    -0
      miniprogram/pages/selectionDetail/selectionDetail.wxml
  7. +8
    -18
      miniprogram/pages/selections/selections.js
  8. +0
    -2
      miniprogram/pages/selections/selections.less
  9. +2
    -2
      miniprogram/pages/selections/selections.wxml
  10. +1
    -0
      tsconfig.json

+ 2
- 1
miniprogram/app.json Dosyayı Görüntüle

@@ -9,7 +9,8 @@
"pages/userProtocol/userProtocol",
"pages/mine/mine",
"pages/ContactUs/ContactUs",
"pages/selections/selections"
"pages/selections/selections",
"pages/selectionDetail/selectionDetail"
],
"window": {
"backgroundTextStyle": "light",


+ 4
- 4
miniprogram/pages/index/index.js Dosyayı Görüntüle

@@ -125,12 +125,12 @@ Page({
},

goToChat() {
wx.navigateTo({
url: '/pages/chat/chat',
})
// wx.navigateTo({
// url: '/pages/selections/selections',
// url: '/pages/chat/chat',
// })
wx.navigateTo({
url: '/pages/selections/selections',
})
},

checkCheatCode(e) {


+ 103
- 0
miniprogram/pages/selectionDetail/selectionDetail.js Dosyayı Görüntüle

@@ -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() {

}
})

+ 6
- 0
miniprogram/pages/selectionDetail/selectionDetail.json Dosyayı Görüntüle

@@ -0,0 +1,6 @@
{
"navigationBarTitleText": "问答模板",
"navigationBarTextStyle": "white",
"navigationBarBackgroundColor": "#0d1322",
"usingComponents": {}
}

+ 38
- 0
miniprogram/pages/selectionDetail/selectionDetail.less Dosyayı Görüntüle

@@ -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;
}
}
}

+ 5
- 0
miniprogram/pages/selectionDetail/selectionDetail.wxml Dosyayı Görüntüle

@@ -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>

+ 8
- 18
miniprogram/pages/selections/selections.js Dosyayı Görüntüle

@@ -48,31 +48,21 @@ Page({
url: '/api/promote/list'
}).then(res => {
console.log(res, 'res');
// if (res.data) {
// that.setData({
// list: res.data
// })
// }
if (res.data) {
that.setData({
list: res.data
})
}
}).catch(err => {
console.log(err, 'err');
})
},

getTypeList(id) {
const that = this
return request.get({
url: `/api/promote/titleList?typeId=${id}`
})
},

goDetail(e) {
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}`,
})
},

/**


+ 0
- 2
miniprogram/pages/selections/selections.less Dosyayı Görüntüle

@@ -27,14 +27,12 @@ page {

.artItem {
width: 45%;
height: 280rpx;
text-align: center;
color: #ffffff;
margin: 5rpx;
border-radius: 10rpx;
border: 2px solid #fff;
padding: 10rpx;
padding-bottom: 0;
margin-bottom: 15rpx;

image {


+ 2
- 2
miniprogram/pages/selections/selections.wxml Dosyayı Görüntüle

@@ -6,10 +6,10 @@

<view class="artList">
<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>{{ item.name }}</view>
<view>{{ item.detail }}</view>
<view>{{ '简述简述简述' }}</view>
</view>
</view>
</view>

+ 1
- 0
tsconfig.json Dosyayı Görüntüle

@@ -39,6 +39,7 @@
"miniprogram/components/userNumberChkeck/userNumberChkeck.js",
"miniprogram/pages/ContactUs/ContactUs.js",
"miniprogram/pages/selections/selections.js",
"miniprogram/pages/selectionDetail/selectionDetail.js",
],
"exclude": [
"node_modules"


Yükleniyor…
İptal
Kaydet