details.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. <template>
  2. <view class="safeArea">
  3. <nav-bar title="详情"></nav-bar>
  4. <view class="detailsWrap">
  5. <view class="topTitle">
  6. <u-icon
  7. name="info-circle-fill"
  8. style="color: #ff3b30; margin-right: 8rpx"
  9. ></u-icon>
  10. <text
  11. >您的学时审核不通过,不通过原因如下,请查阅,并重学不通过的课程内容。</text
  12. >
  13. <!-- <view style="margin-left:34rpx;">致电<text @click="call">020-87085982</text>咨询</view> -->
  14. </view>
  15. <view class="detailsItem" v-for="(item, index) in listData" :key="index">
  16. <view class="head">
  17. <view class="tap">{{ getTypeName(item.sectionType) }}</view>
  18. <view class="title">{{ item.name }}</view>
  19. </view>
  20. <!-- <u-line color="#EEEEEE" />
  21. <view class="info">
  22. <view class="item" v-for="(items, indexs) in item.userStudyRecordPhoto" :key="indexs">
  23. <view class="imgbox">
  24. <image :src="$method.splitImgHost(items.photo)" style="width:100%" mode="widthFix" @click="seePhoto(item.userStudyRecordPhoto, indexs)"></image>
  25. </view>
  26. <view class="time">{{ $method.timestampToTime(items.createTime, false) }}</view>
  27. </view>
  28. </view> -->
  29. <u-line color="#EEEEEE" />
  30. <view class="reason">
  31. <view class="label">原因:</view>
  32. <view class="val">{{ item.auditReason }}</view>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="btn" @click="getBtn" v-if="rebuildShow">确认已阅读</view>
  37. </view>
  38. </template>
  39. <script>
  40. import { mapGetters } from "vuex";
  41. export default {
  42. components: {},
  43. data() {
  44. return {
  45. goodsId: null,
  46. gradeId: null,
  47. listData: [],
  48. orderGoodsId: "",
  49. rebuildShow: false,
  50. };
  51. },
  52. onLoad(option) {
  53. this.orderGoodsId = option.orderGoodsId || "";
  54. this.goodsId = Number(option.goodsId);
  55. this.gradeId = Number(option.gradeId);
  56. },
  57. onShow() {
  58. if (this.$method.isGoLogin()) { // 从公众号消息进来的没登录需要跳到登录页,登录后返回
  59. return;
  60. }
  61. this.getInfo();
  62. this.orderInfo();
  63. },
  64. methods: {
  65. orderInfo() {
  66. this.$api
  67. .orderInfo({
  68. orderGoodsId: this.orderGoodsId,
  69. })
  70. .then((res) => {
  71. console.log(res);
  72. if (res.data.code == 200) {
  73. let sysTime = this.$method.timest();
  74. console.log(res.data.data.serviceEndTime);
  75. console.log(sysTime);
  76. if (
  77. res.data.data.serviceEndTime &&
  78. res.data.data.serviceEndTime > +sysTime
  79. ) {
  80. //学习有效期范围内
  81. this.rebuildShow = true;
  82. } else {
  83. //不在学校有效期范围内隐藏
  84. this.rebuildShow = false;
  85. return;
  86. }
  87. if (res.data.data.classEndTime) {
  88. //配了班级有效期
  89. if (res.data.data.classEndTime > +sysTime) {
  90. //班级有效期没过期
  91. this.rebuildShow = true;
  92. } else {
  93. //过期
  94. this.rebuildShow = false;
  95. return;
  96. }
  97. } else {
  98. //没配按学习有效期
  99. }
  100. }
  101. });
  102. },
  103. seePhoto(option, index) {
  104. var arrays = option.map((item, indexs) => {
  105. return this.$method.splitImgHost(item.photo) + `?${indexs}`;
  106. });
  107. uni.previewImage({
  108. current: index,
  109. urls: arrays,
  110. });
  111. },
  112. getInfo() {
  113. this.$api
  114. .getcourseperiodcheat({
  115. goodsId: this.goodsId,
  116. gradeId: this.gradeId,
  117. orderGoodsId: this.orderGoodsId,
  118. })
  119. .then((res) => {
  120. if (res.data.code === 200) {
  121. this.listData = res.data.rows;
  122. }
  123. });
  124. },
  125. //重学
  126. getBtn() {
  127. var self = this;
  128. self.$api
  129. .courseperiodrebuild({
  130. goodsId: self.goodsId,
  131. gradeId: self.gradeId,
  132. orderGoodsId: self.orderGoodsId,
  133. })
  134. .then((res) => {
  135. if (res.data.code === 200) {
  136. // uni.redirectTo({
  137. // url:
  138. // "/pages2/wd/course?gid=" +
  139. // self.gradeId +
  140. // "&id=" +
  141. // self.goodsId +
  142. // "&orderGoodsId=" +
  143. // self.orderGoodsId,
  144. // });
  145. this.$http({
  146. url: '/course/courseList',
  147. method: 'get',
  148. data: {
  149. pageNum: 1,
  150. pageSize: 100,
  151. goodsId: this.goodsId,
  152. gradeId: this.gradeId,
  153. orderGoodsId: this.orderGoodsId,
  154. },
  155. })
  156. .then(res => {
  157. if (res.data.code == 200) {
  158. if(res.data.total > 1) {
  159. uni.redirectTo({
  160. url: `/pages3/polyv/detail?id=''&goodsId=${this.goodsId}&orderGoodsId=${this.orderGoodsId}&gradeId=${this.gradeId}`
  161. })
  162. } else if(res.data.total == 1) {
  163. uni.redirectTo({
  164. url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${this.goodsId}&orderGoodsId=${this.orderGoodsId}&gradeId=${this.gradeId}`
  165. })
  166. } else {
  167. uni.showToast({
  168. icon:'none',
  169. title:'暂无可观看的视频课程'
  170. })
  171. }
  172. }
  173. })
  174. // uni.navigateTo({
  175. // url: `/pages3/polyv/detail?id=''&goodsId=${this.goodsId}&orderGoodsId=${this.orderGoodsId}&gradeId=${this.gradeId}`
  176. // })
  177. }
  178. });
  179. // uni.showModal({
  180. // title:"注意",
  181. // content:`如对审核结果有异议,请勿点击确认重学。致电020-87085982咨询`,
  182. // confirmText:"确认重学",
  183. // success:function(res){
  184. // if(res.confirm){
  185. // self.$api.courseperiodrebuild({
  186. // goodsId: self.goodsId,
  187. // gradeId: self.gradeId,
  188. // orderGoodsId:self.orderGoodsId
  189. // }).then(res => {
  190. // if(res.data.code === 200){
  191. // uni.redirectTo({
  192. // url: '/pages2/wd/course?gid='+self.gradeId+'&id=' + self.goodsId+'&orderGoodsId='+ self.orderGoodsId
  193. // })
  194. // }
  195. // })
  196. // }
  197. // }
  198. // })
  199. },
  200. getTypeName(int) {
  201. if (int === 0) {
  202. return "试卷";
  203. }
  204. if (int === 1) {
  205. return "视频";
  206. }
  207. if (int === 2) {
  208. return "直播";
  209. }
  210. if (int === 3) {
  211. return "回放";
  212. }
  213. },
  214. call() {
  215. uni.makePhoneCall({
  216. phoneNumber: "020-87085982",
  217. });
  218. },
  219. },
  220. onReachBottom() {},
  221. computed: { ...mapGetters(["userInfo"]) },
  222. };
  223. </script>
  224. <style>
  225. page {
  226. background: #eaeef1;
  227. }
  228. </style>
  229. <style scoped lang="scss">
  230. .detailsWrap {
  231. padding: 8rpx 8rpx 140rpx;
  232. }
  233. .topTitle {
  234. border-radius: 24rpx;
  235. background-color: #ffebea;
  236. padding: 10rpx 24rpx;
  237. color: #ff3b30;
  238. font-size: 24rpx;
  239. margin-bottom: 8rpx;
  240. }
  241. .detailsItem {
  242. background: #ffffff;
  243. border-radius: 16rpx;
  244. margin-bottom: 16rpx;
  245. .head {
  246. padding: 26rpx 24rpx;
  247. display: flex;
  248. font-size: 30rpx;
  249. font-family: PingFang SC;
  250. font-weight: bold;
  251. color: #666666;
  252. .tap {
  253. width: 56rpx;
  254. height: 28rpx;
  255. line-height: 26rpx;
  256. text-align: center;
  257. border: 2rpx solid #666666;
  258. border-radius: 8rpx;
  259. font-size: 20rpx;
  260. font-family: PingFang SC;
  261. font-weight: 400;
  262. color: #666666;
  263. margin-right: 8rpx;
  264. flex-shrink: 0;
  265. position: relative;
  266. top: 6rpx;
  267. }
  268. }
  269. .info {
  270. padding: 17rpx 24rpx;
  271. display: flex;
  272. flex-wrap: wrap;
  273. .item {
  274. width: 160rpx;
  275. font-size: 20rpx;
  276. font-family: PingFang SC;
  277. font-weight: 500;
  278. color: #666666;
  279. margin: 0 8rpx 16rpx 0;
  280. .imgbox {
  281. width: 160rpx;
  282. height: 160rpx;
  283. border-radius: 8px;
  284. overflow: hidden;
  285. margin-bottom: 7rpx;
  286. }
  287. }
  288. }
  289. .reason {
  290. display: flex;
  291. padding: 21rpx 24rpx;
  292. font-size: 30rpx;
  293. font-family: PingFang SC;
  294. font-weight: 500;
  295. color: #333333;
  296. .label {
  297. color: #666666;
  298. }
  299. .val {
  300. flex: 1;
  301. }
  302. }
  303. }
  304. .btn {
  305. width: 526rpx;
  306. height: 80rpx;
  307. background: #007aff;
  308. border-radius: 40rpx;
  309. font-size: 30rpx;
  310. font-family: PingFang SC;
  311. font-weight: bold;
  312. color: #ffffff;
  313. display: flex;
  314. justify-content: center;
  315. align-items: center;
  316. position: fixed;
  317. left: 50%;
  318. margin-left: -263rpx;
  319. bottom: 50rpx;
  320. }
  321. </style>