gemercheung 11 месяцев назад
Родитель
Сommit
4b3e6065df

+ 3 - 3
app.json

@@ -30,7 +30,8 @@
     "pages/course/course",
     "pages/course_detail/course_detail",
     "pages/user/personal/personal",
-    "pages/user/my_course/my_course"
+    "pages/user/my_course/my_course",
+    "pages/user/my_host_course/index"
   ],
   "requiredPrivateInfos": [
     "getLocation"
@@ -46,8 +47,7 @@
     "color": "#B2B2B2",
     "selectedColor": "#000",
     "borderStyle": "black",
-    "list": [
-      {
+    "list": [{
         "pagePath": "pages/yuezhan/index",
         "text": "首页",
         "iconPath": "imgs/yuezhan.png",

+ 7 - 1
package-lock.json

@@ -5,7 +5,8 @@
   "packages": {
     "": {
       "dependencies": {
-        "tdesign-miniprogram": "^1.6.0"
+        "tdesign-miniprogram": "^1.6.0",
+        "wechat-request": "^2.7.0"
       }
     },
     "node_modules/dayjs": {
@@ -20,6 +21,11 @@
       "dependencies": {
         "dayjs": "^1.10.7"
       }
+    },
+    "node_modules/wechat-request": {
+      "version": "2.7.0",
+      "resolved": "https://registry.npmmirror.com/wechat-request/-/wechat-request-2.7.0.tgz",
+      "integrity": "sha512-qblQGYjZg7DW2v9zxmft9eeB4HD6vS9xyGQ2m7C2foUdFCWzQ32YrHyQdGhiOp9oZwPWxkXb4d/enX5BGph3ew=="
     }
   }
 }

+ 2 - 1
package.json

@@ -1,5 +1,6 @@
 {
   "dependencies": {
-    "tdesign-miniprogram": "^1.6.0"
+    "tdesign-miniprogram": "^1.6.0",
+    "wechat-request": "^2.7.0"
   }
 }

+ 57 - 13
pages/course/course.js

@@ -1,4 +1,10 @@
 // pages/course/course.js
+const {
+  getVRCourseList
+} = require('../../utils/request');
+const {
+  noExhibitionImg
+} = require('../../utils/images');
 Page({
 
   /**
@@ -8,6 +14,13 @@ Page({
     testData: 20,
     enable: false,
     scrollTop: 0,
+    noExhibitionImg,
+    query: {
+      pageNum: 1,
+      pageSize: 10,
+      searchKey: ""
+    },
+    list: []
   },
 
   /**
@@ -17,18 +30,29 @@ Page({
 
   },
 
+  async getCourseList() {
+    const {
+      code,
+      data
+    } = await getVRCourseList(this.data.query);
+
+    if (code === 0) {
+      console.log('data', data)
+      this.setData({
+        list: data.records
+      })
+    }
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
-  onReady() {
-
-  },
+  onReady() {},
 
   /**
    * 生命周期函数--监听页面显示
    */
   onShow() {
-
+    this.getCourseList();
   },
 
   /**
@@ -45,13 +69,18 @@ Page({
 
   },
 
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh() {
-
+  handlerSearch({
+    detail
+  }) {
+    console.log('detail', detail.value)
+    this.setData({
+      "query.searchKey": detail.value
+    }, () => {
+      this.getCourseList();
+    })
   },
 
+
   /**
    * 页面上拉触底事件的处理函数
    */
@@ -99,15 +128,30 @@ Page({
       }
     })
   },
-  handleVRDetail(item) {
-    console.log('item', item)
+  handleVRDetail({
+    currentTarget
+  }) {
+
+    const {
+      id
+    } = currentTarget.dataset;
+    console.log('item-id', id)
+
     wx.navigateTo({
-      url: "/pages/course_detail/course_detail",
+      url: `/pages/course_detail/course_detail?id=${id}`,
+
     })
   },
   onRefresh() {
     this.setData({
-      enable: true
+      enable: true,
+      query: {
+        pageNum: 1,
+        pageSize: 10,
+        searchKey: ""
+      },
+    }, () => {
+      this.getCourseList();
     });
     setTimeout(() => {
       this.setData({

+ 3 - 1
pages/course/course.json

@@ -2,6 +2,8 @@
   "disableScroll": true,
   "usingComponents": {
     "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh",
-    "t-back-top": "tdesign-miniprogram/back-top/back-top"
+    "t-back-top": "tdesign-miniprogram/back-top/back-top",
+    "t-image": "tdesign-miniprogram/image/image",
+    "t-empty": "tdesign-miniprogram/empty/empty"
   }
 }

+ 15 - 12
pages/course/course.wxml

@@ -10,33 +10,36 @@
         <view class='icon'>
           <view class='iconfont iconsousuo'></view>
         </view>
-        <input placeholder="搜索博物馆、展览" />
+        <input bind:input="handlerSearch" placeholder="搜索博物馆、展览" />
       </view>
     </view>
 
-    <view class="list">
-      <view class="item" wx:for="{{testData}}" wx:key="index" bindtap="handleVRDetail">
-        <image class="cover" mode="scaleToFill"
-          src="https://ossxiaoan.4dage.com/720yun_fd_manage/fd720_FARRQblYc/vtour/panos/fd720_FARRQblYc.tiles/thumb.jpg">
-        </image>
-        <view class="title" wx:if="{{index %2 ===0}}">灵隐飞来峰-大门票{{index}}</view>
-        <view class="title" wx:else>湖北省博物馆金牌讲师2H真人深度讲解含无线耳麦</view>
+    <view class="list" wx:if="{{list.length>0}}">
+      <view class="item" wx:for="{{list}}" wx:for-item="item" wx:key="index" data-id="{{item.id}}"
+        bindtap="handleVRDetail">
+        <t-image class="cover" mode="scaleToFill" src="https://sit-daikan.4dage.com/{{item.thumb}}" />
+
+        <view class="title">{{item.title}}</view>
+
         <div class="sub_cotnainer">
-          <text class="sub_title" wx:if="{{index %2 ===0}}">余老师带你飞-</text>
-          <text class="sub_title" wx:else> 陈老师深入挖掘故宫的陈老师深入挖掘故宫的陈老师深入挖掘故宫的</text>
+          <text class="sub_title">{{item.organization}}</text>
 
           <view class="sub_time">
             <image class="time" src="../../imgs/time.png"></image>
-            <text>45分钟</text>
+            <text>{{item.duration}}分钟</text>
           </view>
 
         </div>
         <view class="price">
-          9.05
+          {{item.fee}}
         </view>
       </view>
 
     </view>
+    <view class="empty" wx:else>
+      <t-empty image="{{noExhibitionImg}}" t-class-image="t-empty__image" description="暂没数据" />
+    </view>
+
     <t-back-top text="顶部" scroll-top="{{scrollTop}}" visibility-height="{{200}}" />
   </view>
 

+ 21 - 4
pages/course/course.wxss

@@ -22,8 +22,6 @@
   font-size: 24rpx;
 }
 
-
-
 .container .search .icon {
   position: relative;
   flex: 0 0 68rpx;
@@ -39,17 +37,23 @@
 
 .list {
   display: flex;
+  width: 100%;
   flex-direction: row;
   flex-wrap: wrap;
-  justify-content: center;
+  justify-content: flex-start;
   gap: 30rpx;
   padding-bottom: 50rpx;
+  padding-left: 30rpx;
+}
+
+.item {
+  /* padding: 0 10px; */
 }
 
 .cover {
   width: 330rpx;
   height: 186rpx;
-  border-radius: 8rpx 8rpx 8rpx 8rpx;
+  border-radius: 8rpx !important;
 }
 
 .title {
@@ -116,4 +120,17 @@
   text-align: left;
   font-style: normal;
   text-transform: none;
+}
+
+.empty {
+  min-height: 80vh;
+  width: 100%;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+
+.empty .t-empty__image {
+  width: 300rpx;
+  height: 200rpx;
 }

+ 36 - 0
pages/course_detail/course_detail.js

@@ -1,4 +1,7 @@
 // pages/course_detail/course_detail.js
+const {
+  getVRCourseDetail
+} = require('../../utils/request');
 Page({
 
   /**
@@ -6,15 +9,48 @@ Page({
    */
   data: {
     time: 96 * 60 * 1000,
+    data: {
+      compereId: null,
+      createTime: "",
+      creatorId: null,
+      creatorName: "",
+      display: null,
+      duration: null,
+      fee: null,
+      id: null,
+      isDap: null,
+      isFee: null,
+      isTop: null,
+      organization: "",
+      rtf: "",
+      sceneCode: "",
+      sort: null,
+      thumb: "",
+      thumbShare: "",
+      title: "",
+      titleSub: "",
+      updateTime: "",
+    }
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
+    if (options.id) {
+      // debugger
+      this.getVRCourseDetailData(options.id);
+    }
 
   },
 
+  async getVRCourseDetailData(id) {
+    const data = await getVRCourseDetail(id)
+    console.log('data', data.data)
+    this.setData({
+      data: data.data
+    })
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

Разница между файлами не показана из-за своего большого размера
+ 6 - 7
pages/course_detail/course_detail.wxml


+ 95 - 69
pages/user/index.js

@@ -19,7 +19,7 @@ Page({
 
     likeImg: '../../imgs/icon/like.png',
     commentImg: '../../imgs/icon/comment.png',
-    sawImg: '../../imgs/icon/saw.png', 
+    sawImg: '../../imgs/icon/saw.png',
     tabItem: [{
       name: '待付款',
       tag: "0",
@@ -35,18 +35,30 @@ Page({
     }],
 
     tabList: [{
-      name: '收藏',
-      img: "../../imgs/icon/like.png",
-      id: 0
-    }, {
-      name: '评论',
-      img: "../../imgs/icon/comment.png",
-      id: 1
-    }, {
-      name: '足迹',
-      img: "../../imgs/icon/saw.png",
-      id: 2
-    }],
+        name: '购买',
+        img: "../../imgs/icon/saw.png",
+        id: 3
+      },
+      {
+        name: '课程',
+        img: "../../imgs/icon/saw.png",
+        id: 4
+      },
+      {
+        name: '收藏',
+        img: "../../imgs/icon/like.png",
+        id: 0
+      }, {
+        name: '评论',
+        img: "../../imgs/icon/comment.png",
+        id: 1
+      }, {
+        name: '足迹',
+        img: "../../imgs/icon/saw.png",
+        id: 2
+      },
+
+    ],
 
     active: false,
     isLogin: ''
@@ -55,11 +67,11 @@ Page({
   /**
    * 生命周期函数--监听页面加载
    */
-  onLoad: function(options) {
+  onLoad: function (options) {
     // this.isLongPolling()
   },
 
-  isLongPolling: function() {
+  isLongPolling: function () {
     let loginSessionKey = wx.getStorageSync("token");
 
     let requestTask = wx.request({
@@ -96,7 +108,7 @@ Page({
 
   },
 
-  tapByIdx: function(e) {
+  tapByIdx: function (e) {
     let {
       idx
     } = e.currentTarget.dataset;
@@ -108,9 +120,9 @@ Page({
         case 0:
           wx.navigateTo({
             url: './my_follow/index',
-            success: function(res) {},
-            fail: function(res) {},
-            complete: function(res) {},
+            success: function (res) {},
+            fail: function (res) {},
+            complete: function (res) {},
           })
           break;
         case 1:
@@ -121,17 +133,27 @@ Page({
           })
           wx.navigateTo({
             url: './my_comment/index',
-            success: function(res) {},
-            fail: function(res) {},
-            complete: function(res) {},
+            success: function (res) {},
+            fail: function (res) {},
+            complete: function (res) {},
           })
           break;
         case 2:
           wx.navigateTo({
             url: './my_saw/index',
-            success: function(res) {},
-            fail: function(res) {},
-            complete: function(res) {},
+            success: function (res) {},
+            fail: function (res) {},
+            complete: function (res) {},
+          })
+          break;
+        case 3:
+          wx.navigateTo({
+            url: "/pages/user/my_course/my_course"
+          })
+          break;
+        case 4:
+          wx.navigateTo({
+            url: "/pages/user/my_host_course/index"
           })
           break;
       }
@@ -144,19 +166,19 @@ Page({
 
   },
 
-  bindGetUserInfo: function(e) {
+  bindGetUserInfo: function (e) {
     console.log(e.detail.userInfo)
   },
 
-  _myLikes: function() {
+  _myLikes: function () {
     this._isLogin();
 
     if (this.data.isLogin) {
       wx.navigateTo({
         url: './my_follow/index',
-        success: function(res) {},
-        fail: function(res) {},
-        complete: function(res) {},
+        success: function (res) {},
+        fail: function (res) {},
+        complete: function (res) {},
       })
     } else {
       Toast.showToast('tip', '请登录后查看', () => {
@@ -165,15 +187,15 @@ Page({
     }
 
   },
-  _myOrder: function() {
+  _myOrder: function () {
     this._isLogin();
 
     if (this.data.isLogin) {
       wx.navigateTo({
         url: './my_order/index',
-        success: function(res) {},
-        fail: function(res) {},
-        complete: function(res) {},
+        success: function (res) {},
+        fail: function (res) {},
+        complete: function (res) {},
       })
     } else {
       Toast.showToast('tip', '请登录后查看', () => {
@@ -183,7 +205,7 @@ Page({
 
   },
 
-  _isLogin: function() {
+  _isLogin: function () {
     if (wx.getStorageSync('token')) {
       let loginSessionKey = wx.getStorageSync("token");
       if (loginSessionKey != " ") {
@@ -212,7 +234,7 @@ Page({
                     avatarUrl: ""
                   })
                   app.globalData.isLogin = false;
-                  
+
                 }
               }
             })
@@ -237,7 +259,7 @@ Page({
 
             })
             app.globalData.isLogin = false;
-            
+
           }
         })
       } else {
@@ -261,14 +283,14 @@ Page({
 
   },
 
-  getUserProfile:function(e){
+  getUserProfile: function (e) {
     Toast.showToast2('loading');
-     // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
+    // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认
     // 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
     wx.getUserProfile({
       desc: '获取您的身份信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
       success: (res) => {
-        console.log(123456,res);
+        console.log(123456, res);
         let {
           encryptedData,
           iv,
@@ -285,7 +307,7 @@ Page({
               code
             } = res;
 
-            console.log(789,res);
+            console.log(789, res);
 
             if (code) {
               wx.request({
@@ -307,22 +329,21 @@ Page({
                       loginSessionKey
                     } = res.data.data;
                     wx.setStorageSync('token', loginSessionKey)
-                  }
-                  else{
+                  } else {
                     Toast.showToast('warn', '登录失败,请重试');
                   }
                 },
                 fail: res => {
                   Toast.showToast('warn', '登录失败,请重试');
-                  
+
                 },
-                complete: res=> {
+                complete: res => {
                   this._isLogin();
                   Toast.hideLoading();
                 },
               })
-  
-  
+
+
               // request["getLoginSessionKey"]({
               //   encryptedData,
               //   iv,
@@ -337,9 +358,9 @@ Page({
               //     this.isLongPolling();
               //     console.log(loginSessionKey)
               //   }
-  
+
               // }, err => {
-  
+
               // }, complete => {
               //   this._isLogin();
               //   Toast.hideLoading();
@@ -347,24 +368,24 @@ Page({
             }
           }
         })
-  
-  
-  
+
+
+
         // console.log(res.userInfo)
-  
+
         // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
         // 所以此处加入 callback 以防止这种情况
         if (this.userInfoReadyCallback) {
           this.userInfoReadyCallback(res)
         }
       },
-      complete:(res)=>{
+      complete: (res) => {
         Toast.hideLoading();
       }
     })
   },
 
-// 微信改版了 
+  // 微信改版了 
   // _getUserInfoToLogin: function(e) {
   //   Toast.showToast2('loading');
 
@@ -421,7 +442,7 @@ Page({
   //             },
   //             fail: res => {
   //               Toast.showToast('warn', '登录失败,请重试');
-                
+
   //             },
   //             complete: res=> {
   //               this._isLogin();
@@ -492,7 +513,7 @@ Page({
   //   // }
   // },
 
-  _logout: function() {
+  _logout: function () {
 
     if (this.data.isLogin) {
       Toast.showToast2('loading');
@@ -520,7 +541,7 @@ Page({
 
   },
 
-  tapToOrderByidx: function(e) {
+  tapToOrderByidx: function (e) {
     let {
       status,
       id
@@ -529,9 +550,9 @@ Page({
     if (this.data.isLogin) {
       wx.navigateTo({
         url: `./my_order/index?status=${status}&&id=${id}`,
-        success: function(res) {},
-        fail: function(res) {},
-        complete: function(res) {},
+        success: function (res) {},
+        fail: function (res) {},
+        complete: function (res) {},
       })
     } else {
       Toast.showToast('tip', '请登录后查看', () => {
@@ -542,23 +563,28 @@ Page({
   },
 
 
-  clickCell: function() {
+  clickCell: function () {
     wx.navigateTo({
       url: './my_contact/index',
     })
   },
 
+  toPersonal() {
+    wx.navigateTo({
+      url: '/pages/user/personal/personal',
+    })
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
-  onReady: function() {
+  onReady: function () {
 
   },
 
   /**
    * 生命周期函数--监听页面显示
    */
-  onShow: function() {
+  onShow: function () {
     let {
       avatar = ""
     } = this.data;
@@ -576,35 +602,35 @@ Page({
   /**
    * 生命周期函数--监听页面隐藏
    */
-  onHide: function() {
+  onHide: function () {
 
   },
 
   /**
    * 生命周期函数--监听页面卸载
    */
-  onUnload: function() {
+  onUnload: function () {
 
   },
 
   /**
    * 页面相关事件处理函数--监听用户下拉动作
    */
-  onPullDownRefresh: function() {
+  onPullDownRefresh: function () {
 
   },
 
   /**
    * 页面上拉触底事件的处理函数
    */
-  onReachBottom: function() {
+  onReachBottom: function () {
 
   },
 
   /**
    * 用户点击右上角分享
    */
-  onShareAppMessage: function() {
+  onShareAppMessage: function () {
 
   }
 })

+ 6 - 5
pages/user/index.wxml

@@ -7,16 +7,17 @@
         <image mode="aspectFit" class='user_avatar' src='{{avatarUrl||avatar}}'></image>
         <text class='user_nickName'>{{isLogin?avatarName:"登录"}}</text>
         <!-- <button open-type="getUserInfo" class='user_avatar_btn' bindgetuserinfo="_getUserInfoToLogin"></button> -->
-        <button class='user_avatar_btn' bindtap="getUserProfile"></button>
+        <button class='user_avatar_btn' bindtap="toPersonal"></button>
       </view>
     </view>
   </view>
   <view>
     <view class="fdkk-cells">
-    <view  wx:for="{{tabList}}" bindtap='tapByIdx' data-idx='{{item.id}}' wx:key="index">
-    
-    </view>
-      <view wx:for="{{tabList}}" bindtap='tapByIdx' data-idx='{{item.id}}' wx:key="index"  hover-class='none' class="weui-cell">
+      <view wx:for="{{tabList}}" bindtap='tapByIdx' data-idx='{{item.id}}' wx:key="index">
+
+      </view>
+      <view wx:for="{{tabList}}" bindtap='tapByIdx' data-idx='{{item.id}}' wx:key="index" hover-class='none'
+        class="weui-cell">
         <view class="weui-cell__hd">
         </view>
         <view class="weui-cell__bd">

+ 1 - 1
pages/user/my_course/my_course.wxml

@@ -5,7 +5,7 @@
   <view class="container">
     <view class="list">
       <view class="course_item " wx:for="{{testData}}" wx:key="index">
-        <t-image class="cover" src="" mode="aspectFill" aria-label="一个放置在墙角的黄色行李箱" />
+        <t-image class="cover" src="https://ossxiaoan.4dage.com/720yun_fd_manage/fodder/20230506_163327998.jpg" mode="aspectFill" aria-label="一个放置在墙角的黄色行李箱" />
         <view class="content">
           <view class="title">
             天安门广场+明清皇家宫殿紫禁城+八达岭长城赏塞外风光+半部, 天安门广场+明清皇家宫殿紫禁城+八达岭长城赏塞外风光+半部, 天安门广场+明清皇家宫殿紫禁城+八达岭长城赏塞外风光+半部

+ 85 - 0
pages/user/my_host_course/index.js

@@ -0,0 +1,85 @@
+// pages/user/my_course/my_course.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    testData: 10,
+    time: 96 * 60 * 1000,
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  },
+  onRefresh() {
+    this.setData({
+      enable: true
+    });
+    setTimeout(() => {
+      this.setData({
+        enable: false
+      });
+    }, 1500);
+  },
+  onScroll(e) {
+    const {
+      scrollTop
+    } = e.detail;
+    this.setData({
+      scrollTop
+    });
+  }
+})

+ 11 - 0
pages/user/my_host_course/index.json

@@ -0,0 +1,11 @@
+{
+  "navigationBarTitleText": "我的课程",
+  "usingComponents": {
+    "t-pull-down-refresh": "tdesign-miniprogram/pull-down-refresh/pull-down-refresh",
+    "t-skeleton": "tdesign-miniprogram/skeleton/skeleton",
+    "t-back-top": "tdesign-miniprogram/back-top/back-top",
+    "t-image": "tdesign-miniprogram/image/image",
+    "t-button": "tdesign-miniprogram/button/button",
+    "t-count-down": "tdesign-miniprogram/count-down/count-down"
+  }
+}

+ 41 - 0
pages/user/my_host_course/index.wxml

@@ -0,0 +1,41 @@
+<!--pages/user/my_course/my_course.wxml-->
+<t-pull-down-refresh value="{{enable}}" loadingTexts="{{['下拉刷新', '松手刷新', '正在刷新', '刷新完成']}}" bind:refresh="onRefresh"
+  bind:scroll="onScroll">
+  <!-- 包裹页面全部内容 -->
+  <view class="container">
+    <view class="list">
+      <view class="course_item_container" wx:for="{{testData}}" wx:key="index">
+        <view class="course_item ">
+          <t-image class="cover" src="https://ossxiaoan.4dage.com/720yun_fd_manage/fodder/20230506_163327998.jpg"
+            mode="aspectFill" aria-label="一个放置在墙角的黄色行李箱" />
+          <view class="content">
+            <view class="title">
+              天安门广场+明清皇家宫殿紫禁城+八达岭长城赏塞外风光+半部, 天安门广场+明清皇家宫殿紫禁城+八达岭长城赏塞外风光+半部, 天安门广场+明清皇家宫殿紫禁城+八达岭长城赏塞外风光+半部
+            </view>
+            <view class="sub_info">
+              <view class="author">
+                余老师带你飞
+              </view>
+              <view class="status">
+                <image class="time" src="../../../imgs/time.png"></image>
+                <text>45分钟</text>
+              </view>
+            </view>
+          </view>
+        </view>
+        <view class="entry">
+          <t-count-down class="count" size="small" content="default" time="{{ time }}" format="HH:mm:ss:SSS"
+            theme="square" millisecond> </t-count-down>
+          <!-- <text>xxxx</text> -->
+          <view class="btn">
+            <t-button theme="danger" size="extra-small" shape="round">开始课程</t-button>
+          </view>
+
+        </view>
+      </view>
+
+    </view>
+
+    <t-back-top text="顶部" scroll-top="{{scrollTop}}" visibility-height="{{100}}" />
+  </view>
+</t-pull-down-refresh>

+ 162 - 0
pages/user/my_host_course/index.wxss

@@ -0,0 +1,162 @@
+/* pages/user/my_course/my_course.wxss */
+.container {
+  padding-bottom: 56rpx;
+  overflow: hidden;
+  width: 100%;
+  min-height: calc(100vh - 56rpx);
+  background: #F5F5F5;
+}
+
+.container-title {
+  font-size: 48rpx;
+  font-weight: 700;
+  line-height: 64rpx;
+  margin: 48rpx 32rpx 0;
+  color: var(--td-text-color-primary);
+}
+
+.container-desc {
+  font-size: 28rpx;
+  color: var(--td-text-color-secondary);
+  margin: 16rpx 32rpx 0;
+  line-height: 44rpx;
+}
+
+.pulldown-reflesh__content {
+  margin: 64rpx 32rpx 0;
+  position: relative;
+}
+
+.row {
+  display: flex;
+  justify-content: space-between;
+  margin-top: 32rpx;
+}
+
+.text {
+  position: absolute;
+  top: 152rpx;
+  left: 50%;
+  transform: translateX(-50%);
+  text-align: center;
+  font-size: 32rpx;
+  color: var(--td-text-color-disabled);
+  width: 686rpx;
+}
+
+.list {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  gap: 20rpx 0;
+}
+
+.course_item_container {
+  width: 670rpx;
+  background: #FFFFFF;
+  border-radius: 16rpx 16rpx 16rpx 16rpx;
+  padding: 20rpx 20rpx 0 20rpx;
+  display: flex;
+  flex-direction: column;
+}
+
+
+
+.course_item {
+  width: 100%;
+  height: 126rpx;
+  display: flex;
+  flex-direction: row;
+  justify-content: flex-start;
+  overflow: hidden;
+  margin-bottom: 20rpx;
+}
+
+.course_item .cover {
+  width: 220rpx;
+  height: 126rpx;
+}
+
+.course_item .content {
+  flex: 1;
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+}
+
+.course_item.disabled {
+  pointer-events: none;
+  opacity: 0.5;
+}
+
+.course_item .title {
+  max-height: 80rpx;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  word-break: break-all;
+  display: -webkit-box;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 2;
+  font-size: 28rpx;
+  line-height: 33rpx;
+  font-weight: 400;
+  padding: 0 20rpx;
+}
+
+.sub_info {
+  color: rgba(136, 136, 136, 0.9);
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  font-size: 24rpx;
+  padding: 0 20rpx;
+  line-height: 28rpx;
+}
+
+.sub_info .author {
+  max-width: 300rpx;
+  text-overflow: ellipsis;
+  word-break: break-all;
+  white-space: nowrap;
+  overflow: hidden;
+}
+
+.status {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  gap: 0 5rpx;
+}
+
+.status .time {
+  width: 20rpx;
+  height: 20rpx;
+}
+
+.course_item_container .entry {
+  display: flex;
+  width: 100%;
+  flex-direction: row;
+  height: 100rpx;
+  justify-content: space-between;
+  align-items: center;
+
+  border-top: 0.5rpx solid rgba(245, 245, 245, 1);
+
+}
+
+.course_item_container .entry .count {
+  --td-countdown-bg-color: #404040;
+  --td-countdown-default-color: #404040;
+  --td-error-color-6: #404040;
+  --td-font-size-s: 20rpx;
+}
+
+.course_item_container .entry .btn {
+  --td-font-size-s: 20rpx;
+  --td-button-extra-small-font-size: 24rpx;
+  --td-button-extra-small-padding-horizontal: 30rpx;
+  width: 152rpx;  
+  /* background: rgba(0, 0, 0, 0.3); */
+}
+

+ 2 - 2
project.private.config.json

@@ -4,8 +4,8 @@
     "miniprogram": {
       "list": [
         {
-          "name": "my_course",
-          "pathName": "pages/user/my_course/my_course",
+          "name": "my_host_course",
+          "pathName": "pages/user/my_host_course/index",
           "query": "",
           "launchMode": "default",
           "scene": null

+ 0 - 0
utils/courseTime.js


+ 30 - 0
utils/request.js

@@ -0,0 +1,30 @@
+import wxRequest from 'wechat-request';
+
+
+const urls = {
+  //VR课堂
+  getVRCourseList: '/api/show/lesson/pageList',
+  //VR课堂详情
+  getVRCourseDetail: '/api/show/lesson/detail/'
+
+}
+
+wxRequest.defaults.baseURL = 'https://sit-daikan.4dage.com';
+wxRequest.defaults.headers['Token'] = wx.getStorageSync('token') || "";
+wxRequest.defaults.headers.post['Content-Type'] = 'application/json';
+
+
+async function getVRCourseList(params) {
+  return await (await wxRequest.post(urls.getVRCourseList, params)).data;
+}
+
+async function getVRCourseDetail(id) {
+  return await (await wxRequest.get(urls.getVRCourseDetail + id)).data;
+}
+
+
+
+module.exports = {
+  getVRCourseList,
+  getVRCourseDetail
+}

+ 15 - 13
utils/services.js

@@ -21,7 +21,7 @@ const urls = {
 
   //轮播图
   getBannerList: '/wx/api/banner/list',
-  getBannerDetail:'/wx/api/banner/detail',
+  getBannerDetail: '/wx/api/banner/detail',
 
   //展会
   getExhibitionList: "/wx/api/exhibition/listByType",
@@ -70,15 +70,17 @@ const urls = {
   recommend: '/wx/api/exhibition/recommend',
 
   //线下展讯热门推荐
-  offlineRecommend: '/wx/api/exhibition/offlineRecommend'
+  offlineRecommend: '/wx/api/exhibition/offlineRecommend',
+
+  
 };
 // 上传路径
 const uploadUrls = {};
 const requestFns = {};
 
-Object.keys(urls).forEach(function(key) {
+Object.keys(urls).forEach(function (key) {
   // console.log(token)
-  requestFns[key] = function(
+  requestFns[key] = function (
     data = {},
     method = "",
     success = () => {},
@@ -102,7 +104,7 @@ Object.keys(urls).forEach(function(key) {
       header: {
         'content-type': 'application/x-www-form-urlencoded'
       },
-      success: function(res) {
+      success: function (res) {
         if (res.data.code == 0) {
           // console.log(`request ${urls[key]}, success:`, res);
           success(res);
@@ -118,9 +120,9 @@ Object.keys(urls).forEach(function(key) {
               if (res.confirm) {
                 wx.navigateTo({
                   url: '/pages/login_page/index',
-                  success: function (res) { },
-                  fail: function (res) { },
-                  complete: function (res) { },
+                  success: function (res) {},
+                  fail: function (res) {},
+                  complete: function (res) {},
                 })
               } else if (res.cancel) {
                 console.log('用户点击取消')
@@ -130,8 +132,8 @@ Object.keys(urls).forEach(function(key) {
 
 
           // Toast.showToast('tip', "登录才能进行以上操作", success => {
-            
-            
+
+
           // })
           fail(res);
         } else if (res.data.code == 11) {
@@ -172,10 +174,10 @@ Object.keys(urls).forEach(function(key) {
           fail(res);
         }
       },
-      fail: function(res) {
+      fail: function (res) {
         fail(res);
       },
-      complete: function() {
+      complete: function () {
         complete()
       }
     });
@@ -185,4 +187,4 @@ Object.keys(urls).forEach(function(key) {
 
 module.exports.request = requestFns;
 module.exports.serverName = serverName;
-module.exports.imgServer = imgServer;
+module.exports.imgServer = imgServer;