details.vue 7.3 KB

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