details.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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.type) }}</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. if (this.$method.isGoLogin()) { // 从公众号消息进来的没登录需要跳到登录页,登录后返回
  54. return;
  55. }
  56. this.orderGoodsId = option.orderGoodsId || "";
  57. this.goodsId = Number(option.goodsId);
  58. this.gradeId = Number(option.gradeId);
  59. this.getInfo();
  60. this.orderInfo();
  61. },
  62. onShow() {},
  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. var self = this;
  127. self.$api
  128. .courseperiodrebuild({
  129. goodsId: self.goodsId,
  130. gradeId: self.gradeId,
  131. orderGoodsId: self.orderGoodsId,
  132. })
  133. .then((res) => {
  134. if (res.data.code === 200) {
  135. // uni.redirectTo({
  136. // url:
  137. // "/pages2/wd/course?gid=" +
  138. // self.gradeId +
  139. // "&id=" +
  140. // self.goodsId +
  141. // "&orderGoodsId=" +
  142. // self.orderGoodsId,
  143. // });
  144. uni.navigateTo({
  145. url: `/pages3/polyv/detail?id=''&goodsId=${this.goodsId}&orderGoodsId=${this.orderGoodsId}&gradeId=${this.gradeId}`
  146. })
  147. }
  148. });
  149. // uni.showModal({
  150. // title:"注意",
  151. // content:`如对审核结果有异议,请勿点击确认重学。致电020-87085982咨询`,
  152. // confirmText:"确认重学",
  153. // success:function(res){
  154. // if(res.confirm){
  155. // self.$api.courseperiodrebuild({
  156. // goodsId: self.goodsId,
  157. // gradeId: self.gradeId,
  158. // orderGoodsId:self.orderGoodsId
  159. // }).then(res => {
  160. // if(res.data.code === 200){
  161. // uni.redirectTo({
  162. // url: '/pages2/wd/course?gid='+self.gradeId+'&id=' + self.goodsId+'&orderGoodsId='+ self.orderGoodsId
  163. // })
  164. // }
  165. // })
  166. // }
  167. // }
  168. // })
  169. },
  170. getTypeName(int) {
  171. if (int === 0) {
  172. return "测试";
  173. }
  174. if (int === 1) {
  175. return "录播";
  176. }
  177. if (int === 2) {
  178. return "直播";
  179. }
  180. if (int === 3) {
  181. return "回放";
  182. }
  183. },
  184. call() {
  185. uni.makePhoneCall({
  186. phoneNumber: "020-87085982",
  187. });
  188. },
  189. },
  190. onReachBottom() {},
  191. computed: { ...mapGetters(["userInfo"]) },
  192. };
  193. </script>
  194. <style>
  195. page {
  196. background: #eaeef1;
  197. }
  198. </style>
  199. <style scoped lang="scss">
  200. .detailsWrap {
  201. padding: 8rpx 8rpx 140rpx;
  202. }
  203. .topTitle {
  204. border-radius: 24rpx;
  205. background-color: #ffebea;
  206. padding: 10rpx 24rpx;
  207. color: #ff3b30;
  208. font-size: 24rpx;
  209. margin-bottom: 8rpx;
  210. }
  211. .detailsItem {
  212. background: #ffffff;
  213. border-radius: 16rpx;
  214. margin-bottom: 16rpx;
  215. .head {
  216. padding: 26rpx 24rpx;
  217. display: flex;
  218. font-size: 30rpx;
  219. font-family: PingFang SC;
  220. font-weight: bold;
  221. color: #666666;
  222. .tap {
  223. width: 56rpx;
  224. height: 28rpx;
  225. line-height: 26rpx;
  226. text-align: center;
  227. border: 2rpx solid #666666;
  228. border-radius: 8rpx;
  229. font-size: 20rpx;
  230. font-family: PingFang SC;
  231. font-weight: 400;
  232. color: #666666;
  233. margin-right: 8rpx;
  234. flex-shrink: 0;
  235. position: relative;
  236. top: 6rpx;
  237. }
  238. }
  239. .info {
  240. padding: 17rpx 24rpx;
  241. display: flex;
  242. flex-wrap: wrap;
  243. .item {
  244. width: 160rpx;
  245. font-size: 20rpx;
  246. font-family: PingFang SC;
  247. font-weight: 500;
  248. color: #666666;
  249. margin: 0 8rpx 16rpx 0;
  250. .imgbox {
  251. width: 160rpx;
  252. height: 160rpx;
  253. border-radius: 8px;
  254. overflow: hidden;
  255. margin-bottom: 7rpx;
  256. }
  257. }
  258. }
  259. .reason {
  260. display: flex;
  261. padding: 21rpx 24rpx;
  262. font-size: 30rpx;
  263. font-family: PingFang SC;
  264. font-weight: 500;
  265. color: #333333;
  266. .label {
  267. color: #666666;
  268. }
  269. .val {
  270. flex: 1;
  271. }
  272. }
  273. }
  274. .btn {
  275. width: 526rpx;
  276. height: 80rpx;
  277. background: #007aff;
  278. border-radius: 40rpx;
  279. font-size: 30rpx;
  280. font-family: PingFang SC;
  281. font-weight: bold;
  282. color: #ffffff;
  283. display: flex;
  284. justify-content: center;
  285. align-items: center;
  286. position: fixed;
  287. left: 50%;
  288. margin-left: -263rpx;
  289. bottom: 50rpx;
  290. }
  291. </style>