detail.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <template>
  2. <view>
  3. <view style="background-color: #FFFFFF;">
  4. <view >
  5. <image :src="$method.splitImgHost(goodsData.coverUrl, true)" style="width: 100%;"></image>
  6. <view style="padding:20rpx">
  7. <view style="display: flex;margin-top: 13rpx;">
  8. <view class="yearTag">{{goodsData.createTime | formatDate}}</view>
  9. <view class="titleTag">{{goodsData.goodsName}}</view>
  10. </view>
  11. <view style="display: flex;justify-content: space-between;margin-top: 13rpx;">
  12. <view class="noteTag"><image src="/static/icon/wk_icon1.png" class="wk_icon"></image>
  13. 共 <text class="blackFont">{{goodsData.updateTime}}</text> 张卷 <text class="blackFont">1200</text> 道题 </view>
  14. </view>
  15. </view>
  16. </view>
  17. <u-line color="#D6D6DB" />
  18. <view>
  19. <view>
  20. <u-tabs :list="list" item-width="50%" font-size="24" bar-width="110" :current="current" @change="change" active-color="#007AFF"></u-tabs>
  21. </view>
  22. </view>
  23. <u-line color="#D6D6DB" />
  24. </view>
  25. <view class="intro" v-if="current == 0">
  26. <view class="content">
  27. <view class="top">本题库为广东省建筑施工企业安全生产管理人员安全生产考试第三批参考题库(可两行)</view>
  28. <image class="img" src="/static/intro.png" ></image>
  29. </view>
  30. </view>
  31. <view class="title-list" v-if="current == 1">
  32. <view class="content">
  33. <view class="list" v-for="(item1,index) in outline">
  34. <view class="module">
  35. .2Z106000 施工合同管理-模块标题
  36. </view>
  37. <view class="section" :data-index="index" @click="changeItem" :class="{up:!item1.showList}">
  38. 2Z106010 施工承发包的模式-2Z106020 施工合同...
  39. </view>
  40. <view class="article" v-if="item1.showList" :class="{active:index1 == 0}" v-for="(article,index1) in item1.list">
  41. 施工承发包模式-施工合同与物资采购合同二
  42. <navigator url="/pages2/bank/questionBankTest">
  43. <view v-if="index1 == 0" class="btn">试做</view>
  44. </navigator>
  45. </view>
  46. </view>
  47. <view class="list">
  48. <view class="section" :data-index="index" @click="changeItem">
  49. 2Z106010 施工承发包的模式-2Z106020 施工合同...
  50. </view>
  51. <view class="article" :class="{active:index1 == 0}" v-for="(article,index1) in 3">
  52. 施工承发包模式-施工合同与物资采购合同二
  53. <navigator url="/pages2/bank/questionBankTest">
  54. <view v-if="index1 == 0" class="btn">试做</view>
  55. </navigator>
  56. </view>
  57. </view>
  58. <view class="list">
  59. <view class="article" :class="{active:index1 == 0}" v-for="(article,index1) in 3">
  60. 施工承发包模式-施工合同与物资采购合同二
  61. <navigator url="/pages2/bank/questionBankTest">
  62. <view v-if="index1 == 0" class="btn">试做</view>
  63. </navigator>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. <view class="bottomBox">
  69. <view class="priceTag">¥ 999.00</view>
  70. <view style="display: flex;color: #FFFFFF;align-items: center;">
  71. <view class="btn1" @click="addCart">加购物车</view>
  72. <view class="btn2" @click="buy">立即购买</view>
  73. </view>
  74. </view>
  75. </view>
  76. </template>
  77. <script>
  78. import { mapGetters } from 'vuex';
  79. export default {
  80. data() {
  81. return {
  82. list: [
  83. {
  84. name: '详情'
  85. },
  86. {
  87. name: '大纲'
  88. }
  89. ],
  90. current:0,
  91. outline:[{
  92. list:[1,2,3,4],
  93. showList:false,
  94. }],
  95. id:'',
  96. goodsData:{}
  97. };
  98. },
  99. filters: {
  100. formatDate: function (value) {
  101. var date = new Date(value);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
  102. var Y = date.getFullYear();
  103. return Y;
  104. }
  105. },
  106. onUnload() {
  107. },
  108. computed: { ...mapGetters(['userInfo']) },
  109. onLoad(option) {
  110. console.log(option)
  111. this.id = option.id
  112. this.getDetail();
  113. },
  114. onShow() {
  115. },
  116. methods: {
  117. getDetail(){
  118. this.$api.goodsDetail(this.id).then(res => {
  119. console.log(res)
  120. this.goodsData = res.data.data;
  121. })
  122. },
  123. getModule() {
  124. },
  125. buy(){
  126. if(this.$method.isGoLogin()){
  127. return
  128. }
  129. this.$navTo.togo('/pages2/order/confirm_list');
  130. },
  131. addCart(){
  132. if(this.$method.isGoLogin()){
  133. return
  134. }
  135. uni.showToast({
  136. title: '添加成功',
  137. duration: 1000
  138. });
  139. },
  140. open(item){
  141. item.showChildren = !item.showChildren
  142. },
  143. change(index){
  144. this.current = index;
  145. },
  146. changeItem(e) {
  147. let index = e.currentTarget.dataset.index
  148. this.outline.forEach((arrItem,i) => {
  149. if(i == index) {
  150. arrItem.showList = !arrItem.showList
  151. }
  152. })
  153. }
  154. }
  155. };
  156. </script>
  157. <style >
  158. page{
  159. background-color: #EAEEF1;
  160. }
  161. </style>
  162. <style lang="scss" scope>
  163. .intro {
  164. background: #EAEEF1;
  165. padding:16rpx 16rpx 124rpx;
  166. .content {
  167. background:#fff;
  168. border-radius: 16rpx;;
  169. .top {
  170. border-radius: 16rpx;
  171. padding:32rpx 28rpx 16rpx;
  172. font-size: 30rpx;
  173. color: #333333;
  174. }
  175. .img {
  176. width:100%;
  177. }
  178. }
  179. }
  180. .title-list {
  181. background: #EAEEF1;
  182. padding:16rpx 16rpx 124rpx;
  183. .content {
  184. .list {
  185. background:#fff;
  186. margin-bottom:30rpx;
  187. overflow: hidden;
  188. border-radius: 16rpx;
  189. padding:10rpx 16rpx;
  190. .module {
  191. font-size: 30rpx;
  192. color: #333333;
  193. }
  194. .section {
  195. padding:30rpx 0;
  196. border-bottom: 1rpx solid #EEEEEE;
  197. font-size: 24rpx;
  198. color: #666666;
  199. &::before {
  200. content:'^';
  201. display: inline-block;
  202. margin-right:20rpx;
  203. }
  204. &.up {
  205. &::before {
  206. transform: rotate(180deg);
  207. }
  208. }
  209. }
  210. .article {
  211. height:80rpx;
  212. display: flex;
  213. align-items: center;
  214. margin-left:88rpx;
  215. font-size: 24rpx;
  216. color: #666666;
  217. border-bottom: 1rpx solid #EEEEEE;
  218. &:nth-last-of-type(1) {
  219. border:0;
  220. }
  221. &.active {
  222. color:#007AFF;
  223. .btn {
  224. width: 96rpx;
  225. height: 48rpx;
  226. line-height: 48rpx;
  227. text-align: center;
  228. color:#fff;
  229. font-size: 30rpx;
  230. border-radius:24rpx;
  231. background: #007AFF;
  232. margin-left:36rpx;
  233. border-radius: 24rpx;
  234. }
  235. }
  236. }
  237. }
  238. }
  239. }
  240. .btn2{
  241. width: 200rpx;
  242. height: 64rpx;
  243. background: linear-gradient(0deg, #FFB102, #FD644F);
  244. box-shadow: 0rpx 10rpx 16rpx 4rpx rgba(1, 99, 235, 0.04);
  245. border-radius: 32rpx;
  246. line-height: 64rpx;
  247. text-align: center;
  248. }
  249. .btn1{
  250. width: 200rpx;
  251. height: 64rpx;
  252. background: linear-gradient(0deg, #015EEA, #00C0FA);
  253. border-radius: 32rpx;
  254. line-height: 64rpx;
  255. text-align: center;
  256. margin-right: 20rpx;
  257. }
  258. .bottomBox{
  259. position: fixed;
  260. bottom: 0;
  261. width: 100%;
  262. left: 0;
  263. height:98rpx ;
  264. background-color: #FFFFFF;
  265. display: flex;
  266. justify-content: space-between;
  267. align-items: center;
  268. padding: 0 30rpx;
  269. }
  270. .blackFont{
  271. color: #333333;
  272. margin: 0 4rpx;
  273. }
  274. .wk_icon{
  275. width: 24rpx;
  276. height: 24rpx;
  277. margin-right: 12rpx;
  278. }
  279. .noteTag{
  280. ont-size: 24rpx;
  281. font-family: PingFang SC;
  282. font-weight: 500;
  283. color: #999999;
  284. align-items: center;
  285. }
  286. .priceTag{
  287. font-size: 30rpx;
  288. font-family: PingFang SC;
  289. font-weight: bold;
  290. color: #FF2D55;
  291. }
  292. .titleTag{
  293. font-size: 32rpx;
  294. font-weight: bold;
  295. color: #333333;
  296. margin-left: 8rpx;
  297. }
  298. .yearTag{
  299. width: 80rpx;
  300. height: 32rpx;
  301. background: #EBF5FF;
  302. border: 2rpx solid #007AFF;
  303. border-radius: 16rpx;
  304. font-size: 24rpx;
  305. color: #007AFF;
  306. text-align: center;
  307. line-height: 32rpx;
  308. }
  309. .itemBox{
  310. background: #FFFFFF;
  311. box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
  312. border-radius: 24rpx;
  313. width: 100%;
  314. padding: 20rpx;
  315. margin-bottom: 20rpx;
  316. }
  317. </style>