details.vue 6.1 KB

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