Browse Source

3091

yufei
余菲 9 months ago
parent
commit
195319a773
4 changed files with 48 additions and 0 deletions
  1. +9
    -0
      api/home.js
  2. +14
    -0
      package_first/pages/askDetail/index.js
  3. +5
    -0
      package_first/pages/askDetail/index.wxml
  4. +20
    -0
      package_first/pages/askDetail/index.wxss

+ 9
- 0
api/home.js View File

@@ -35,3 +35,12 @@ export const uploadBeauty = function(data) {
})
}

// 领取积分
export const getPoint = function(data) {
return request({
url: '/userPoints/receive',
method: 'POST',
data
})
}


+ 14
- 0
package_first/pages/askDetail/index.js View File

@@ -1,4 +1,5 @@
// package_first/pages/askDetail/index.js
import {getPoint} from '../../../api/home.js'
Page({

/**
@@ -31,5 +32,18 @@ Page({
this.setData({dataSource})
}
}
},
// 领取积分
getPoints() {
let params = {}
params.openid = wx.getStorageSync('openid')
params.knowId = this.data.dataSource.id
getPoint(params).then(res=> {
if(res.code === 0) {
wx.navigateBack({
delta: 0,
})
}
})
}
})

+ 5
- 0
package_first/pages/askDetail/index.wxml View File

@@ -4,4 +4,9 @@
<text class="detail_date">{{dataSource.createTime || ''}}</text>
<image wx:if="{{dataSource.image}}" class="detail_img" mode="widthFix" src="{{dataSource.image}}"></image>
<rich-text type="node" style="width:100%; white-space: pre-wrap;word-break: break-all;" nodes="{{dataSource.content}}"></rich-text>

<!-- 领取积分按钮 -->
<view class="btn_box">
<view class="btn_item" bindtap="getPoints">领取积分</view>
</view>
</view>

+ 20
- 0
package_first/pages/askDetail/index.wxss View File

@@ -7,6 +7,7 @@
justify-content: flex-start;
align-items: flex-start;
background-color: #ffffff;
position: relative;
}
.detail_title {
width: 100%;
@@ -22,4 +23,23 @@
.detail_img {
width: 100%;
margin-bottom: 20rpx;
}

.btn_box {
width: 100%;
padding: 0 30rpx;
position: fixed;
bottom: 20rpx;
left: 0;
}
.btn_item {
width: 100%;
height: 80rpx;
margin-bottom: 30rpx;
border-radius: 40rpx;
text-align: center;
line-height: 80rpx;
font-size: 32rpx;
color: #ffffff;
background-color: #2a82e4;
}

Loading…
Cancel
Save