details.vue 7.9 KB

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