details.vue 8.5 KB

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