123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237 |
- <template>
- <view class="">
- <u-navbar :border-bottom="false" back-icon-size="35" title-size="32" :background="background"
- :back-text-style="hhyanm" title-color="#ffffff" back-icon-color="#ffffff"></u-navbar>
- <view class="fzctob mywoddt" style="padding-bottom:30rpx;">
- <image :src="jsinfo.img"
- style="width: 152rpx;height: 152rpx;border-radius:160rpx;min-width:152rpx;margin-right: 24rpx;" mode="">
- </image>
- <view class="flztoa" style="width: 100%;">
- <view class="fsxto">
- <text class="letxtfy">{{jsinfo.title}}</text>
- <view class="fzctob letxtfya">
- <text v-for="item in jsinfo.tag">{{item}}</text>
- </view>
- </view>
- </view>
- </view>
-
- <view class="flztoa shiddwe">
- <view class="flztoa shiufh">
- <view class="fzddrew">
- <text>{{question_num}}</text>
- <text class="shiufhtx">获赞</text>
- </view>
- <view class="fzddrew">
- <text>{{lecturer_follow}}</text>
- <text class="shiufhtx">粉丝</text>
- </view>
- </view>
- <view style="width: 120upx;height: 65upx;color: #ffffff;display: flex;align-items: center;justify-content: center;background: #F54E43;border-radius: 50upx;" @click="guanzhu(jsinfo.id)">
- {{jsinfo.is_follow == 0?'关注':'已关注'}}
- </view>
- </view>
-
- <view class="shiwdmmt">
- <view class="indhuyr">
- <view class="indjbrr"></view>
- <text>动态</text>
- </view>
-
- <view class="shidongt" v-for="(item,index) in question" :key="index">
- <view class="shibbert">
- <text>{{item.content}}</text>
- <view class="flztoa" style="margin-top: 46rpx;">
- <view class="fzctob">
- <image @click="like(item.id)" :src="item.is_like == 1?'/static/index/w1.png':'/static/index/w2.png'" style="width: 48rpx;height: 48rpx;min-width: 48rpx;" mode=""></image>
- <text class="shitxty">{{item.like_num}}</text>
- <view style="margin-left: 40rpx;" @click="toDetail(item.id)">
- <image src="/static/index/w3.png" style="width: 48rpx;height: 48rpx;min-width: 48rpx;" mode=""></image>
- </view>
- </view>
- <view class="">
- <text class="shitxtya">{{$u.timeFormat(item.create_time, 'yyyy:mm:dd hh:MM:ss')}}</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="fzjtod shitoob" v-if="type == 1">
- <view class="shitoobtxt" style="margin-bottom: 20rpx;" @click="pay">
- <text>找他倾诉/¥{{jsinfo.price}}</text>
- </view>
- </view>
- </view>
- </template>
- <style>
- page {
- background: #FAFAFA;
- }
- </style>
- <script>
- export default {
- data() {
- return {
- type:1,
- xqaxuye:false,
- background: {
- backgroundColor: '#374B6E',
- },
- hhyanm: {
- color: '#FFFFFF',
- },
- jsinfo:{},
- question:[],
- question_num:0,
- lecturer_follow:0,
- id:'',//讲师id
- user_id:'',//当前用户id
- deviceType:'wxapp'
-
- }
- },
- onLoad(e) {
- // #ifdef APP-PLUS
- this.deviceType = 'wxh5'
- // #endif
- // #ifdef MP-WEIXIN
- this.deviceType = 'wxapp'
- // #endif
- this.id = e.id;
- this.user_id = uni.getStorageSync('id');
- this.getinfo(this.user_id,this.id);
- if(e.type){
- this.type = e.type
- }
-
- },
- methods:{
- toDetail(id){
- uni.navigateTo({
- url:'./jiehuo-pl?id=' + id + '&user_id=' + uni.getStorageSync('id')
- })
- },
- //获取讲师详情信息
- getinfo(user_id,id) {
- this.$post({
- data: {
- do: 'LecturerIndex',
- data:{
- user_id:user_id,
- id:id
- }
- }
- }).then(res => {
- this.jsinfo = res.data.lecturer
- this.question = res.data.question
- this.question_num = res.data.question_num
- this.lecturer_follow = res.data.lecturer_follow
- })
- },
- //点赞
- like(id){
- let that = this;
- console.log(id,that.user_id)
- that.$post({
- data: {
- do: 'QuestionLike',
- data: {
- question_id: id,
- user_id: that.user_id
- }
- }
- }).then(res => {
- that.getinfo(this.user_id,this.id);
- })
- },
- //关注
- guanzhu(id){
- let that = this;
- that.$post({
- data: {
- do: 'LecturerFollow',
- data: {
- id: id,
- user_id: that.user_id
- }
- }
- }).then(res => {
- that.getinfo(this.user_id,this.id);
- })
- },
- //找他倾诉
- pay(){
- let that = this;
- that.$post({
- data: {
- do: 'Course',
- data: {
- vip_pay: '0',
- course_id:that.jsinfo.id,
- user_id: that.user_id,
- good_type:'2',
- pw:'375',
- cdkey:'',
- is_luck:'',
- luck_id:''
- },
- deviceType:this.deviceType
- }
- }).then(res => {
- that.wechatpay(res.data);
-
- })
- },
- wechatpay(pay){
- var that = this
- // #ifdef APP-PLUS
- uni.requestPayment({
- provider: 'wxpay',
- orderInfo:pay.orderinfo,
- success() {
- uni.showToast({
- title: '支付成功'
- })
- },
- fail(res) {
- console.log(res)
- uni.showToast({
- title: '支付失败',
- icon: 'error'
- })
- }
- })
- // #endif
- // #ifdef MP-WEIXIN
- uni.requestPayment({
- provider: 'wxpay',
- timeStamp: pay.timeStamp,
- nonceStr: pay.nonceStr,
- package: pay.package,
- signType: 'MD5',
- paySign: pay.paySign,
- success() {
- uni.showToast({
- title: '支付成功'
- })
- },
- fail(res) {
- console.log(res)
- uni.showToast({
- title: '支付失败',
- icon: 'error'
- })
- }
- })
- // #endif
-
- }
- }
- }
- </script>
- <style lang="scss" scoped>
-
- </style>
|