zxshi.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <template>
  2. <view class="">
  3. <u-navbar :border-bottom="false" back-icon-size="35" title-size="32" :background="background"
  4. :back-text-style="hhyanm" title-color="#ffffff" back-icon-color="#ffffff"></u-navbar>
  5. <view class="fzctob mywoddt" style="padding-bottom:30rpx;">
  6. <image :src="jsinfo.img"
  7. style="width: 152rpx;height: 152rpx;border-radius:160rpx;min-width:152rpx;margin-right: 24rpx;" mode="">
  8. </image>
  9. <view class="flztoa" style="width: 100%;">
  10. <view class="fsxto">
  11. <text class="letxtfy">{{jsinfo.title}}</text>
  12. <view class="fzctob letxtfya">
  13. <text v-for="item in jsinfo.tag">{{item}}</text>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="flztoa shiddwe">
  19. <view class="flztoa shiufh">
  20. <view class="fzddrew">
  21. <text>{{question_num}}</text>
  22. <text class="shiufhtx">获赞</text>
  23. </view>
  24. <view class="fzddrew">
  25. <text>{{lecturer_follow}}</text>
  26. <text class="shiufhtx">粉丝</text>
  27. </view>
  28. </view>
  29. <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)">
  30. {{jsinfo.is_follow == 0?'关注':'已关注'}}
  31. </view>
  32. </view>
  33. <view class="shiwdmmt">
  34. <view class="indhuyr">
  35. <view class="indjbrr"></view>
  36. <text>动态</text>
  37. </view>
  38. <view class="shidongt" v-for="(item,index) in question" :key="index">
  39. <view class="shibbert">
  40. <text>{{item.content}}</text>
  41. <view class="flztoa" style="margin-top: 46rpx;">
  42. <view class="fzctob">
  43. <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>
  44. <text class="shitxty">{{item.like_num}}</text>
  45. <view style="margin-left: 40rpx;" @click="toDetail(item.id)">
  46. <image src="/static/index/w3.png" style="width: 48rpx;height: 48rpx;min-width: 48rpx;" mode=""></image>
  47. </view>
  48. </view>
  49. <view class="">
  50. <text class="shitxtya">{{$u.timeFormat(item.create_time, 'yyyy:mm:dd hh:MM:ss')}}</text>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="fzjtod shitoob" v-if="type == 1">
  57. <view class="shitoobtxt" style="margin-bottom: 20rpx;" @click="pay">
  58. <text>找他倾诉/¥{{jsinfo.price}}</text>
  59. </view>
  60. </view>
  61. </view>
  62. </template>
  63. <style>
  64. page {
  65. background: #FAFAFA;
  66. }
  67. </style>
  68. <script>
  69. export default {
  70. data() {
  71. return {
  72. type:1,
  73. xqaxuye:false,
  74. background: {
  75. backgroundColor: '#374B6E',
  76. },
  77. hhyanm: {
  78. color: '#FFFFFF',
  79. },
  80. jsinfo:{},
  81. question:[],
  82. question_num:0,
  83. lecturer_follow:0,
  84. id:'',//讲师id
  85. user_id:'',//当前用户id
  86. deviceType:'wxapp'
  87. }
  88. },
  89. onLoad(e) {
  90. // #ifdef APP-PLUS
  91. this.deviceType = 'wxh5'
  92. // #endif
  93. // #ifdef MP-WEIXIN
  94. this.deviceType = 'wxapp'
  95. // #endif
  96. this.id = e.id;
  97. this.user_id = uni.getStorageSync('id');
  98. this.getinfo(this.user_id,this.id);
  99. if(e.type){
  100. this.type = e.type
  101. }
  102. },
  103. methods:{
  104. toDetail(id){
  105. uni.navigateTo({
  106. url:'./jiehuo-pl?id=' + id + '&user_id=' + uni.getStorageSync('id')
  107. })
  108. },
  109. //获取讲师详情信息
  110. getinfo(user_id,id) {
  111. this.$post({
  112. data: {
  113. do: 'LecturerIndex',
  114. data:{
  115. user_id:user_id,
  116. id:id
  117. }
  118. }
  119. }).then(res => {
  120. this.jsinfo = res.data.lecturer
  121. this.question = res.data.question
  122. this.question_num = res.data.question_num
  123. this.lecturer_follow = res.data.lecturer_follow
  124. })
  125. },
  126. //点赞
  127. like(id){
  128. let that = this;
  129. console.log(id,that.user_id)
  130. that.$post({
  131. data: {
  132. do: 'QuestionLike',
  133. data: {
  134. question_id: id,
  135. user_id: that.user_id
  136. }
  137. }
  138. }).then(res => {
  139. that.getinfo(this.user_id,this.id);
  140. })
  141. },
  142. //关注
  143. guanzhu(id){
  144. let that = this;
  145. that.$post({
  146. data: {
  147. do: 'LecturerFollow',
  148. data: {
  149. id: id,
  150. user_id: that.user_id
  151. }
  152. }
  153. }).then(res => {
  154. that.getinfo(this.user_id,this.id);
  155. })
  156. },
  157. //找他倾诉
  158. pay(){
  159. let that = this;
  160. that.$post({
  161. data: {
  162. do: 'Course',
  163. data: {
  164. vip_pay: '0',
  165. course_id:that.jsinfo.id,
  166. user_id: that.user_id,
  167. good_type:'2',
  168. pw:'375',
  169. cdkey:'',
  170. is_luck:'',
  171. luck_id:''
  172. },
  173. deviceType:this.deviceType
  174. }
  175. }).then(res => {
  176. that.wechatpay(res.data);
  177. })
  178. },
  179. wechatpay(pay){
  180. var that = this
  181. // #ifdef APP-PLUS
  182. uni.requestPayment({
  183. provider: 'wxpay',
  184. orderInfo:pay.orderinfo,
  185. success() {
  186. uni.showToast({
  187. title: '支付成功'
  188. })
  189. },
  190. fail(res) {
  191. console.log(res)
  192. uni.showToast({
  193. title: '支付失败',
  194. icon: 'error'
  195. })
  196. }
  197. })
  198. // #endif
  199. // #ifdef MP-WEIXIN
  200. uni.requestPayment({
  201. provider: 'wxpay',
  202. timeStamp: pay.timeStamp,
  203. nonceStr: pay.nonceStr,
  204. package: pay.package,
  205. signType: 'MD5',
  206. paySign: pay.paySign,
  207. success() {
  208. uni.showToast({
  209. title: '支付成功'
  210. })
  211. },
  212. fail(res) {
  213. console.log(res)
  214. uni.showToast({
  215. title: '支付失败',
  216. icon: 'error'
  217. })
  218. }
  219. })
  220. // #endif
  221. }
  222. }
  223. }
  224. </script>
  225. <style lang="scss" scoped>
  226. </style>